Skip to main content
This guide books a patient with a professional for a service, moves the appointment, and cancels it. It uses curl and jq; every step is the same over any HTTP client.

Before you start

  • An organization API key with services.read, professionals.read, calendar.read, appointments.read, appointments.create, appointments.reschedule and appointments.cancel, plus patients.administrative.read to find the patient.
  • The agenda and team data areas on (the default). Finding the patient by name needs the patients area too; if it is off, use a patient id you already have.

1. Get the ids

If the clinic has more than one center, also take a centerId from GET /v1/centers and send it in the next steps.

2. Find free slots

Response
  • Slots follow the clinic’s opening hours and agenda step, and leave out what the professional already has booked or blocked: exactly what Brelio’s agenda would accept.
  • Times are UTC. The clinic in this example is in Madrid (UTC+1), so 08:00Z is 09:00 local time.
  • The window is at most 31 days, and at most 50 slots come back. The length is the service’s duration unless you send durationMinutes.

3. Book it

Send one of the startAt values as start, with a new Idempotency-Key:
201 Created
Keep the id. It is opaque: it can contain : and a date, and the date in it does not change when the appointment moves. Use it as is. If someone took the slot since you searched, the answer is 409 APPOINTMENT_OVERLAP_DETECTED: search again and offer another time.

4. Read it

Response
GET /v1/agenda?from=…&to=… lists the same appointments for a window, with the same ids.

5. Reschedule it

Send the version you just read as expectedVersion, and a new start from a new availability search:
Response
If the appointment changed in Brelio since you read it, you get 409 VERSION_CONFLICT: read it again and decide again. See concurrency.

6. Cancel it

Response
  • reason is administrative only. Never put clinical information in it.
  • Cancelling cannot be undone through the API.
  • An appointment that already has a session (checked in or later) is cancelled in Brelio: 409 APPOINTMENT_CANCEL_IN_BRELIO.

Limits of this version

  • Only one-off appointments. Recurring series answer 422 APPOINTMENT_RECURRING_UNSUPPORTED on reschedule and cancel.
  • Booking, rescheduling and cancelling are REST only; MCP assistants can read the agenda and free slots but not write yet.
  • patientId in the agenda is null unless the clinic’s patients area is on and your key was accepted for patient data.

The whole flow in Node.js

book.mjs