Authentication
This endpoint requires authentication and superuser permissions. Only administrators can create beds.
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 POST https://api.vidaplus.com/leitos/ \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"numero_leito": "101-A",
"paciente_id": null,
"tipo": "Enfermaria",
"status": "Livre"
}'
{
"id": 1,
"numero_leito": "101-A",
"paciente_id": null,
"tipo": "Enfermaria",
"status": "Livre"
}
Business Rules
- The
numero_leito must be unique across all beds
- If the status is
Livre (Free), the paciente_id must be null
- Only users with superuser permissions can create beds