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

# Crear un paciente

> Crea un paciente a partir de los mismos campos de identidad que usa set-consultation-context. Devuelve el paciente con su id público estable.



## OpenAPI

````yaml /es/scribe-api/openapi-institutional.json post /v1/patients
openapi: 3.1.0
info:
  title: Scribe Public API
  description: >-
    API REST externa para integrarte con la plataforma Telepatia. Autentícate
    con API keys, establece el contexto de consulta y obtén las sesiones de
    scribe.
  version: 0.1.0
servers:
  - url: https://scribe-api.telepatia.ai
    description: Production
security:
  - BearerAuth: []
paths:
  /v1/patients:
    post:
      tags:
        - Patients
      summary: Crear un paciente
      description: >-
        Crea un paciente a partir de los mismos campos de identidad que usa
        set-consultation-context. Devuelve el paciente con su id público
        estable.
      operationId: api_patient_create_v1_patients_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatientCreateRequest'
            example:
              idCountry: COLOMBIA
              idType: CC
              idValue: '1024567890'
              internalCode: EMR-12345
              name: John Doe
      responses:
        '200':
          description: Respuesta exitosa
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatientResponse'
              example:
                createdAt: '2026-07-01T12:00:00.000Z'
                id: sp_a1b2c3d4e5f6g7h8
                idCountry: COLOMBIA
                idType: CC
                idValue: '1024567890'
                internalCode: EMR-12345
                name: John Doe
        '400':
          description: >-
            Solicitud incorrecta — parámetros inválidos, fallos de validación o
            campos faltantes.
          content:
            application/json:
              examples:
                parameter_missing:
                  summary: Falta un campo obligatorio
                  value:
                    error:
                      type: invalid_request_error
                      code: parameter_missing
                      message: name is required.
                      param: name
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
                parameter_invalid:
                  summary: Valor de campo inválido
                  value:
                    error:
                      type: invalid_request_error
                      code: parameter_invalid
                      message: >-
                        idCountry must be a valid country name, ISO alpha-2, or
                        ISO alpha-3 code.
                      param: idCountry
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
                account_invalid:
                  summary: Cuenta inválida
                  value:
                    error:
                      type: invalid_request_error
                      code: account_invalid
                      message: Account has no valid authId.
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: No autorizado — falta la API key o no es válida.
          content:
            application/json:
              examples:
                authentication_required:
                  summary: API key inválida o faltante
                  value:
                    error:
                      type: authentication_error
                      code: authentication_required
                      message: Invalid API key.
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflicto — el recurso ya existe o está en un estado en conflicto.
          content:
            application/json:
              examples:
                resource_conflict:
                  summary: Conflicto con el recurso
                  value:
                    error:
                      type: invalid_request_error
                      code: resource_conflict
                      message: >-
                        consultationInternalId is already in use by a different
                        consultation.
                      param: consultationInternalId
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Servicio no disponible — una dependencia externa no está disponible.
          content:
            application/json:
              examples:
                service_unavailable:
                  summary: Servicio externo no disponible
                  value:
                    error:
                      type: api_error
                      code: service_unavailable
                      message: >-
                        The service is temporarily unavailable. Please try again
                        later.
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    PatientCreateRequest:
      properties:
        name:
          type: string
          maxLength: 500
          minLength: 1
          title: Name
          examples:
            - John Doe
        idCountry:
          $ref: '#/components/schemas/IdCountry'
          examples:
            - CO
        idType:
          $ref: '#/components/schemas/IdType'
          examples:
            - CC
        idValue:
          type: string
          maxLength: 50
          minLength: 1
          title: Idvalue
          examples:
            - '1024567890'
        internalCode:
          anyOf:
            - type: string
              maxLength: 128
              minLength: 1
            - type: 'null'
          title: Internalcode
          description: Código interno que defines tú, único dentro de tu institución.
          examples:
            - EMR-12345
      type: object
      required:
        - name
        - idCountry
        - idType
        - idValue
      title: PatientCreateRequest
      description: |-
        Cuerpo de solicitud para crear un paciente.

        Usa los mismos campos de identidad que set-consultation-context.
      examples:
        - idCountry: COLOMBIA
          idType: CC
          idValue: '1024567890'
          internalCode: EMR-12345
          name: John Doe
    PatientResponse:
      properties:
        id:
          type: string
          title: Id
          description: Identificador público estable.
          examples:
            - sp_a1b2c3d4e5f6g7h8
        name:
          type: string
          title: Name
          examples:
            - John Doe
        idCountry:
          anyOf:
            - type: string
            - type: 'null'
          title: Idcountry
          examples:
            - COLOMBIA
        idType:
          anyOf:
            - type: string
            - type: 'null'
          title: Idtype
          examples:
            - CC
        idValue:
          anyOf:
            - type: string
            - type: 'null'
          title: Idvalue
          examples:
            - '1024567890'
        internalCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Internalcode
          description: Código interno que definiste para tu institución (null si no hay).
          examples:
            - EMR-12345
        createdAt:
          type: string
          title: Createdat
          description: Fecha y hora ISO-8601 en que se creó el paciente.
      type: object
      required:
        - id
        - name
        - createdAt
      title: PatientResponse
      description: Un paciente. `id` es el id público estable (sp_...).
      examples:
        - createdAt: '2026-07-01T12:00:00.000Z'
          id: sp_a1b2c3d4e5f6g7h8
          idCountry: COLOMBIA
          idType: CC
          idValue: '1024567890'
          internalCode: EMR-12345
          name: John Doe
    ErrorResponse:
      description: Sobre estandarizado de respuesta de error.
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetailWithRequestId'
      required:
        - error
      title: ErrorResponse
      type: object
    IdCountry:
      type: string
      enum:
        - AF
        - AX
        - AL
        - DZ
        - AS
        - AD
        - AO
        - AI
        - AQ
        - AG
        - AR
        - AM
        - AW
        - AU
        - AT
        - AZ
        - BS
        - BH
        - BD
        - BB
        - BY
        - BE
        - BZ
        - BJ
        - BM
        - BT
        - BO
        - BQ
        - BA
        - BW
        - BV
        - BR
        - IO
        - BN
        - BG
        - BF
        - BI
        - KH
        - CM
        - CA
        - CV
        - KY
        - CF
        - TD
        - CL
        - CX
        - CC
        - CO
        - KM
        - CK
        - CR
        - CI
        - HR
        - CU
        - CW
        - CY
        - CZ
        - CD
        - DK
        - DJ
        - DM
        - DO
        - EC
        - EG
        - SV
        - GQ
        - ER
        - EE
        - SZ
        - ET
        - FK
        - FO
        - FJ
        - FI
        - FR
        - GF
        - PF
        - TF
        - GA
        - GE
        - DE
        - GH
        - GI
        - GR
        - GL
        - GD
        - GP
        - GU
        - GT
        - GG
        - GN
        - GW
        - GY
        - HT
        - HM
        - VA
        - HN
        - HK
        - HU
        - IS
        - IN
        - ID
        - IQ
        - IE
        - IR
        - IM
        - IL
        - IT
        - JM
        - JP
        - JE
        - JO
        - KZ
        - KE
        - KI
        - XK
        - KW
        - KG
        - LA
        - LV
        - LB
        - LS
        - LR
        - LY
        - LI
        - LT
        - LU
        - MO
        - MG
        - MW
        - MY
        - MV
        - ML
        - MT
        - MH
        - MQ
        - MR
        - MU
        - YT
        - MX
        - FM
        - MD
        - MC
        - MN
        - ME
        - MS
        - MA
        - MZ
        - MM
        - NA
        - NR
        - NP
        - NL
        - NC
        - NZ
        - NI
        - NE
        - NG
        - NU
        - NF
        - KP
        - MP
        - 'NO'
        - OM
        - PK
        - PW
        - PA
        - PG
        - PY
        - CN
        - PE
        - PH
        - PN
        - PL
        - PT
        - PR
        - QA
        - CG
        - GM
        - RE
        - RO
        - RU
        - RW
        - BL
        - SH
        - KN
        - LC
        - MF
        - PM
        - VC
        - WS
        - SM
        - ST
        - SA
        - SN
        - RS
        - SC
        - SL
        - SG
        - SX
        - SK
        - SI
        - SB
        - SO
        - ZA
        - GS
        - KR
        - SS
        - ES
        - LK
        - PS
        - SD
        - SR
        - SJ
        - SE
        - CH
        - SY
        - TW
        - TJ
        - TH
        - MK
        - TL
        - TG
        - TK
        - TO
        - TT
        - TN
        - TR
        - TM
        - TC
        - TV
        - UG
        - UA
        - AE
        - GB
        - TZ
        - UM
        - US
        - UY
        - UZ
        - VU
        - VE
        - VN
        - VG
        - VI
        - WF
        - EH
        - YE
        - ZM
        - ZW
      title: IdCountry
      description: >-
        Códigos de país ISO 3166-1 alfa-2. Refleja el enum CountryCodes de
        tanjiro.
    IdType:
      type: string
      enum:
        - CC
        - TI
        - CE
        - RC
        - PASSPORT
        - RG
        - CPF
        - OTHER_DOC
      title: IdType
      description: Tipos de documento de identificación del paciente admitidos.
    ErrorDetailWithRequestId:
      description: >-
        Objeto de error de nivel superior: `ErrorDetail` más el id de
        correlación de la solicitud.


        Se mantiene como subclase y no como campo de `ErrorDetail` porque
        `ErrorDetail` también es la forma del error por elemento dentro de la
        respuesta de creación de cuentas en lote (`BatchAccountResult.error`),
        que se serializa incluyendo los nulls. Agregar el campo allí publicaría
        `"requestId": null` en un HTTP 200, y de todos modos solo hay un id de
        solicitud por lote: quien llama en lote lee el encabezado de respuesta
        `X-Request-ID`.
      properties:
        type:
          description: Categoría general del error, para un manejo de alto nivel.
          examples:
            - invalid_request_error
          title: Type
          type: string
        code:
          description: >-
            Código de error legible por máquina. Tu código debe decidir según
            este valor.
          examples:
            - parameter_invalid
          title: Code
          type: string
        message:
          description: Mensaje de error legible por humanos que termina en punto.
          examples:
            - >-
              idCountry must be a valid country name, ISO alpha-2, or ISO
              alpha-3 code.
          title: Message
          type: string
        param:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: El campo de la solicitud que causó el error, si aplica.
          examples:
            - idCountry
          title: Param
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          description: Contexto opcional, estructurado y legible por máquina, del error.
          examples:
            - pendingConsultations:
                - sessionId: abc123
                  url: https://...
          title: Details
        requestId:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Id único de esta solicitud, idéntico al encabezado de respuesta
            X-Request-ID. Inclúyelo cuando contactes a soporte.
          examples:
            - 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
          title: Requestid
      required:
        - type
        - code
        - message
      title: ErrorDetailWithRequestId
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key enviada como token Bearer

````

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