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.

PATCH /dependencias/:id

Updates an existing government dependency. All fields are optional - only provide the fields you want to update.

Authentication

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

Path Parameters

id
number
required
The unique identifier of the dependency to updateExample: 1

Request Body

All fields are optional. Only include the fields you want to update.
nombre
string
Full name of the dependency. Leading and trailing whitespace will be automatically trimmed.Example: "Secretaría de Desarrollo Urbano y Vivienda"
siglas
string
Acronym or abbreviation for the dependency. Will be automatically converted to uppercase and whitespace will be trimmed.Example: "SDUV"
activo
boolean
Indicates whether the dependency is active.Example: false

Response

Returns the updated dependency object with all current values.
id
number
required
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 PATCH http://localhost:3000/dependencias/1 \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Secretaría de Desarrollo Urbano y Vivienda",
    "siglas": "SDUV"
  }'

Example Responses

200 - Success
{
  "id": 1,
  "nombre": "Secretaría de Desarrollo Urbano y Vivienda",
  "siglas": "SDUV",
  "activo": true
}
404 - Not Found
{
  "statusCode": 404,
  "message": "Dependencia #999 no encontrada",
  "error": "Not Found"
}
400 - Bad Request (Invalid Field Type)
{
  "statusCode": 400,
  "message": [
    "activo must be a boolean value"
  ],
  "error": "Bad Request"
}
The endpoint first verifies that the dependency exists before attempting to update it. If the ID is not found, a 404 error will be returned.
If you update the nombre field to a value that already exists for another dependency, you’ll receive a database constraint error due to the unique constraint.

Build docs developers (and LLMs) love