---
title: "Create a new doorlock key."
method: POST
path: "/doorlock/v1/keys"
tags: ["Door Locks"]
---

# Create a new doorlock key.

`POST /doorlock/v1/keys`

## Request body

- DoorLockKeyCreateRequestSchema
  - `propertyId` string, required
  - `reservationId` string, required — Reservation identifier.
  - `subReservationId` string, required — Sub-reservation identifier.
  - `issuerId` string, required
  - `startDateTime` string, Y-m-d\TH:i:sP, required — Start date and time of key.
  - `endDateTime` string, Y-m-d\TH:i:sP, required — End date and time of key.
  - `keyType` 'key_card' | 'access_code' | 'mobile_key', required — Key type.
  - `rooms` string[] — List of common room IDs.
  - `commonRooms` string[] — List of common room ids.
  - `externalId` string, nullable
  - `keyCode` string, nullable — Custom key code.
  - `status` 'processing' | 'completed' — Key status.
  - `encoder` string, nullable
  - `mobileId` string, nullable
  - `guestId` string, nullable

## Response `201`

A key that was just created.

- DoorLockKeyResponseSchema
  - `keyId` string, required
  - `propertyId` string, required
  - `reservationId` string, required
  - `subReservationId` string, required
  - `issuerId` string, required
  - `guestId` string, nullable
  - `rooms` string[], required
  - `commonRooms` string[], required
  - `startDateTime` string, Y-m-d\TH:i:sP, required
  - `endDateTime` string, Y-m-d\TH:i:sP, required
  - `encoder` string, nullable
  - `keyCode` string, nullable
  - `keyType` string, required
  - `mobileId` string, nullable
  - `externalId` string, nullable
  - `status` string, required
  - `errorMessage` string, nullable
  - `createdAt` string, required
  - `updatedAt` string, nullable

## Other responses

- `400` — Bad Request response
- `404` — Not found response
- `500` — Internal server error

---

[API](https://skmtc.net/cloudbeds/apis/cloudbeds-api.md) · [All operations](https://skmtc.net/cloudbeds/apis/cloudbeds-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cloudbeds/cloudbeds-api/revisions/2faa857793e8/schema)
