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

# Crear paciente

> Registra un nuevo paciente en la plataforma.

## Body

<ParamField body="firstName" type="string" required>
  Nombre del paciente.
</ParamField>

<ParamField body="lastName" type="string" required>
  Apellido(s) del paciente.
</ParamField>

<ParamField body="email" type="string" required>
  Dirección de correo electrónico. Debe ser única.
</ParamField>

<ParamField body="phone" type="string" required>
  Número de teléfono en formato internacional (ej. `+34612345678`).
</ParamField>

<ParamField body="dateOfBirth" type="string">
  Fecha de nacimiento en formato `YYYY-MM-DD`.
</ParamField>

<ParamField body="tags" type="string[]">
  Etiquetas para categorizar al paciente (ej. `["traumatología", "post-operatorio"]`).
</ParamField>

<ParamField body="metadata" type="object">
  Objeto de clave-valor para almacenar datos personalizados (ej. ID de seguro, número de historia clínica).
</ParamField>

<ResponseExample>
  ```json 201 theme={null}
  {
    "id": "pat_xyz789",
    "firstName": "María",
    "lastName": "García",
    "email": "maria.garcia@email.com",
    "phone": "+34612345678",
    "dateOfBirth": "1985-03-15",
    "status": "active",
    "tags": ["traumatología", "post-operatorio"],
    "metadata": { "insuranceId": "INS-12345" },
    "createdAt": "2026-05-14T10:00:00Z",
    "updatedAt": "2026-05-14T10:00:00Z"
  }
  ```
</ResponseExample>

<ResponseField name="id" type="string">
  Identificador único del paciente con prefijo `pat_`.
</ResponseField>

<ResponseField name="status" type="string">
  Estado del paciente. Los nuevos pacientes se crean como `active`.
</ResponseField>

<ResponseField name="createdAt" type="string">
  Fecha de creación en formato ISO 8601.
</ResponseField>


## OpenAPI

````yaml openapi.yml POST /patients
openapi: 3.1.0
info:
  title: LINA Healthcare Platform API
  version: 1.0.0
  description: |
    API de integración para la plataforma LINA Healthcare.
    Todas las rutas requieren un token JWT obtenido intercambiando una API Key.
servers:
  - url: https://api.linahealthcareplatform.com/api/v1
    description: Production
security:
  - bearerAuth: []
paths:
  /patients:
    post:
      tags:
        - Pacientes
      summary: Crear paciente
      operationId: createPatient
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - firstName
                - lastName
              properties:
                firstName:
                  type: string
                lastName:
                  type: string
                email:
                  type: string
                  format: email
                phone:
                  type: string
                dateOfBirth:
                  type: string
                  format: date
                tags:
                  type: array
                  items:
                    type: string
                metadata:
                  type: object
      responses:
        '201':
          description: Paciente creado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Patient'
components:
  schemas:
    Patient:
      type: object
      properties:
        id:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        email:
          type: string
        phone:
          type: string
        dateOfBirth:
          type: string
          format: date
        status:
          type: string
          enum:
            - active
            - inactive
        tags:
          type: array
          items:
            type: string
        metadata:
          type: object
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Token JWT obtenido via POST /auth/token

````