Authentication
This endpoint requires authentication with a Bearer token.
Bearer token for authentication
Permissions
- Superusers: Can update any patient record
- Regular users: Can only update their own patient record
Path Parameters
The unique identifier of the patient to updateExample: 1
Request Body
All fields from the patient schema must be provided. The request replaces the entire patient record.
Patient’s full nameExample: João Silva
Patient’s password (will be hashed before storage)Example: nova_senha
Patient’s phone numberExample: 11999999999
Patient’s CPFExample: 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 typeExample: PACIENTE
Whether the patient account is activeExample: true
Whether the patient has superuser privilegesExample: false
Response
Unique identifier for the patient
curl -X PUT https://api.vidaplus.com/pacientes/1 \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"nome": "João Silva",
"email": "[email protected]",
"senha": "nova_senha",
"telefone": "11999999999",
"cpf": "12345678901",
"data_nascimento": "1990-01-01",
"endereco": "Rua das Flores",
"complemento": "Apto 102",
"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 102",
"numero": 123,
"bairro": "Centro",
"cidade": "São Paulo",
"estado": "SP",
"cep": "01001000",
"tipo": "PACIENTE",
"is_active": true,
"is_superuser": false
}
Error Codes
Patient successfully updated
User does not have permission to update this patient record
Patient with the specified ID does not exist
CPF or email conflicts with another existing user
Notes
- The password field will be automatically hashed before storage
- All fields must be provided even if only updating specific fields
- Email and CPF must remain unique across all users