Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/PDNMX/s1_backend/llms.txt

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

S1 Backend proxies and enriches responses from provider APIs. The gateway adds metadata fields — supplier_name, supplier_id, levels, and endpoint_type — to every successful search response, and normalises errors into a consistent shape. This page documents the response structure for each endpoint.
Provider-level errors in POST /v1/summary are returned inline within the response array with HTTP status 200. Gateway-level errors (for example, a missing or unknown supplier_id in POST /v1/search) use HTTP status 500.

GET / Response

A simple liveness and version response returned when the root path is requested.
{
  "title": "API del Sistema 1",
  "version": "1.0"
}
title
string
Human-readable API name. Always "API del Sistema 1".
version
string
Current API version string. Currently "1.0".

GET /v1/providers Response

Returns an array of provider metadata objects — one entry per configured provider in endpoints.json. Credentials and internal URLs are never included.
[
  {
    "supplier_id": "EDOMEX",
    "supplier_name": "Secretaría Ejecutiva del Sistema Estatal Anticorrupción del Estado México",
    "levels": ["estatal"],
    "status": "active"
  }
]
supplier_id
string
Unique provider identifier (sourced from endpoints.json).
supplier_name
string
Full official name of the government institution.
levels
array of strings
Jurisdictional scope tags for this provider (e.g. "federal", "estatal", "municipal").
status
string
Provider availability status as recorded in endpoints.json. The gateway surfaces this field as-is; it is not computed at request time.

POST /v1/summary Response

Returns an array — one item per provider that was queried. Items are the resolved results of concurrent fetchData calls; a provider that fails will have an error item rather than a success item. The overall HTTP status is always 200 as long as the gateway itself is healthy.

Success Item

Returned when fetchData resolves without error for a given provider.
{
  "supplier_id": "EDOMEX",
  "supplier_name": "Secretaría Ejecutiva del Sistema Estatal Anticorrupción del Estado México",
  "levels": ["estatal"],
  "pagination": {
    "totalRows": 142,
    "page": 1,
    "pageSize": 1
  },
  "results": [{ "...": "..." }]
}
supplier_id
string
Unique provider identifier.
supplier_name
string
Full official name of the government institution.
levels
array of strings
Jurisdictional scope tags from the provider’s configuration.
pagination
object
Pagination metadata forwarded from the provider’s own response. Typically contains totalRows, page, and pageSize, but the exact shape depends on the provider implementation.
results
array
Matching declaration records returned by the provider for this summary query. For /v1/summary the gateway always requests pageSize: 1, so this array will typically contain at most one record.

Error Item

Returned when fetchData rejects or throws for a given provider. The overall HTTP response is still 200; consumers must check for the presence of the error field to detect per-provider failures.
{
  "supplier_id": "EDOMEX",
  "supplier_name": "Secretaría Ejecutiva del Sistema Estatal Anticorrupción del Estado México",
  "levels": ["estatal"],
  "error": "Algo salió mal.",
  "totalRows": "No disponible"
}
supplier_id
string
Unique provider identifier.
supplier_name
string
Full official name of the government institution.
levels
array of strings
Jurisdictional scope tags from the provider’s configuration.
error
string
Human-readable error message. Always "Algo salió mal." for summary-level provider failures.
totalRows
string
Sentinel value indicating the count is unavailable. Always "No disponible" when an error occurred.

POST /v1/search Response

For a successful search, the gateway returns the provider’s response body enriched with the following four metadata fields added by fetchData in rest_data.js.
{
  "pagination": {
    "totalRows": 38,
    "page": 1,
    "pageSize": 20
  },
  "results": [{ "...": "..." }],
  "supplier_name": "Secretaría Ejecutiva del Sistema Estatal Anticorrupción del Estado México",
  "supplier_id": "EDOMEX",
  "levels": ["estatal"],
  "endpoint_type": "REST"
}
supplier_name
string
Full official name of the government institution that provided the data.
supplier_id
string
Unique provider identifier.
levels
array of strings
Jurisdictional scope tags from the provider’s endpoints.json entry.
endpoint_type
string
Protocol type of the provider endpoint, taken from the type field in endpoints.json. Currently always "REST".

Provider-Level Error Response

When the provider returns a response body that contains a code field (indicating an application-level error), fetchData returns an error object instead of the raw provider data.
{
  "supplier_name": "Secretaría Ejecutiva del Sistema Estatal Anticorrupción del Estado México",
  "supplier_id": "EDOMEX",
  "levels": ["estatal"],
  "endpoint_type": "REST",
  "error": {
    "code": 404,
    "message": "Not found"
  }
}
error
object
Present when the provider signals an application error via a code field in its response body.

Gateway-Level HTTP 500 Errors

These errors are returned directly by the gateway before a provider is contacted, when the request itself is invalid. Missing supplier_id — returned when supplier_id is not present in the request body:
{ "error": "Debe proporcionar un proveedor de información" }
Unknown supplier_id — returned when no entry in endpoints.json matches the supplied supplier_id:
{ "error": "Proveedor de información no disponible" }

POST /v1/logger Response

The logger endpoint accepts an array of client-side log entries and writes them to the server log. It always responds with HTTP 200.
{ "msj": "ok" }
msj
string
Acknowledgement string. Always "ok" when the log entries were accepted.

Build docs developers (and LLMs) love