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

# Actualizar paciente

> Requiere permiso write. Actualización parcial: mandá solo los campos que querés cambiar. Se usa el id de OCLÜ (el que devuelve el POST). Solo datos de contacto/identificación (nunca clínicos). El documento sigue siendo único. El cambio queda en el historial del paciente.



## OpenAPI

````yaml /api-reference/openapi.json put /patients/{id}
openapi: 3.1.0
info:
  title: OCLÜ API Pública
  description: >-
    API para integrar OCLÜ con sistemas externos (n8n, Make, Zapier, CRMs).
    Autenticación por API key. Las fechas y horas son hora local de la clínica.
    La API nunca expone datos clínicos.
  version: 1.0.0
servers:
  - url: https://{tenant}.oclucrm.com/api/v1
    description: Reemplazá {tenant} por el subdominio de tu clínica
    variables:
      tenant:
        default: tu-clinica
security:
  - apiKey: []
paths:
  /patients/{id}:
    put:
      tags:
        - Pacientes
      summary: Actualizar paciente
      description: >-
        Requiere permiso write. Actualización parcial: mandá solo los campos que
        querés cambiar. Se usa el id de OCLÜ (el que devuelve el POST). Solo
        datos de contacto/identificación (nunca clínicos). El documento sigue
        siendo único. El cambio queda en el historial del paciente.
      parameters:
        - $ref: '#/components/parameters/CurrentOrgId'
        - name: id
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatientUpdate'
      responses:
        '200':
          description: Actualizado
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Patient'
        '400':
          $ref: '#/components/responses/ValidationError'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    CurrentOrgId:
      name: Current-Org-Id
      in: header
      required: true
      description: ID de la sede (ver GET /me)
      schema:
        type: integer
        example: 1
  schemas:
    PatientUpdate:
      type: object
      description: >-
        Todos los campos son opcionales; se actualizan solo los enviados. name,
        lastname, country_id y gender_id no se pueden vaciar.
      properties:
        name:
          type: string
        lastname:
          type: string
        document:
          type: string
        document_type:
          type: string
          enum:
            - DNI
            - NIE
            - PASSPORT
            - CIF
            - CUIT
            - OTHER
        email:
          type: string
        phone:
          type: string
          example: '1144556677'
        phone_prefix_id:
          type: integer
        birth_date:
          type: string
          example: '1990-05-20'
        country_id:
          type: integer
        gender_id:
          type: integer
        external_id:
          type: string
          maxLength: 100
          example: CRM-12345
    Patient:
      type: object
      properties:
        id:
          type: integer
        external_id:
          type: string
          nullable: true
        name:
          type: string
        lastname:
          type: string
        full_name:
          type: string
        document:
          type: string
        document_type:
          type: string
        email:
          type: string
        phone:
          type: string
        birth_date:
          type: string
        gender_id:
          type: integer
        country_id:
          type: integer
    Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
  responses:
    ValidationError:
      description: Datos inválidos
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
    Forbidden:
      description: Sin permiso (scope), sin acceso a la sede, o add-on no habilitado
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: No encontrado
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: 'API key de la clínica. Header: Authorization: Bearer oclu_live_...'

````