> ## 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.

# POST /v1/scheduling/booking/resource-bookings/:id/cancel

> Cancel a customer's resource booking and free its nights or block.

Cancels a resource booking of the customer, or an older resource appointment. Its nights or its block are free again right away, and the customer is notified.

A payment already made is **not** refunded automatically. The business handles it from its sales.

## Endpoint

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

## Required scope

`scheduling:appointments:cancel`

## 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`.

## Body

```json theme={"system"}
{
  "reason": "Cambio de planes"
}
```

* `reason`: optional, at most 500 characters. Stored as the cancellation reason.

## Example request

```bash curl theme={"system"}
curl -X POST "https://api.keebai.com/v1/scheduling/booking/resource-bookings/665f00000000000000000c01/cancel?customer_phone=%2B56987654321" \
  -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "reason": "Cambio de planes" }'
```

## Response

### 200 OK

The booking with `status: "cancelled"`, 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 sáb 5 dic · 2 noches",
  "start_time": "2026-12-03T11:00:00-03:00",
  "end_time": "2026-12-05T14:30:00-03:00",
  "time_zone": "America/Santiago",
  "check_in": "2026-12-03",
  "check_out": "2026-12-05",
  "nights": 2,
  "party_size": 1,
  "price": 40000,
  "currency": "CLP",
  "status": "cancelled",
  "payment_status": "cancelled",
  "payment_link": null,
  "payment_hold_expires_at": null,
  "customer_phone": "56987654321"
}
```

To book the same resource again, send new dates to [PATCH](https://docs.keebai.com/dev/endpoints/scheduling-resource-booking-update.md) on the cancelled id: it creates a new booking.

### 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_ALREADY_CANCELLED",
    "message": "La reserva ya está cancelada"
  }
}
```

### 401 Unauthorized · 403 Forbidden

Same semantics as the rest of the public API.


## OpenAPI

````yaml POST /v1/scheduling/booking/resource-bookings/{id}/cancel
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}/cancel:
    post:
      tags:
        - scheduling-resource-bookings
      summary: Cancel a resource booking of the customer
      operationId: PublicResourceBookingsController_cancel
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicResourceBookingCancelDto'
      responses:
        '200':
          description: ''
      security:
        - PAT: []
components:
  schemas:
    PublicResourceBookingCancelDto:
      type: object
      properties:
        reason:
          type: string
          maxLength: 500
  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.