Skip to Content
Environments and test mode

Environments and test mode

How to test your integration without sending anything to the authorities, and how to go live when you are ready.

Environments

The API has two environments with the same endpoints. Only the domain changes, and with it the default behaviour:

EnvironmentDefaultTo change it
Production https://api.saltra.esReal: sent to the authorityX-Saltra-Mode: test → fictitious
Test https://dev-api.saltra.esFictitious: nothing is sentX-Saltra-Mode: live → real

In fictitious mode nothing is sent to the authority and the response carries sample data. The header applies to Social Security (RED System) and SEPE requests. DEHU, AEAT and the Navarre Tax Office have no fictitious mode: their requests are always real, with or without the header.

Accepted values: only test and live. Any other value returns 422 without processing the request.

In the test environment, without the header everything is fictitious. With X-Saltra-Mode: live the request is really sent to the authority with the client’s certificate (the one in X-Cert-Secret), also from dev-api.saltra.es: a registration or deregistration sent that way is real.

Example

A fictitious deregistration in production: the request is the same as the real one, with the X-Saltra-Mode: test header.

POST /seg-social/baja
curl -X POST https://api.saltra.es/api/v4/seg-social/baja \ -H 'Authorization: Bearer *token*' \ -H 'X-Cert-Secret: *secret*' \ -H 'X-Saltra-Mode: test' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d '{"regimen": "0111", "ccc": 12345678901, "nss": "123456789012", "identificacion": 1, "dni": "12345678A", "situacion": 93, "fecha_real": "2023-11-01"}'

To make it real in production, just drop the header (or send X-Saltra-Mode: live).

MCP server

On the public MCP server (https://api.saltra.es/api/v4/mcp) the X-Saltra-Mode header is set on the MCP connection (the headers your MCP client sends with every request), not in each tool’s arguments. It applies to every tool on that connection, following the same table; a value other than test or live returns an MCP connection error instead of the 422.

Last updated on