TempKeyChange a temporary access key

Change a temporary access key

Changes any of the key's validity window, use limit, access mode and whitelist, and guest instructions. Its doors never change. The change is judged against the key as it stands, as a whole. The caller must be authorized for every lock of the key. A revoked key is not found (404); one expired and retired cannot be changed (409).

curl -X PATCH "https://api.spkey.co/temp-keys/example_string" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN (JWT)" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
  "validFrom": "2024-12-25T10:00:00Z",
  "validUntil": "2024-12-25T10:00:00Z",
  "maxUses": "null",
  "accessMode": "public",
  "allowedUserIds": [
    "example_string"
  ],
  "description": "null"
}'
{
  "success": true,
  "tempKey": {
    "uuid": "example_string",
    "url": "example_string",
    "validFrom": "example_string",
    "validUntil": "example_string",
    "description": "null",
    "createdBy": "example_string",
    "createdAt": "example_string",
    "revokedAt": "null",
    "accessMode": "public",
    "allowedUserIds": [
      "example_string"
    ],
    "maxUses": "null",
    "usedCount": 3.14,
    "doors": [
      {
        "id": 3.14,
        "lockId": "example_string",
        "lockUuid": "example_string",
        "label": "null",
        "accessMethod": "key"
      }
    ]
  }
}
PATCH
/temp-keys/{uuid}
PATCH
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token (JWT)
Bearer Tokenstring
Required

JWT token from SmartphoneKey authentication. Identifies the B2C user or B2B service.

JWT token from SmartphoneKey authentication. Identifies the B2C user or B2B service.
API Key (header: X-API-Key)
X-API-Keystring
Required

API key for B2B organization access. Provided during organization onboarding.

API key for B2B organization access. Provided during organization onboarding.
path
uuidstring
Required

Collective temporary key UUID

Content-Typestring
Required

The media type of the request body

Options: application/json
validFromstring
Format: date-time
validUntilstring
Format: date-time
maxUsesintegernull

null = unlimited

accessModestring
Options: public, user-whitelist
descriptionstringnull
Max length: 2000
Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token (JWT). JWT token from SmartphoneKey authentication. Identifies the B2C user or B2B service.

header
X-API-Keystring
Required

API Key for authentication. API key for B2B organization access. Provided during organization onboarding.

Path Parameters

uuidstring
Required

Collective temporary key UUID

Responses

successboolean
Required
tempKeyobject
Required