Skip to main content
PUT
/
pacientes
/
{user_id}
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
}

Authentication

This endpoint requires authentication with a Bearer token.
Authorization
string
required
Bearer token for authentication

Permissions

  • Superusers: Can update any patient record
  • Regular users: Can only update their own patient record

Path Parameters

user_id
integer
required
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.
nome
string
required
Patient’s full nameExample: João Silva
email
string
required
Patient’s email addressExample: [email protected]
senha
string
required
Patient’s password (will be hashed before storage)Example: nova_senha
telefone
string
required
Patient’s phone numberExample: 11999999999
cpf
string
required
Patient’s CPFExample: 12345678901
data_nascimento
string
required
Patient’s date of birth in ISO format (YYYY-MM-DD)Example: 1990-01-01
endereco
string
required
Street addressExample: Rua das Flores
numero
integer
required
Street numberExample: 123
complemento
string
Address complement (optional)Example: Apto 101
bairro
string
required
NeighborhoodExample: Centro
cidade
string
required
CityExample: São Paulo
estado
string
required
State (2-letter code)Example: SP
cep
string
required
Postal codeExample: 01001000
tipo
string
required
User typeExample: PACIENTE
is_active
boolean
required
Whether the patient account is activeExample: true
is_superuser
boolean
required
Whether the patient has superuser privilegesExample: false

Response

id
integer
Unique identifier for the patient
nome
string
Patient’s full name
email
string
Patient’s email address
telefone
string
Patient’s phone number
cpf
string
Patient’s CPF
data_nascimento
string
Patient’s date of birth
endereco
string
Street address
numero
integer
Street number
complemento
string
Address complement
bairro
string
Neighborhood
cidade
string
City
estado
string
State
cep
string
Postal code
tipo
string
User type
is_active
boolean
Account active status
is_superuser
boolean
Superuser status
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

200
OK
Patient successfully updated
403
Forbidden
User does not have permission to update this patient record
404
Not Found
Patient with the specified ID does not exist
409
Conflict
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

Build docs developers (and LLMs) love