# Actualizar cita

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

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

Actualiza solo los campos enviados. Para cancelar usa `POST /appointments/{id}/cancel`.

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)

12 · all optional

`title` string · optional

2–200 chars

`description` string · optional

≤ 2000 chars

`type` string · optional

SHOWING · MEETING · CALL · FOLLOW_UP · SIGNING · DEMO · OTHER

`color` string · optional

`startTime` string · optional

nullable

`endTime` string · optional

nullable

**See the other 6 parameters**

`location` string · optional

≤ 500 chars

`contactId` string · optional

`dealId` string · optional

nullable

`assigneeId` string · optional

`status` string · optional

SCHEDULED · CONFIRMED · COMPLETED · CANCELLED · NO_SHOW

`reminders` object[] · optional

## 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 PATCH "https://api.bydomu.com/v1/appointments/clx1apt001" \
  -H "X-API-Key: $BYDOMU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "startTime": "2026-10-02T16:00:00.000Z",
  "endTime": "2026-10-02T17:00:00.000Z",
  "status": "CONFIRMED"
}'
```

JavaScript:

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

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

const { data } = await bydomu.appointments.update("clx1apt001", {
  "startTime": "2026-10-02T16:00:00.000Z",
  "endTime": "2026-10-02T17:00:00.000Z",
  "status": "CONFIRMED"
});
```

Python:

```python
import os, requests

r = requests.patch(
    "https://api.bydomu.com/v1/appointments/clx1apt001",
    headers={"X-API-Key": os.environ["BYDOMU_API_KEY"]},
    json={
        "startTime": "2026-10-02T16:00:00.000Z",
        "endTime": "2026-10-02T17:00:00.000Z",
        "status": "CONFIRMED"
    }
)
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"
      }
    ]
  }
}
```
