Authentication
This endpoint requires authentication and superuser permissions. Only administrators can update beds.
Path Parameters
The unique identifier of the bed to update
Request Body
The bed number identifier (e.g., “101-A”)
ID of the patient assigned to this bed. Must be null if status is “Livre” (Free)
Type of bed. Available options:
UTI - Intensive Care Unit
Enfermaria - Ward
Emergência - Emergency
Isolamento - Isolation
Semi-Intensivo - Semi-Intensive
Pediátrico - Pediatric
Neonatal - Neonatal
Psiquiátrico - Psychiatric
Current status of the bed. Available options:
Ocupado - Occupied
Livre - Free
Reservado - Reserved
Em Manutenção - Under Maintenance
Response
Unique identifier for the bed
The bed number identifier
ID of the patient assigned to this bed, or null if unassigned
Current status of the bed
curl -X PUT https://api.vidaplus.com/leitos/1 \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"numero_leito": "101-A",
"paciente_id": 5,
"tipo": "Enfermaria",
"status": "Ocupado"
}'
{
"id": 1,
"numero_leito": "101-A",
"paciente_id": 5,
"tipo": "Enfermaria",
"status": "Ocupado"
}
Business Rules
- If the status is
Livre (Free), the paciente_id must be null
- Only users with superuser permissions can update beds
- All fields in the request body are required, even if unchanged