# Cancelar cita

POST `https://api.bydomu.com/v1/appointments/{id}/cancel`

This reference is generated from the API’s code, so descriptions are in Spanish. Names, parameters and examples are the same in every language.

Marca la cita como cancelada y anula sus recordatorios pendientes.

Permission required

`appointments:write`

Required header

`X-API-Key` · secret key

Access level

Level 3 · with support review

## Path parameters

1 · required

`id` string · **required**

ID de la cita

## Headers

1 · all optional

`Idempotency-Key` string · optional

Clave única de la operación (8-128 caracteres de `[a-zA-Z0-9._:-]`). Un reintento con la misma clave y el mismo cuerpo devuelve la respuesta original sin repetir la operación. Vive 24 horas. 8–128 chars

## Body (JSON)

1 · all optional

`reason` string · optional

≤ 500 chars

## Response 200

`AppointmentRecord` · 22 fields

**`data` Cita tal como queda al crearla, actualizarla o cancelarla.**

`id` string

`title` string

`description` string

`type` string SHOWING, MEETING, CALL, FOLLOW_UP, SIGNING, DEMO

`status` string SCHEDULED, CONFIRMED, COMPLETED, CANCELLED, NO_SHOW

`startTime` string

`endTime` string

`color` string

`location` string

`createdAt` string

`cancelReason` string

`source` string `MANUAL`, `BOOKING` o `NOA`

`contactId` string

`dealId` string

`propertyId` string

`assigneeId` string

`createdById` string

`updatedAt` string

**`contact` id · firstName · lastName · phone**

`id` string

`firstName` string

`lastName` string

`phone` string No viene al cancelar; `null` si el contacto no tiene teléfono

**`deal` id · title**

`id` string

`title` string

**`assignee` id · firstName · lastName**

`id` string

`firstName` string

`lastName` string

**`reminders[]` Recordatorios programados. No vienen al cancelar**

`id` string

`channel` string

`minutesBefore` integer

`scheduledFor` string

`status` string

## Possible errors

shaped as `{ "error": { "code", "message" } }`

- **400** Datos inválidos: el cuerpo o la query no cumplen el esquema, o `Idempotency-Key` está mal formada.
- **401** UNAUTHORIZED
- **402** PAYMENT_REQUIRED
- **403** FORBIDDEN
- **404** NOT_FOUND
- **409** DUPLICATE
- **429** RATE_LIMITED
- **500** INTERNAL_ERROR

cURL:

```bash
curl -X POST "https://api.bydomu.com/v1/appointments/clx1apt001/cancel" \
  -H "X-API-Key: $BYDOMU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "reason": "El cliente reagendará la próxima semana"
}'
```

JavaScript:

```js
import { ByDomu } from "@bydomu/sdk";

const bydomu = new ByDomu({
  apiKey: process.env.BYDOMU_API_KEY,
});

const { data } = await bydomu.appointments.cancel("clx1apt001", {
  "reason": "El cliente reagendará la próxima semana"
});
```

Python:

```python
import os, requests

r = requests.post(
    "https://api.bydomu.com/v1/appointments/clx1apt001/cancel",
    headers={"X-API-Key": os.environ["BYDOMU_API_KEY"]},
    json={
        "reason": "El cliente reagendará la próxima semana"
    }
)
data = r.json()
```

**Response · 200 · example**

```json
{
  "data": {
    "id": "clx1apt001",
    "title": "Visita Apto Chapinero",
    "description": "Segunda visita; llevar el certificado de libertad.",
    "type": "SHOWING",
    "status": "SCHEDULED",
    "startTime": "2026-10-02T15:00:00.000Z",
    "endTime": "2026-10-02T16:00:00.000Z",
    "color": "#6366F1",
    "location": "Cra 7 #45-12, Bogotá",
    "createdAt": "2026-09-25T09:00:00.000Z",
    "cancelReason": "El cliente reagendará",
    "source": "MANUAL",
    "contactId": "clx1con001",
    "dealId": "clx1deal001",
    "propertyId": "clx1prop001",
    "assigneeId": "clx1usr001",
    "createdById": "clx1usr002",
    "updatedAt": "2026-09-25T09:00:00.000Z",
    "contact": {
      "id": "clx1con001",
      "firstName": "María",
      "lastName": "González",
      "phone": "+573001234567"
    },
    "deal": {
      "id": "clx1deal001",
      "title": "Venta Apto Chapinero"
    },
    "assignee": {
      "id": "clx1usr001",
      "firstName": "Carlos",
      "lastName": "Rodríguez"
    },
    "reminders": [
      {
        "id": "clx1rem001",
        "channel": "WHATSAPP",
        "minutesBefore": 60,
        "scheduledFor": "2026-10-02T14:00:00.000Z",
        "status": "PENDING"
      }
    ]
  }
}
```
