API
HTTP
SDMX
sxs covers a very broad spectrum of the REST API SDMX3 standard
sxs responds to Rest API SDMX 2 and 3.* versions
Endpoints urls:
- SDMX3: https://{hostname}/{space}/sdmx/ or https://{hostname}/{space}/v3/sdmx/
- SDMX2: https://{hostname}/{space}/v2/sdmx/
REM: hostname must be declared associated with the right tenant in the proxy server defined within config://tenants.json
Limited Queries
sxs support X-Range header and limit and offset query params under certain limitations:
- multi dataset queries are not allowed with
offsetsearch query param limitsearch param used with multi dataset queries is applied to all subqueriesworkerObsCountLimitandbulkObsCountLimitare execution and resource thresholds, not hard result limits- a query whose
limitis lower than or equal to both thresholds stays in the main loop with the normal resource profile; larger queries may use a worker and/or the bulk resource profile (see Output Formats) - very large or multi-hour downloads should use asynchronous exports
Localization
Localized names and descriptions are selected in this order:
Accept-Languageheaderlocalesorlocalequery parameter (only whenAccept-Languageis absent)- member
defaultLanguage
Examples:
locales accepts a comma-separated list or repeated parameters and takes precedence over locale. Accept-Language: * selects the member default language. These rules apply to SDMX data, availability and structure queries.
Exports
Asynchronous exports move large downloads out of the HTTP request lifecycle. See Asynchronous exports for the full lifecycle and configuration, and Execution modes and resource profiles for choosing between synchronous and asynchronous delivery, execution modes and resource profiles.
Create request:
Supported formats are json, csv, native-csv, parquet, arrow,
arrowstream and protobuf.
A data request can create an export directly with Prefer: respond-async:
Synchronous requests above SYNC_MAX_OBSERVATIONS return 413 Payload Too Large unless the client opts in with Prefer: respond-async.
A successful create returns 202 Accepted:
The list endpoint supports from, to, status, format, requester,
exportId, confyJobId, offset and limit.
A full export queue returns 429 Too Many Requests with Retry-After: 5.
The download endpoint returns a fresh signed URL when the storage provider
supports it, otherwise it streams the file through sxs.
Admin API
/admin/sxs/logs
- verb GET or POST
- params
- api-key: required
- spaceId: required, rem: api-key is linked to a memberId
- from: start of period, format like '2025-01-20' or '2025-01-16T11:11:41.821Z', default to startOfDay(
to- 10 days) - to: end of period, same format as
from, default to endOfDay(today)
- headers
- x-api-key: must use one of 'api-key' or 'x-api-key'
- return:
- CSV file named
SXS_LOGS_${memberId}_${spaceId}_${from.toISOString()}_${to.toISOString()}.csv
- CSV file named
- usage (see Nushell):
Service Bus API
sxs offers very rich and extensible APIs via the DBMX.IO bus, aka MOM API
Many patterns are proposed: RPC like, Pub/Sub, Broadcast
Components using the MOM API do not directly access the MOM, but instead use the @dbmx/mom lib.
RPC
sxs exposes internal services via evtX (RPC over AMQP). These services can be called programmatically using the rpc.run() interface or tested via the rpc.run test pattern.
All services share a common auth pipeline: API key or token validation, member/space resolution, credential check, and permission verification.
datasets
Dataset management, observation queries, dimension group attributes, and annotations.
Permissions: All methods require sxs:spaces:read. Write methods additionally require sxs:spaces:write.
structures
SDMX structure artefact management, transfer, dependency resolution, and recursive deletion.
Permissions: All methods require sxs:spaces:read. canDeleteAgency, delete, and createContentConstraint require sxs:spaces:write.
sxsStats
Usage analytics, query logs, ClickHouse stats, and activity tracking.
Permissions: activities, sxsTraces, loadSXSTrace, sxsTraceStats, sxsExports, loadSXSExport, sxsExportHistory and sxsExportStats require sxs:spaces:read. Other methods are internal/admin.
sxsWorkerJobs
Operational access to worker-job records. This is the service used by the Confy Worker jobs tool. Records include both execution modes and both resource profiles.
Queue-wait fields are calculated from queueWaitMs for worker jobs:
queueWaitCount, averageQueueWaitMs, queueWaitP50Ms, queueWaitP95Ms
and maxQueueWaitMs.
Permissions: All methods require sxs:spaces:read.
The legacy sxsBulks service is removed.
sxsExports
Operational access to asynchronous exports. This is the service used by the
Confy exports tool. The equivalent methods remain available on sxsStats for
backward compatibility.
Permissions: Read methods require sxs:spaces:read; cancel requires
sxs:spaces:write.
stats
Runtime and process statistics.
No auth hooks.
warnings
System warning log queries.
Permissions: Requires API key/user/credential validation (no space check).
e2e (conditional)
End-to-end test lifecycle helpers. Only registered when config.allowE2ETests is true.
No auth hooks. Operates on the e2etest member only.
Calling an RPC method
In-process (direct call)
Via RabbitMQ (AMQP)
All exported evtX services are also accessible over RabbitMQ through the @dbmx/mom message bus. The RPC service is registered with MOM at startup (rpcService: rpc in src/server/mom/index.js), routing AMQP call requests to the appropriate service method.
The routing key format is <service>.<method>. Supported services: datasets, structures, sxsStats, stats, warnings (and e2e when enabled).
Architecture
sxs uses RabbitMQ as its messaging backbone via the internal @dbmx/mom library (which wraps amqplib). The server and various CLI scripts all connect to the same AMQP broker.
Communication patterns:
Connection & Reconnection
The MOM client connects to RabbitMQ on server start (src/server/index.js:86). The connection is resilient with automatic reconnection:
- Exponential backoff with jitter: delays grow from 500ms up to 30s max, with ±50% random jitter to prevent thundering herd
- Auto-re-subscription: all queues, broadcasts, and RPC bindings are automatically re-established after reconnect
- In-flight call cleanup: pending RPC calls are rejected with a clear error on disconnect
- Graceful degradation:
publishandcallreject immediately when not connected instead of hanging
Configure reconnection behavior via the AMQP_RECONNECT environment variable:
Monitor connection state via the mom.status property ('disconnected' | 'connecting' | 'connected' | 'closed') or listen to the connected, reconnecting, closed, and disconnected events.
Key Routing Keys
Stream Queues
For high-throughput data transfer, sxs uses RabbitMQ stream queues (RabbitMQ 3.9+):
CSV/JSON loaders write data into stream queues and read them back via createJSONStreamReader.
Auth pipeline
Most services apply these before-hooks (in order):
handleApiKey– resolve credential from API key or JWT tokenhandleMemberAndSpace– attach member and space contexthandleUser– resolve user identity (if applicable)checkCredential– validate credential is activecheckUserSpacePermissions('sxs:spaces:read')– verify minimum permission
Write methods layer on checkUserSpacePermissions('sxs:spaces:write').
Pub/Sub
Create a Job
Jobs are used to execute distributed workflows.
A Job centralized activity logs but may also has a state used by different actors to cooperate.
Confy used to be the Jobs orchestrator, but any component can play this role.
Many Pub/Sub APIs are use a Job.
