Authentication
This endpoint requires authentication with a Bearer token.
Bearer token for authentication
Permissions
Only superuser administrators can create patient accounts. Regular users will receive a 403 Forbidden error.
Request Body
Patient’s full nameExample: João Silva
Patient’s password (will be hashed before storage)Example: senha_secreta
Patient’s phone numberExample: 11999999999
Patient’s CPF (Brazilian ID number, must be unique)Example: 12345678901
Patient’s date of birth in ISO format (YYYY-MM-DD)Example: 1990-01-01
Street addressExample: Rua das Flores
Street numberExample: 123
Address complement (optional)Example: Apto 101
NeighborhoodExample: Centro
State (2-letter code)Example: SP
Postal codeExample: 01001000
User type (should be “PACIENTE” for patients)Example: PACIENTE
Whether the patient account is activeDefault: true
Whether the patient has superuser privilegesDefault: false
Response
Unique identifier for the patient
curl -X POST https://api.vidaplus.com/pacientes/ \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"nome": "João Silva",
"email": "[email protected]",
"senha": "senha_secreta",
"telefone": "11999999999",
"cpf": "12345678901",
"data_nascimento": "1990-01-01",
"endereco": "Rua das Flores",
"complemento": "Apto 101",
"numero": 123,
"bairro": "Centro",
"cidade": "São Paulo",
"estado": "SP",
"cep": "01001000",
"tipo": "PACIENTE",
"is_active": true,
"is_superuser": false
}'
{
"id": 1,
"nome": "João Silva",
"email": "[email protected]",
"telefone": "11999999999",
"cpf": "12345678901",
"data_nascimento": "1990-01-01",
"endereco": "Rua das Flores",
"complemento": "Apto 101",
"numero": 123,
"bairro": "Centro",
"cidade": "São Paulo",
"estado": "SP",
"cep": "01001000",
"tipo": "PACIENTE",
"is_active": true,
"is_superuser": false
}
Error Codes
Patient successfully created
User does not have administrator permissions
Email or CPF already exists in the system