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

# Create appointment

> Books a patient with a professional for a service, with the same rules as Brelio's agenda.

**When to use it:** After choosing a time with availability.search. If the time is no longer free the answer is 409: search again.



## OpenAPI

````yaml /api-reference/openapi.en.json post /appointments
openapi: 3.1.0
info:
  title: Brelio API
  version: '1'
  description: >-
    Everything a person can do in Brelio, a program can do, with the same
    permissions, audit and limits. Every endpoint is derived from the operation
    catalogue.
servers:
  - url: https://api.brelio.app/v1
security: []
paths:
  /appointments:
    post:
      tags:
        - appointments
      summary: Create appointment
      description: >-
        Books a patient with a professional for a service, with the same rules
        as Brelio's agenda.


        **When to use it:** After choosing a time with availability.search. If
        the time is no longer free the answer is 409: search again.
      operationId: appointments.create
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 8
            maxLength: 255
          description: Unique per command; reuse it only to retry the same call.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                patientId:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                professionalId:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                serviceId:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                start:
                  type: string
                  format: date-time
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                  description: When it starts, ISO 8601. Take it from availability.search.
                durationMinutes:
                  description: Defaults to the service’s duration.
                  type: integer
                  minimum: 5
                  maximum: 480
                centerId:
                  description: Required when the organization has more than one center.
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
              required:
                - patientId
                - professionalId
                - serviceId
                - start
            examples:
              example1:
                summary: One appointment
                value:
                  patientId: 9e2d4c6b-1a3f-4b5d-8c7e-6f5a4b3c2d1e
                  professionalId: 2c4e6a8b-0d1f-4a3c-9e5b-7d9f1b3d5f7a
                  serviceId: 4d6f8b0c-2e4a-4c6e-8a0c-2e4a6c8e0a2c
                  start: '2026-11-11T09:00:00Z'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: The occurrence id, as agenda.list returns it.
                  seriesId:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  start:
                    type: string
                    format: date-time
                    pattern: >-
                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                    description: ISO 8601, UTC.
                  end:
                    type: string
                    format: date-time
                    pattern: >-
                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                    description: ISO 8601, UTC.
                  durationMinutes:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  status:
                    type: string
                    enum:
                      - scheduled
                      - checked_in
                      - in_progress
                      - needs_review
                      - completed
                      - cancelled
                      - no_show
                      - voided
                  professionalId:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  serviceId:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  patientId:
                    anyOf:
                      - type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      - type: 'null'
                    description: >-
                      The patient; null when the caller may not see patient
                      data.
                  centerId:
                    anyOf:
                      - type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      - type: 'null'
                  recurring:
                    type: boolean
                    description: >-
                      Part of a recurring series; such appointments cannot be
                      changed through the API yet.
                  version:
                    type: string
                    description: >-
                      Opaque version token. Send it back as expectedVersion to
                      change this appointment; do not parse it.
                  createdAt:
                    type: string
                    format: date-time
                    pattern: >-
                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                    description: ISO 8601, UTC.
                  updatedAt:
                    type: string
                    format: date-time
                    pattern: >-
                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                    description: ISO 8601, UTC.
                required:
                  - id
                  - seriesId
                  - start
                  - end
                  - durationMinutes
                  - status
                  - professionalId
                  - serviceId
                  - patientId
                  - centerId
                  - recurring
                  - version
                  - createdAt
                  - updatedAt
                additionalProperties: false
        '401':
          description: Problem Details (RFC 9457) with a stable `code`
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '402':
          description: Problem Details (RFC 9457) with a stable `code`
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '403':
          description: Problem Details (RFC 9457) with a stable `code`
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '422':
          description: Problem Details (RFC 9457) with a stable `code`
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '429':
          description: Problem Details (RFC 9457) with a stable `code`
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '503':
          description: Problem Details (RFC 9457) with a stable `code`
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      security:
        - bearer: []
components:
  schemas:
    Problem:
      type: object
      required:
        - type
        - title
        - status
        - code
        - detail
        - request_id
        - params
      properties:
        type:
          type: string
        title:
          type: string
        status:
          type: integer
        code:
          type: string
        detail:
          type: string
        request_id:
          type: string
        hint:
          type: string
        retryAfterSeconds:
          type: integer
        params:
          type: object
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: Brelio API key (organization or user) or a WorkOS access token.

````

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