Skip to main content

Endpoint

GET /api/especialidades

Authentication

This endpoint is public and does not require authentication for basic listing. However, this documentation covers the admin context where you may want to manage specialties.

Description

Retrieves all medical specialties available in the system. The results are ordered alphabetically by name. This endpoint serves both public users (for selecting specialties when booking appointments) and administrators (for managing the specialty catalog).

Response

Returns an array of specialty objects.

Response Fields

id
integer
Unique identifier for the specialty
nombre
string
Name of the medical specialty
descripcion
string
Description of the specialty (can be null)

Example Request

curl -X GET "https://api.example.com/api/especialidades"

Example Response

[
  {
    "id": 1,
    "nombre": "Cardiology",
    "descripcion": "Medical specialty dealing with disorders of the heart"
  },
  {
    "id": 2,
    "nombre": "Dermatology",
    "descripcion": "Medical specialty dealing with skin disorders"
  },
  {
    "id": 3,
    "nombre": "Pediatrics",
    "descripcion": "Medical care of infants, children, and adolescents"
  }
]

Error Responses

500 Internal Server Error
Server error while retrieving specialties
{
  "message": "Error al listar especialidades"
}

Notes

  • Results are sorted alphabetically by specialty name
  • This endpoint returns all specialties without pagination
  • No authentication is required for viewing the list
  • For creating, updating, or deleting specialties, admin authentication is required

Build docs developers (and LLMs) love