> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keebai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PATCH /v1/scheduling/booking/resource-bookings/:id

> Change the dates of a customer's resource booking: new check-in or check-out of a stay, or new date and time of a block.

Moves a resource booking of the customer to new dates. Keebai checks the new dates with the same rules as a new booking, without counting the booking itself, and recomputes the price.

* **Stay**: send `check_in`, `check_out` or both, and optionally the times. A new `check_in` alone keeps the number of nights; a new `check_out` alone keeps the check-in.
* **Block**: send `date`, `start_time` or both. The duration stays the same.
* **Older resource appointment** (`kind: "appointment"`): send `date` and `start_time`. It moves through the appointment flow.

The number of guests and the resource cannot be changed here.

**A cancelled booking is booked again.** New dates on a cancelled booking do not reopen it: they create a **new** booking with the same resource, customer, guests and notes, and the answer carries the new booking's `id`. Send an `Idempotency-Key` so a retry does not book twice.

## Endpoint

```
PATCH https://api.keebai.com/v1/scheduling/booking/resource-bookings/:id
```

## Required scope

`scheduling:appointments:update`

## Path params

* `id`: booking id, or the id of an older resource appointment.

## Query params

```json theme={"system"}
{
  "customer_phone": "+56987654321"
}
```

* `customer_phone`: required. The booking must belong to this phone; if it does not, the answer is `404`.

## Headers

* `Authorization: Bearer kbai_pk_<token>`. Required.
* `Content-Type: application/json`. Required.
* `Idempotency-Key`: optional, recommended. 1 to 128 letters, digits, `-` or `_`.

## Body

At least one field. Stay:

```json theme={"system"}
{
  "check_in": "2026-12-03",
  "check_out": "2026-12-06",
  "check_in_time": "11:00",
  "check_out_time": null
}
```

Block, or older resource appointment:

```json theme={"system"}
{
  "date": "2026-12-04",
  "start_time": "20:00"
}
```

A body without any of these fields returns `400`. `party_size`, `resource_id` and any other field are rejected with `400`.

## Example request

```bash curl theme={"system"}
curl -X PATCH "https://api.keebai.com/v1/scheduling/booking/resource-bookings/665f00000000000000000c01?customer_phone=%2B56987654321" \
  -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: move-6b0a1f2e-20261206" \
  -d '{ "check_out": "2026-12-06" }'
```

## Response

### 200 OK

The booking with its new dates and price, shaped like an item of the [search](https://docs.keebai.com/dev/endpoints/scheduling-resource-booking-search.md):

```json theme={"system"}
{
  "id": "665f00000000000000000c01",
  "kind": "resource_booking",
  "booking_unit": "night",
  "resource": "Suite canina · Mediana",
  "resource_id": "665f00000000000000000a01",
  "branch": "Sucursal Centro",
  "branch_id": "665f00000000000000000b01",
  "label": "Ingreso jue 3 dic · Retiro dom 6 dic · 3 noches",
  "start_time": "2026-12-03T11:00:00-03:00",
  "end_time": "2026-12-06T14:30:00-03:00",
  "time_zone": "America/Santiago",
  "check_in": "2026-12-03",
  "check_out": "2026-12-06",
  "nights": 3,
  "party_size": 1,
  "price": 60000,
  "currency": "CLP",
  "status": "booked",
  "payment_status": "pending",
  "payment_link": null,
  "payment_hold_expires_at": null,
  "customer_phone": "56987654321"
}
```

### 400 Bad Request

The same date codes as [creating a booking](https://docs.keebai.com/dev/endpoints/scheduling-resource-booking-create.md#400-bad-request): `STAY_INVALID_RANGE`, `STAY_MIN_NIGHTS`, `STAY_MAX_NIGHTS`, `STAY_CLOSED_DAY`, `STAY_OUTSIDE_WINDOW`, `STAY_TOO_SOON`, `STAY_TOO_FAR`, `BLOCK_SLOT_INVALID`, `RESOURCE_BOOKING_UNIT_MISMATCH`. Also `BAD_REQUEST` when the body has no date or time.

### 404 Not Found

`RESOURCE_BOOKING_NOT_FOUND`: it does not exist, belongs to another company, or is not the customer's.

### 409 Conflict

```json theme={"system"}
{
  "error": {
    "code": "RESOURCE_BOOKING_LOCKED_BY_PAYMENT",
    "message": "La reserva tiene un cobro en curso o pagado; el cambio alteraría su precio"
  }
}
```

Other `409` codes:

```json theme={"system"}
{
  "STAY_FULL": "a night of the new dates has no room; details { date, remaining }",
  "RESOURCE_CONFLICT": "the new block has no room left",
  "RESOURCE_BOOKING_CLOSED": "the booking is completed or no_show and admits no changes",
  "RESOURCE_PROFESSIONAL_BUSY": "the block resource belongs to a professional who already has an appointment, a time block or another booking at the new time; details { professional_id, start, end }",
  "RESOURCE_BUSY": "another booking of the same resource was being written; details { retryable: true }"
}
```

`RESOURCE_BOOKING_LOCKED_BY_PAYMENT` means the move would change the price of a booking that is awaiting its payment or already has a sale. A move that keeps the price is always allowed.

On `RESOURCE_PROFESSIONAL_BUSY`, don't retry that block: check [GET resources/availability](https://docs.keebai.com/dev/endpoints/scheduling-resource-availability.md) again for that day and offer another time or day.

### 503 Service Unavailable

`RESOURCE_LOCK_UNAVAILABLE` with `retryable: true`: Keebai couldn't lock the resource to write the change. The booking stays as it was. Retry after a short pause.

### 401 Unauthorized · 403 Forbidden

Same semantics as the rest of the public API.


## OpenAPI

````yaml PATCH /v1/scheduling/booking/resource-bookings/{id}
openapi: 3.0.0
info:
  title: Keebai Public API
  description: Superficie pública REST autenticada con Personal Access Tokens (PAT).
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.keebai.com
    description: Production
security: []
tags: []
paths:
  /v1/scheduling/booking/resource-bookings/{id}:
    patch:
      tags:
        - scheduling-resource-bookings
      summary: Change the dates of a resource booking
      description: >-
        New check-in/check-out of a stay, or new date/start time of a block. On
        a cancelled booking it books again as a new booking (another id); send
        an Idempotency-Key so a retry does not book twice.
      operationId: PublicResourceBookingsController_update
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: idempotency-key
          required: true
          in: header
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicResourceBookingUpdateDto'
      responses:
        '200':
          description: ''
      security:
        - PAT: []
components:
  schemas:
    PublicResourceBookingUpdateDto:
      type: object
      properties:
        check_in:
          type: string
          example: '2026-12-03'
        check_out:
          type: string
          example: '2026-12-06'
        check_in_time:
          type: string
          nullable: true
        check_out_time:
          type: string
          nullable: true
        date:
          type: string
          example: '2026-12-04'
        start_time:
          type: string
          example: '20:00'
  securitySchemes:
    PAT:
      scheme: bearer
      bearerFormat: kbai_pk_<hex>
      type: http
      description: >-
        Personal Access Token con prefijo `kbai_pk_`. Generar desde el portal
        con permiso `developer.manage_tokens`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.