TempKeyCreate a collective / shared temporary access key

Create a collective / shared temporary access key

Generates one shared guest credential spanning multiple doors. Each door is opened by slide-to-open ('key'), by the key's PIN at a connected entrance panel ('code'), or either ('both'). If any door is code/both, ONE PIN is minted for the whole key and returned here — this response is the only place it is ever returned in the clear. The caller must be authorized for every lock included.

curl -X POST "https://api.spkey.co/collective-temp-keys" \
  -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",
  "description": "example_string",
  "doors": [
    {
      "lockId": "null",
      "label": "example_string",
      "accessMethod": "key"
    }
  ]
}'
{
  "success": true,
  "uuid": "example_string",
  "url": "example_string",
  "validFrom": "example_string",
  "validUntil": "example_string",
  "doors": [
    {
      "id": 3.14,
      "lockId": "example_string",
      "lockUuid": "example_string",
      "label": "null",
      "accessMethod": "key"
    }
  ],
  "pin": "null"
}
POST
/collective-temp-keys
POST
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.
Content-Typestring
Required

The media type of the request body

Options: application/json
validFromstring
Required
Format: date-time
validUntilstring
Required
Format: date-time
descriptionstring
Max length: 2000
doorsarray
Required

Doors/rooms/zones included in this shared credential

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.

Body

application/json
doorsarray
Required

Doors/rooms/zones included in this shared credential

Responses