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.

POST /dependencias

Creates a new government dependency in the system.

Authentication

No authentication required in the current implementation.
This endpoint should be protected with authentication and admin authorization in production environments.

Request Body

nombre
string
required
Full name of the dependency. This field is required and cannot be empty. Leading and trailing whitespace will be automatically trimmed.Example: "Secretaría de Desarrollo Urbano"
siglas
string
Acronym or abbreviation for the dependency. This field is optional. If provided, it will be automatically converted to uppercase and whitespace will be trimmed.Example: "SDU" or "sdu" (both become "SDU")
activo
boolean
default:true
Indicates whether the dependency is active. Optional field that defaults to true if not provided.Example: true

Response

Returns the newly created dependency object with its assigned ID.
id
number
required
Auto-generated unique identifier for the dependency
nombre
string
required
Full name of the dependency
siglas
string
Acronym or abbreviation for the dependency (uppercase)
activo
boolean
required
Indicates whether the dependency is active

Example Request

curl -X POST http://localhost:3000/dependencias \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Secretaría de Desarrollo Urbano",
    "siglas": "SDU",
    "activo": true
  }'

Example Responses

201 - Created
{
  "id": 5,
  "nombre": "Secretaría de Desarrollo Urbano",
  "siglas": "SDU",
  "activo": true
}
400 - Bad Request (Missing Required Field)
{
  "statusCode": 400,
  "message": [
    "El nombre es obligatorio"
  ],
  "error": "Bad Request"
}
400 - Bad Request (Invalid Field Type)
{
  "statusCode": 400,
  "message": [
    "activo must be a boolean value"
  ],
  "error": "Bad Request"
}
The nombre field must be unique. If you try to create a dependency with a name that already exists, you’ll receive a database constraint error.

Build docs developers (and LLMs) love