Skip to main content
GET
/
municipios
/
:id
Get Municipality
curl --request GET \
  --url https://api.example.com/municipios/:id
{
  "id": 123,
  "nombre": "<string>",
  "ubicacion": {
    "type": "<string>",
    "coordinates": [
      {}
    ]
  },
  "activo": true
}

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/LizandroCanul/back_sdo/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Retrieves detailed information for a specific municipality in Yucatan state using its unique identifier.

Authentication

This endpoint requires authentication using a Bearer token.
Authorization: Bearer YOUR_API_TOKEN

Request

Path Parameters

id
number
required
Unique identifier of the municipalityMust be a valid integer between 1 and 106Example: 51 for Mérida

Base URL

https://api.example.com/municipios/:id

Response

Returns a single municipality object with geographic coordinates.
id
number
Unique identifier for the municipality
nombre
string
Official name of the municipalityExample: Mérida, Valladolid, Tizimín
ubicacion
Point
Geographic coordinates in GeoJSON Point format (SRID 4326 / WGS 84)
activo
boolean
Indicates if the municipality is active in the systemDefault: true

Success Response

{
  "id": 51,
  "nombre": "Mérida",
  "ubicacion": {
    "type": "Point",
    "coordinates": [-89.5926, 20.9674]
  },
  "activo": true
}

Example Requests

curl -X GET https://api.example.com/municipios/51 \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"
Common Municipality IDs
  • Mérida (capital): 51
  • Valladolid: 103
  • Tizimín: 97
  • Progreso: 60
  • Ticul: 90

Error Handling

Invalid ID Format

The endpoint uses ParseIntPipe validation, so non-numeric IDs will return a 400 error:
{
  "statusCode": 400,
  "message": "Validation failed (numeric string is expected)",
  "error": "Bad Request"
}

Municipality Not Found

If the ID doesn’t exist in the database, the endpoint returns null. Handle this in your application:
if (municipio === null) {
  console.log('Municipality not found');
}

Notes

  • The endpoint returns null if no municipality is found with the given ID
  • Only IDs between 1 and 106 are valid (corresponding to Yucatan’s 106 municipalities)
  • Geographic coordinates represent the central point of each municipality
  • This is a read-only endpoint; municipalities cannot be modified via the API
  • Inactive municipalities may still be retrieved if you have their ID

Build docs developers (and LLMs) love