---
title: "Update rooms' access key codes"
method: PUT
path: "/v2/reservations/bookings/{id}/keyCodes"
tags: ["Reservations"]
---

# Update rooms' access key codes

`PUT /v2/reservations/bookings/{id}/keyCodes`

## Request

- Base URL: `https://api.lodgify.com`
- URL: `https://api.lodgify.com/v2/reservations/bookings/{id}/keyCodes`
- Auth: API key in header `X-ApiKey`
- TypeScript: <https://skmtc.dev/lodgify/apis/lodgify-public-api-v1/docs/v2/reservations/bookings/:id/keyCodes/put.ts> (a function with typed inputs; its response is checked against the schema)

Updates the access key codes of rooms belonging to a given booking.

## Path parameters

- `id` integer, required

## Request body

- LodgifyApiPublicReservationsModelsV2ReservationsBookingsBookingKeyCodeDto: Represents a Booking with the list of room types and keycodes to access to the properties rented.
  - `rooms` LodgifyApiPublicReservationsModelsV2ReservationsBookingsBookingRoomTypeKeyCodeDto[], nullable: List of room types of the booking.
    - `room_type_id` integer: Identifier of the room type
    - `key_code` string, nullable: KeyCode PIN to access to the property rented.

## Response `200`

Returns the updated booking

- LodgifyApiPublicReservationsModelsV2ReservationsBookingsBookingKeyCodeDto: Represents a Booking with the list of room types and keycodes to access to the properties rented.
  - `rooms` LodgifyApiPublicReservationsModelsV2ReservationsBookingsBookingRoomTypeKeyCodeDto[], nullable: List of room types of the booking.
    - `room_type_id` integer: Identifier of the room type
    - `key_code` string, nullable: KeyCode PIN to access to the property rented.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `404`: Booking or Room not found
- `500`: An error occurred in our side

---

[API](https://skmtc.dev/lodgify/apis/lodgify-public-api-v1.md) - [All operations](https://skmtc.dev/lodgify/apis/lodgify-public-api-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/lodgify/apis/lodgify-public-api-v1/revisions/ddf40757d411?raw)
