Skip to main content

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

Localidades (localities) are geographic entities associated with municipalities. This catalog provides reference data for localities within the Yucatan region.

Get All Localidades

Retrieves a list of all localities in the system.

Authentication

This endpoint requires authentication using a Bearer token.

Response

id
number
required
Unique identifier for the locality
nombre
string
required
Name of the locality (max 100 characters)
clave
string
Optional code or key for the locality
activo
boolean
required
Status flag indicating if the locality is active (default: true)
municipioId
number
required
ID of the municipality this locality belongs to
municipio
object
Related municipality entity object

Example Request

curl --request GET \
  --url http://localhost:3000/localidad \
  --header 'Authorization: Bearer YOUR_TOKEN'

Example Response

[
  {
    "id": 1,
    "nombre": "Merida Centro",
    "clave": "MER-01",
    "activo": true,
    "municipioId": 1,
    "municipio": {
      "id": 1,
      "nombre": "Merida"
    }
  },
  {
    "id": 2,
    "nombre": "Valladolid Norte",
    "clave": "VAL-01",
    "activo": true,
    "municipioId": 2,
    "municipio": {
      "id": 2,
      "nombre": "Valladolid"
    }
  }
]

Get Localidad by ID

Retrieves a single locality by its unique identifier.

Authentication

This endpoint requires authentication using a Bearer token.

Path Parameters

id
number
required
The unique identifier of the locality to retrieve

Response

Returns a single locality object with the following fields:
id
number
required
Unique identifier for the locality
nombre
string
required
Name of the locality
clave
string
Optional code or key for the locality
activo
boolean
required
Status flag indicating if the locality is active
municipioId
number
required
ID of the municipality this locality belongs to
municipio
object
Related municipality entity object

Example Request

curl --request GET \
  --url http://localhost:3000/localidad/1 \
  --header 'Authorization: Bearer YOUR_TOKEN'

Example Response

{
  "id": 1,
  "nombre": "Merida Centro",
  "clave": "MER-01",
  "activo": true,
  "municipioId": 1,
  "municipio": {
    "id": 1,
    "nombre": "Merida"
  }
}

Error Responses

statusCode
number
HTTP status code (404 if locality not found)
message
string
Error message describing what went wrong
{
  "statusCode": 404,
  "message": "Locality not found"
}

Create Localidad

Creates a new locality in the system.

Authentication

This endpoint requires authentication using a Bearer token.

Request Body

nombre
string
required
Name of the locality (max 100 characters)
clave
string
Optional code or key for the locality
municipioId
number
required
ID of the municipality this locality belongs to
activo
boolean
Status flag (defaults to true if not provided)

Example Request

curl --request POST \
  --url http://localhost:3000/localidad \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "nombre": "Tizimin Sur",
    "clave": "TIZ-02",
    "municipioId": 3,
    "activo": true
  }'

Example Response

{
  "id": 3,
  "nombre": "Tizimin Sur",
  "clave": "TIZ-02",
  "activo": true,
  "municipioId": 3
}

Update Localidad

Updates an existing locality.

Authentication

This endpoint requires authentication using a Bearer token.

Path Parameters

id
number
required
The unique identifier of the locality to update

Request Body

All fields are optional. Only include fields you want to update.
nombre
string
Name of the locality
clave
string
Code or key for the locality
municipioId
number
ID of the municipality
activo
boolean
Status flag

Example Request

curl --request PATCH \
  --url http://localhost:3000/localidad/3 \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "activo": false
  }'

Delete Localidad

Deletes a locality from the system.

Authentication

This endpoint requires authentication using a Bearer token.

Path Parameters

id
number
required
The unique identifier of the locality to delete

Example Request

curl --request DELETE \
  --url http://localhost:3000/localidad/3 \
  --header 'Authorization: Bearer YOUR_TOKEN'

Example Response

{
  "message": "Locality deleted successfully"
}

Build docs developers (and LLMs) love