Skip to main content
PUT
/
leitos
/
{leito_id}
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"
}

Authentication

This endpoint requires authentication and superuser permissions. Only administrators can update beds.

Path Parameters

leito_id
integer
required
The unique identifier of the bed to update

Request Body

numero_leito
string
required
The bed number identifier (e.g., “101-A”)
paciente_id
integer
default:"null"
ID of the patient assigned to this bed. Must be null if status is “Livre” (Free)
tipo
string
required
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
status
string
required
Current status of the bed. Available options:
  • Ocupado - Occupied
  • Livre - Free
  • Reservado - Reserved
  • Em Manutenção - Under Maintenance

Response

id
integer
Unique identifier for the bed
numero_leito
string
The bed number identifier
paciente_id
integer | null
ID of the patient assigned to this bed, or null if unassigned
tipo
string
Type of bed
status
string
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

Build docs developers (and LLMs) love