Skip to main content
GET
/
patients
Get all patients
curl --request GET \
  --url https://api.example.com/patients \
  --header 'Authorization: <authorization>'
{
  "patients": [
    {
      "id": 123,
      "name": "<string>",
      "surname": "<string>",
      "dni": 123,
      "birthdate": "<string>",
      "gender": "<string>",
      "address": "<string>",
      "phone": "<string>",
      "email": "<string>",
      "socialWorkId": 123,
      "state": "<string>",
      "Obras_Sociale": {
        "name": "<string>"
      }
    }
  ]
}

Authentication

This endpoint requires a valid JWT token.
Authorization
string
required
Bearer token for authentication. Include as Bearer <token>.

Query Parameters

Search patients by name, surname, or DNI. Performs a partial match search across these fields.
gender
string
Filter patients by gender.
state
string
Filter patients by state. Possible values:
  • Activo/a - Active patient
  • Inactivo/a - Inactive patient
socialWorkId
number
Filter patients by social work ID. Must be a valid social work ID that exists in the system.

Response

patients
object[]
Array of patient objects.

Example Request

curl -X GET https://api.clinica-vitalis.com/patients?state=Activo/a \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Example Response

{
  "patients": [
    {
      "id": 1,
      "name": "María",
      "surname": "González",
      "dni": 12345678,
      "birthdate": "1985-03-15T00:00:00.000Z",
      "gender": "Femenino",
      "address": "Av. Corrientes 1234, CABA",
      "phone": "11-4567-8901",
      "email": "maria.gonzalez@email.com",
      "socialWorkId": 1,
      "state": "Activo/a",
      "Obras_Sociale": {
        "name": "OSDE"
      }
    },
    {
      "id": 2,
      "name": "Juan",
      "surname": "Pérez",
      "dni": 23456789,
      "birthdate": "1990-07-22T00:00:00.000Z",
      "gender": "Masculino",
      "address": "San Martín 567, CABA",
      "phone": "11-2345-6789",
      "email": "juan.perez@email.com",
      "socialWorkId": 2,
      "state": "Activo/a",
      "Obras_Sociale": {
        "name": "Swiss Medical"
      }
    }
  ]
}

Error Responses

401 Unauthorized

Returned when the JWT token is missing or invalid.
{
  "msg": "Token inválido"
}

404 Not Found

Returned when no patients are found in the system.
{
  "msg": "No hay pacientes cargados en el sistema"
}

500 Internal Server Error

Returned when a server error occurs.
{
  "msg": "Error del servidor"
}

Build docs developers (and LLMs) love