The Locations API serves two complementary purposes. The first group of endpoints exposes the geographic hierarchy — regions, states, and cities — stored in Firestore as reference collections (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Danielings/Pasantia-Proyecto/llms.txt
Use this file to discover all available pages before exploring further.
regiones, estados, ciudades). These are read-only lookups used to populate cascading dropdowns in the UI. The second group manages ubicaciones — the concrete office locations (building, floor, wing) that are attached to users, equipment, and peripherals throughout the system.
Every location is identified by a deterministic, content-derived document ID (ubi_<sha1>) computed from its normalized field values. This means identical locations always map to the same document, preventing duplicates and enabling direct lookups without queries.
GET /api/region
List all available geographic regions ordered alphabetically by name. Auth: Not required.Request
No parameters.Response
Returns a JSON array:Firestore document ID (used as the
id argument in GET /api/region/:id/estados).Human-readable region name (e.g.,
"Centro Occidental").Example
GET /api/region/:id/estados
List all states that belong to a specific region, ordered alphabetically. Auth: Not required.Request
Region ID as returned by
GET /api/region (the id_region field).Response
Returns a JSON array:Firestore document ID (used as the
id argument in GET /api/estados/:id/ciudades).State name (e.g.,
"Lara").Example
GET /api/estados/:id/ciudades
List all cities within a specific state, ordered alphabetically. Auth: Not required.Request
State ID as returned by
GET /api/region/:id/estados (the id_estado field).Response
Returns a JSON array:Firestore document ID.
City name (e.g.,
"Barquisimeto").Example
GET /api/ubicaciones
List all active office locations (status: "Activo"). The result is deduplicated by the combination of region | estado | ciudad | sede | piso | ala, so if the same logical location was created multiple times it appears only once. Results are sorted by sede + piso.
Auth: Not required.
Request
No parameters.Response
Returns a JSON array. Each element is a full location object:Deterministic Firestore document ID (format:
ubi_<sha1hash>).Geographic region.
State/province.
City.
Office building or branch name.
Floor number or label.
Wing or section.
null if not applicable.Always
"Activo" in this endpoint’s results.Firestore server timestamp of when the document was first created.
Example
POST /api/ubicaciones
Create a new office location. The document ID is derived deterministically from the normalized field values. Returns409 Conflict if a location with the same data already exists.
Auth: Required. Role: write permission (enforced by permitirEscritura middleware).
Request
Geographic region name.
State/province name.
City name.
Office building or branch name.
Floor number or label.
Wing or section. Optional — stored as
null if omitted.Response
"Ubicación registrada con éxito"The deterministic document ID assigned to the new location.
Normalized region stored in Firestore.
Normalized state stored in Firestore.
Normalized city stored in Firestore.
Normalized sede stored in Firestore.
Normalized floor stored in Firestore.
Normalized wing stored in Firestore.
Example
GET /api/ubicaciones/:id
Retrieve a single location document by its Firestore document ID. Auth: Not required.Request
Firestore document ID (the
ubi_<sha1> string returned by create or list operations).Response
Full location document. Returns404 if the document does not exist.
Example
PUT /api/ubicaciones/:id
Update an existing location. If the normalized field values remain unchanged, the existing document is updated in place. If the values produce a different document ID (meaning the location identity changed), the old document is deleted and a new one is created atomically inside a Firestore transaction. Returns409 if the new ID already exists.
Auth: Required. Role: write permission.
Request
Current Firestore document ID of the location.
Updated region.
Updated state.
Updated city.
Updated office building.
Updated floor.
Updated wing. Pass
null to clear.Response
"Ubicación actualizada con éxito"The document ID after the update (may differ from the request
:id if the identity changed).Example
DELETE /api/ubicaciones/:id
Permanently delete a location document from Firestore. This operation is irreversible. Auth: Required. Role: write permission.Request
Firestore document ID of the location to delete.
Response
"Ubicación eliminada con éxito"Example
PUT /api/ubicaciones/eliminadas/:id
Soft-delete a location by setting itsstatus field to "inactivo". The document is retained in Firestore and excluded from the GET /api/ubicaciones listing (which filters by status == "Activo"). A "Eliminar ubicación" entry is written to the bitácora.
Auth: Required.
Request
Firestore document ID of the location to deactivate.
Response
"Ubicación eliminada (lógicamente)."