Skip to content

Pacientes API

/api/pacientes

All Paciente routes require a Bearer token.

MethodPathAuthDescription
POST/api/pacientesYesCreate a patient.
GET/api/pacientesYesList patients for the authenticated veterinarian.
GET/api/pacientes/:idYesGet a patient by ID.
PUT/api/pacientes/:idYesUpdate a patient.
DELETE/api/pacientes/:idYesDelete a patient.

POST /api/pacientes

Request body:

{
"nombre": "string",
"propietario": "string",
"email": "string",
"fecha": "date string",
"sintomas": "string"
}

Success response: saved Paciente document with veterinario set to the auth user.

GET /api/pacientes

Success response: array of Paciente documents owned by the authenticated veterinarian.

GET /api/pacientes/:id

Success response: Paciente document.

Errors:

  • 200 { "error": "accion no valida." } when the patient is not owned by the auth user.
  • 404 { "error": "Paciente no encontrado." }

PUT /api/pacientes/:id

Request body (all optional, partial updates):

{
"nombre": "string",
"propietario": "string",
"email": "string",
"fecha": "date string",
"sintomas": "string"
}

Success response: updated Paciente document.

Errors:

  • 200 { "error": "accion no valida." } when the patient is not owned by the auth user.
  • 404 { "error": "Paciente no encontrado." }

DELETE /api/pacientes/:id

Success response:

{ "msg": "Paciente eliminado correctamente." }

Errors:

  • 200 { "error": "accion no valida." } when the patient is not owned by the auth user.
  • 404 { "error": "Paciente no encontrado." }