Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Glemynart/SaaS/llms.txt

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

The Sedes API lets you model the physical branch structure of your organization. Each branch (sede) is linked to a validated DANE municipality record and can be activated or deactivated without removing historical data. Employees, contracts, and bulk-import batches all reference sedes by their UUID. All endpoints require a valid JWT and an active tenant context.

Endpoints

List branches


GET /sedes
Returns all branches for the current tenant, ordered alphabetically by nombre. The response embeds the associated municipality object (id, nombre, departamento).

Query parameters

Case-insensitive partial match against the branch nombre.
activo
boolean
When true, returns only active branches. When false, returns only inactive branches. Omit to return all branches regardless of status.

Response

id
string
Unique branch identifier (UUID).
nombre
string
Branch display name, unique among active branches within the tenant.
direccion
string | null
Street address of the branch.
activo
boolean
Whether the branch is currently active.
createdAt
string
ISO 8601 creation timestamp.
updatedAt
string
ISO 8601 last-updated timestamp.
municipio
object | null
Embedded DANE municipality record.
curl -X GET "https://api.example.com/sedes?activo=true" \
  -H "Authorization: Bearer {accessToken}"

Create a branch


POST /sedes
Creates a new branch for the tenant. The municipioId must correspond to a valid record in the DANE catalogue (see GET /dane/municipios below). If the branch will be active, its nombre must not conflict with any other currently-active branch in the same tenant (case-insensitive). Required role: ADMIN

Request body

nombre
string
required
Branch display name. Must be unique among active branches within the tenant (case-insensitive comparison).
municipioId
string
required
UUID of the DANE municipality where this branch is located. Obtain valid values from GET /dane/municipios.
direccion
string
Street address of the branch.
activo
boolean
Initial active state. Defaults to true if omitted.

Response

Returns the created branch object including the embedded municipio record.
curl -X POST "https://api.example.com/sedes" \
  -H "Authorization: Bearer {accessToken}" \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Sede Norte",
    "municipioId": "a4f2e1d0-3b8c-4e7a-9f5d-1c2b3a4e5f60",
    "direccion": "Av. 19 # 127-55, Bogotá D.C.",
    "activo": true
  }'

Get a branch


GET /sedes/:id
Returns a single branch by UUID, scoped to the authenticated tenant. Responds with 404 if the branch does not exist or belongs to a different tenant.

Path parameters

id
string
required
UUID of the branch to retrieve.
curl -X GET "https://api.example.com/sedes/a4f2e1d0-3b8c-4e7a-9f5d-1c2b3a4e5f60" \
  -H "Authorization: Bearer {accessToken}"

Update a branch


PATCH /sedes/:id
Partially updates a branch. Only the fields present in the request body are modified. If the update would result in two active branches with the same name (case-insensitive), the server returns 400 Bad Request. If a new municipioId is provided, it is validated against the DANE catalogue before the update is applied. Required role: ADMIN

Path parameters

id
string
required
UUID of the branch to update.

Request body

nombre
string
New branch name. Must remain unique among active branches within the tenant.
municipioId
string
New DANE municipality UUID. Must exist in the DANE catalogue.
direccion
string
Updated street address.
activo
boolean
Set to false to deactivate the branch (logical/soft deactivation — the record is not removed from the database and all historical references remain intact).
curl -X PATCH "https://api.example.com/sedes/a4f2e1d0-3b8c-4e7a-9f5d-1c2b3a4e5f60" \
  -H "Authorization: Bearer {accessToken}" \
  -H "Content-Type: application/json" \
  -d '{"activo": false}'

DANE municipality catalog

Get DANE municipality catalog


GET /dane/municipios
Returns the complete Colombian municipality catalog sourced from the official DANE (Departamento Administrativo Nacional de Estadística) register. Use the id from any result as the municipioId when creating or updating a sede or an employee record.

Response

Each item in the returned array contains:
id
string
UUID — use this as municipioId in branch and employee requests.
codigo
string
Official DANE code (e.g., "11001" for Bogotá D.C.).
nombre
string
Municipality name.
departamento
string
Department the municipality belongs to.
curl -X GET "https://api.example.com/dane/municipios" \
  -H "Authorization: Bearer {accessToken}"

Deactivation and soft-delete behavior

Setting activo: false on a branch performs a logical deactivation — the record persists in the database with all historical linkages (contracts, employees, import batches) intact. Deactivated branches are excluded from the uniqueness check for nombre, so a new active branch may reuse the name of a deactivated one. Branches cannot be hard-deleted through the API.

Uniqueness rule

Active branch names must be unique within a tenant, regardless of letter case. Attempting to create or rename a branch to a name already used by another active branch in the same tenant returns 400 Bad Request with the message "Ya existe una sede activa con este nombre".
Employees reference branches by their UUID sedeId in all API operations. However, the bulk-import template (CSV/Excel) uses the branch name (nombre) as the lookup key. Ensure branch names in your import file exactly match the names registered in the system — mismatches will cause row-level validation errors during the import job.

Build docs developers (and LLMs) love