S1 Backend exposes a JSON REST API over HTTP that acts as a gateway to Mexico’s Plataforma Digital Nacional (PDN) Sistema 1. Clients do not need to authenticate — the gateway handles OAuth 2.0 internally against each configured provider on every request. All request and response bodies are JSON.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.
Base URL
The server listens on the port defined by thePORT environment variable, which defaults to 3000 (the .env.example file uses 3101). No path prefix is required — routes are mounted directly at the root.
Authentication
Callers send no authentication headers. S1 Backend manages all provider credentials internally. On every outbound request to a provider, the gateway performs the OAuth 2.0 password grant flow:- Posts
grant_type=passwordalong withusername,password,client_id,client_secret(and optionallyscope) to the provider’stoken_url. - The request uses HTTP Basic Auth with
client_idandclient_secretas credentials. - The resulting
access_tokenis attached as aBearertoken in theAuthorizationheader of the subsequent data request.
Tokens are not cached. A fresh token is acquired from the provider on every inbound API call. Credentials are stored server-side in
endpoints.json and are never exposed to callers.Endpoints Summary
| Method | Path | Description |
|---|---|---|
GET | / | Returns the API title and version string |
GET | /v1/providers | Lists all configured data providers |
POST | /v1/summary | Returns record counts fanned out across matching providers |
POST | /v1/search | Paginated declaration search against one specific provider |
POST | /v1/logger | Ingests an array of client-side log events |
Request Format
AllPOST requests must send a Content-Type: application/json header and a JSON body. GET requests have no body.
Response Format
All responses are JSON. Successful responses return HTTP 200. Error responses use HTTP 500 with one of these body shapes:CORS
CORS is enabled globally via thecors middleware applied to all routes. All origins are permitted — no explicit allow-list is configured.
Pagination
Both/v1/search and /v1/summary accept page and pageSize fields in the request body to control pagination.
| Endpoint | Default page | Default pageSize |
|---|---|---|
POST /v1/search | 1 | 10 |
POST /v1/summary | 1 | 1 |
Explore Endpoints
Health Check
GET / — Verify the gateway is running and retrieve the API version.Providers
GET /v1/providers — List all configured government data suppliers.Summary
POST /v1/summary — Fan out a query and retrieve record counts from multiple providers simultaneously.Search
POST /v1/search — Run a paginated, filterable search against one specific provider.Logger
POST /v1/logger — Forward client-side log events to the server log.