---
title: "Update a doorlock key."
method: PATCH
path: "/doorlock/v1/keys/{id}"
tags: ["Door Locks"]
---

# Update a doorlock key.

`PATCH /doorlock/v1/keys/{id}`

## Request

- Base URL: `https://api.cloudbeds.com`
- URL: `https://api.cloudbeds.com/doorlock/v1/keys/{id}`
- Auth: OAuth 2
  - Authorization code: `https://api.cloudbeds.com/auth/oauth/authorize`
  - Token URL: `https://api.cloudbeds.com/auth/oauth/token` scopes: `write:doorLockKey`

## Path parameters

- `id` string, required

## Headers

- `x-property-id` string, required

## Request body

- DoorLockKeyUpdateRequestSchema
  - `status` 'processing' | 'completed' | 'failed' | 'deleted', nullable
  - `keyCode` string, nullable
  - `errorMessage` string, nullable

## Response `200`

Updated key.

- 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.dev/cloudbeds/apis/cloudbeds-api-v2.md) - [All operations](https://skmtc.dev/cloudbeds/apis/cloudbeds-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/cloudbeds/apis/cloudbeds-api-v2/revisions/69bffac143cc?raw)
