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

# Pacientes

> Lista los pacientes de la clínica con sus datos administrativos, ordenados por apellido.

**Cuándo usarla:** Para encontrar un paciente por nombre, email o teléfono y obtener su id antes de leer su ficha o darle cita.



## OpenAPI

````yaml /api-reference/openapi.es.json get /patients
openapi: 3.1.0
info:
  title: API de Brelio
  version: '1'
  description: >-
    Todo lo que una persona hace en Brelio lo puede hacer un programa, con los
    mismos permisos, auditoría y límites. Cada endpoint se deriva del catálogo
    de operaciones.
servers:
  - url: https://api.brelio.app/v1
security: []
paths:
  /patients:
    get:
      tags:
        - patients
      summary: Pacientes
      description: >-
        Lista los pacientes de la clínica con sus datos administrativos,
        ordenados por apellido.


        **Cuándo usarla:** Para encontrar un paciente por nombre, email o
        teléfono y obtener su id antes de leer su ficha o darle cita.
      operationId: patients.list
      parameters:
        - name: cursor
          in: query
          required: false
          schema:
            type: string
            maxLength: 200
          description: '`next_cursor` de la página anterior. Omítelo para la primera página.'
        - name: limit
          in: query
          required: false
          schema:
            default: 25
            type: integer
            minimum: 1
            maximum: 100
          description: Tamaño de página, de 1 a 100.
        - name: search
          in: query
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 100
          description: >-
            Busca en nombre, email, teléfono, código de paciente, código interno
            o número de identificación, igual que la búsqueda de la web.
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - active
              - inactive
              - discharged
          description: Solo los pacientes en este estado.
      responses:
        '200':
          description: Correcto
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          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)$
                        code:
                          anyOf:
                            - type: string
                            - type: 'null'
                          description: Código legible, como PAC-0042.
                        firstName:
                          type: string
                        lastName:
                          anyOf:
                            - type: string
                            - type: 'null'
                        birthDate:
                          anyOf:
                            - type: string
                              format: date
                              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])))$
                            - type: 'null'
                        sex:
                          anyOf:
                            - type: string
                              enum:
                                - male
                                - female
                                - other
                            - type: 'null'
                        email:
                          anyOf:
                            - type: string
                            - type: 'null'
                        phone:
                          anyOf:
                            - type: string
                            - type: 'null'
                        status:
                          type: string
                          enum:
                            - active
                            - inactive
                            - discharged
                        identificationNumber:
                          anyOf:
                            - type: string
                            - type: 'null'
                          description: >-
                            Número del documento de identidad (DNI, NIE,
                            pasaporte).
                        identificationType:
                          anyOf:
                            - type: string
                            - type: 'null'
                          description: Tipo de documento de identidad, como dni.
                        internalCode:
                          anyOf:
                            - type: string
                            - type: 'null'
                          description: >-
                            El código propio de la clínica para el paciente, si
                            lo tiene.
                        responsibleId:
                          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: El profesional responsable del paciente.
                        admittedAt:
                          anyOf:
                            - 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, en UTC.
                            - type: 'null'
                        lastSessionAt:
                          anyOf:
                            - 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, en UTC.
                            - type: 'null'
                        nextSessionAt:
                          anyOf:
                            - 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, en UTC.
                            - type: 'null'
                        archivedAt:
                          anyOf:
                            - 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, en UTC.
                            - type: 'null'
                          description: >-
                            Cuándo se archivó el paciente; null mientras está
                            activo.
                        version:
                          type: string
                          description: >-
                            Token de versión opaco. Devuélvelo como
                            expectedVersion para cambiar este paciente; no lo
                            interpretes.
                        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, en 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, en UTC.
                      required:
                        - id
                        - code
                        - firstName
                        - lastName
                        - birthDate
                        - sex
                        - email
                        - phone
                        - status
                        - identificationNumber
                        - identificationType
                        - internalCode
                        - responsibleId
                        - admittedAt
                        - lastSessionAt
                        - nextSessionAt
                        - archivedAt
                        - version
                        - createdAt
                        - updatedAt
                      additionalProperties: false
                  next_cursor:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: >-
                      Pásalo como `cursor` para leer la página siguiente; null
                      en la última página.
                  has_more:
                    type: boolean
                required:
                  - data
                  - next_cursor
                  - has_more
                additionalProperties: false
        '401':
          description: Problem Details (RFC 9457) con un `code` estable
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '402':
          description: Problem Details (RFC 9457) con un `code` estable
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '403':
          description: Problem Details (RFC 9457) con un `code` estable
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '422':
          description: Problem Details (RFC 9457) con un `code` estable
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '429':
          description: Problem Details (RFC 9457) con un `code` estable
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '503':
          description: Problem Details (RFC 9457) con un `code` estable
          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: >-
        Clave de API de Brelio (de organización o personal) o un token de acceso
        de WorkOS.

````

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