Skip to Content
DEHU

DEHU

Connect your applications to DEHU services.

Requests to DEHU have no fictitious mode: queries are always real, also in the test environment and even with X-Saltra-Mode: test. Confirming a notification (PUT /dehu/notification-confirm) has legal effect: with X-Saltra-Mode: test, or without the header in the test environment, it returns 409 without sending anything; to really confirm it from the test environment send X-Saltra-Mode: live. See Environments and test mode.

HTTP header parameters

  • Authorization (string): API authorisation. Example: Bearer {token}
  • X-Cert-Secret (string) : Secret key associated with the client certificate.

Base URL

https://api.saltra.es/api/v4/dehu

Errors

Errors returned by the DEHU API, or validation errors.

  • success (boolean) : Returns “true” when everything is correct, and “false” when there are errors.
  • message (string) : The response message.
  • errors (array) : Errors captured by the API, either from DEHU or validation errors.
    • dehu: Errors related to DEHU.
    • regimen: Validation errors.
  • maintenance (boolean) : Set when DEHU is under maintenance.
  • retryable optional (boolean) : true on 503 responses where we could not communicate with the authority; retry after Retry-After. It is absent on 424 and on the unknown-outcome 503 of a write.

Response

Respuesta
{ "success": false, "message": "Página no operativa, inténtelo de nuevo más tarde. StatusCode: 500", "status": 500, "data": [], "errors": { "dehu": [ "Página no operativa, inténtelo de nuevo más tarde. StatusCode: 500" ] }, "maintenance": true }

Status codes

When the failure is on the authority’s side (TGSS/RED System, SEPE, DEHU, AEAT, Navarre Tax Office) or in the connected system, the HTTP code tells you whether retrying is worthwhile. The body always follows the usual error format (success, message, status, data, errors): read it on every status code; the reason is in message.

CodeWhat happenedMarkersRetry?
424The authority answered and rejected the request, or rejected the digital certificate we presented. Where applicable, message starts with SISTEMA RED: , SEPE: or DEHU: .X-Saltra-Error: organism-rejected header when message carries one of those prefixes. No Retry-After.No. Fix the data (or change the certificate) before sending it again.
503 + Retry-AfterWe could not communicate with the authority: connection failure, timeout on a query, invalid response or service down.retryable: true and retry_after in the body; Retry-After (60 seconds by default) and X-Saltra-Error: organism-unavailable headers.Yes, after the seconds given by Retry-After.
503 without Retry-AfterUnknown outcome of a write (registration, deregistration, contract change, communication to SEPE…): the authority did not answer in time or did not confirm, and the request may have been registered.No retryable and no Retry-After; timeout: true when time ran out.Not blindly: check first whether it was registered (you could duplicate it).
503 + maintenance: trueThe authority is under maintenance or not operational.maintenance: true, retry_after and the Retry-After header.Yes, after the seconds given by Retry-After.

Saltra’s validation errors are still 422 (do not retry until the data is fixed).

Example of a retryable 503:

HTTP/1.1 503 Service Unavailable Content-Type: application/json Retry-After: 60 X-Saltra-Error: organism-unavailable
Respuesta 503 (reintentable)
{ "success": false, "message": "Error de conexión de SALTRA con el (SISTEMA RED).", "status": 503, "data": [], "errors": { "tgss": ["Error de conexión de SALTRA con el (SISTEMA RED)."] }, "maintenance": false, "retryable": true, "retry_after": 60 }

The API never returns 502 or 504 on purpose. If your client gets a 502, 504 or 52x, it is generated by the network infrastructure, not by the API, and does not carry Saltra’s body: treat it as a connection failure and, if it was a write, check whether it was registered before retrying. Until 26/10/2026 authority rejections came back as 502 and timeouts as 504 (see the changelog).

Rate limits

Authenticated requests are limited to 80 per minute for reads (GET) and 120 per minute for writes (POST). The limit is counted per certificate (if X-Cert-Secret is sent) or, failing that, per authenticated user, and per route. Unauthenticated requests are limited to 60 per minute per IP. The heavy-integration endpoints —GET /employee-situations and GET /ta-info-for-nss from Social Security, and GET /contrata/data from SEPE— share a lower combined quota of 30 requests per minute per certificate (or user): using one reduces the quota of the other two.

Saltra reports your quota status in the headers of every response, so you can pace your calls before running out.

HeaderTypeWhen it is sentWhat it means
X-Ratelimit-LimitintegerAlwaysRequests allowed per minute.
X-Ratelimit-RemainingintegerAlwaysRequests left in the current window.
X-Ratelimit-ResetUNIX timestampAlwaysMoment the window renews and X-Ratelimit-Remaining returns to its maximum.
Retry-AftersecondsOn 429 and on 503 when the authority is under maintenance (maintenance: true) or we could not communicate with it (retryable: true). Never on a 424 or on the unknown-outcome 503 of a write.Seconds to wait before retrying.

Example of a successful response:

HTTP/1.1 200 OK X-Ratelimit-Limit: 80 X-Ratelimit-Remaining: 45 X-Ratelimit-Reset: 1786012860

X-Ratelimit-Reset is an absolute instant, not a countdown: it stays the same across every response in the same window and only moves forward when the quota renews. Combined with X-Ratelimit-Remaining, it is what lets you space out requests as you approach the limit instead of stopping dead.

Once the limit is exceeded, the API responds 429 Too Many Requests and adds Retry-After:

HTTP/1.1 429 Too Many Requests X-Ratelimit-Limit: 80 X-Ratelimit-Remaining: 0 X-Ratelimit-Reset: 1786012860 Retry-After: 37

The body follows the usual error format:

{ "success": false, "status": 429, "message": "Too Many Requests" }

Wait the number of seconds given by Retry-After before retrying. Retrying early does not unblock you sooner: it consumes more quota and lengthens the wait.

Get statistics

GET /notification-stats
{}

Response

Respuesta
{ "success": true, "message": "OK", "data": { "totalNotReadCommunications": "29", "totalPendingNotifications": "78", "newDeviceForPushNotify": "0", "userHasUnverifiedEmail": "0", "userHasNotContact": "0" } }

Search notification status

Parameters (filters)

  • id (integer) : The notification’s “identifier” field.
GET /notification-finder
{ "id": "N259998999" }

Response

Respuesta
{ "success": true, "message": "OK", "status": 200, "data": [ { "type": "notifications/pending", "emitterSourceEntity": "Ministerio de Inclusión, Seguridad Social y Migraciones", "sentReference": "446dee88a09c99995754f4d68dc7weq3ea3c909873991", "state": "PENDIENTE" } ] }

Pending notifications

Parameters

  • page (integer) : Current page number, defaults to 1.
  • limit optional (integer) : Records per request; 50 records by default and as the maximum.
  • titularNif optional (string) : Holder’s NIF.
  • startDate optional: Start date in Y-m-d format.
  • endDate optional: End date in Y-m-d format.
GET /notifications-pending
{ "page": 1, "startDate": "2025-01-01", "endDate": "2025-01-02" }

Response

  • sentReference: Notification identifier.
Respuesta
{ "success": true, "message": "OK", "data": { "count": 50, "total": 51, "limit": 50, "page": 1, "items": [ { "emitterEntity": "Tesoreria General de la Seguridad Social", "emitterSourceEntity": "Ministerio de Inclusión, Seguridad Social y Migraciones", "nifTitular": "B19994999", "sentReference": "446dee88a09c99995754f4d68dc7weq3ea3c909873991", "identifier": "N259998999", "concept": "REGIMENES SEG. SOCIAL OBLIGADOS A RED / 2101V0999999990999 / PROVIDENCIA DE APREMIO", "description": null, "postalDelivery": false, "availabilityDate": "2025-10-05T00:03:49+02:00", "expirationDate": "2025-10-16T23:59:59+02:00", "finalDate": null, "bondType": "DESTINATARIO", "notificationPriority": "NORMAL", "unsynchronizedAppearance": null, "assuranceLevel": "low" } ] } }

Completed notifications

Parameters

  • page (integer) : Current page number, defaults to 1.
  • limit optional (integer) : Records per request; 50 records by default and as the maximum.
  • titularNif optional (string) : Holder’s NIF.
  • startDate optional: Start date in Y-m-d format.
  • endDate optional: End date in Y-m-d format.
GET /notifications-done
{ "page": 1, "startDate": "2025-01-01", "endDate": "2025-01-02" }

Response

  • sentReference: Notification identifier.
Respuesta
{ "success": true, "message": "OK", "data": { "count": 50, "total": 51, "limit": 50, "page": 1, "items": [ { "emitterEntity": "Tesoreria General de la Seguridad Social", "emitterSourceEntity": "Ministerio de Inclusión, Seguridad Social y Migraciones", "vinculoReceptor": "TITULAR", "nifTitular": "B21999999", "sentReference": "446dee88a09c99995754f4d68dc7weq3ea3c909873991", "state": "ACEPTADA", "identifier": "N259993999", "concept": "REGIMENES SEG. SOCIAL OBLIGADOS A RED / 2190A4525099999999 / RESOLUCION ALTAS/BAJAS (RED)", "postalDelivery": false, "availabilityDate": "2025-10-10T01:28:53+02:00", "expirationDate": "2025-10-21T23:59:59+02:00", "finalDate": "2025-10-10T08:26:02+02:00", "bondType": "DESTINATARIO", "hasAnnexes": false, "notificationPriority": "NORMAL", "assuranceLevel": "low" } ] } }

Communications

Parameters (filters)

  • page (integer) : Current page number, defaults to 1.
  • limit optional (integer) : Records per request; 50 records by default and as the maximum.
  • titularNif optional (string) : Holder’s NIF.
  • startDate optional: Start date in Y-m-d format.
  • endDate optional: End date in Y-m-d format.
GET /communications
{ "page": 1, "startDate": "2025-01-01", "endDate": "2025-01-02" }

Response

  • sentReference: Notification identifier.
Respuesta
{ "success": true, "message": "OK", "data": { "count": 50, "total": 51, "limit": 50, "page": 1, "items": [ { "emitterEntity": "Tesoreria General de la Seguridad Social", "emitterSourceEntity": "Ministerio de Inclusión, Seguridad Social y Migraciones", "vinculoReceptor": "", "nifTitular": "99936799A", "sentReference": "446dee88a09c99995754f4d68dc7weq3ea3c909873991", "state": "PENDIENTE", "identifier": "C59999999", "concept": "REGIMENES SEG. SOCIAL OBLIGADOS A RED / 2101D2999942419999 / COMUNICACIÓN CON DESTINO NACIONAL", "postalDelivery": false, "availabilityDate": "2025-10-09T00:02:48+02:00", "finalDate": null, "document": [], "bondType": "DESTINATARIO", "hasAnnexes": false } ] } }

Get details of a completed notification

Parameters (filters)

  • id (string) : Notification identifier (sentReference).
  • duplicate optional (number) : Retrieves the document “content” as base64 if available.
  • voucher optional (number) : Retrieves the receipt “content” as base64 if available.
GET /notification-done
{ "id": "446dee88a09c99995754f4d68dc7weq3ea3c909873991" }

Response

Respuesta
{ "success": true, "message": "OK", "data": { "emitterEntity": "Tesoreria General de la Seguridad Social", "emitterSourceEntity": "Ministerio de Inclusión, Seguridad Social y Migraciones", "nifReceptor": "99999962X", "nameReceptor": "JOSE JUAN PEREZ", "receiver": { "nif": "99999962X", "name": "JOSE JUAN PEREZ", "dir3Code": null, "direCode": null }, "nifTitular": "B99999999", "dir3Code": null, "direCode": null, "cantAnnexes": 0, "sentReference": "446dee88a09c99995754f4d68dc7weq3ea3c909873991", "state": "ACEPTADA", "identifier": "N999609999", "concept": "REGIMENES SEG. SOCIAL OBLIGADOS A RED / 99999999904 / RECLAMACIÓN DE DEUDA", "description": null, "availabilityDate": "2025-10-01T01:37:22+02:00", "expirationDate": "2025-10-12T23:59:59+02:00", "finalDate": "2025-10-01T10:29:32+02:00", "document": { "publicMetadata": null, "privateMetadata": null, "documentLink": null, "name": "SINT_FGDE_999999999.pdf", "mimeType": "application/pdf", "content": null }, "bondType": "DESTINATARIO", "unsuccessfulState": null, "hasAnnexes": false, "siaCode": "2997999", "siaDenomination": "NOTIFICACIONES ELECTRÓNICAS TGSS", "voucher": { "mimeType": "application/pdf", "name": "Resguardo_xxx.pdf", "enabled": true, "content": null } } }

Get a duplicate of a notification

Parameters (filters)

  • id (string) : Notification identifier (sentReference).
GET /notification-document
{ "id": "446dee88a09c99995754f4d68dc7weq3ea3c909873991" }

Response

Respuesta
{ "success": true, "message": "OK", "data": { "content": "base64", "name": "SINT_FGDE_999999999.pdf", "mimeType": "application/pdf", "contentType": "application/pdf", "privateMetadata": null } }

Get the receipt of a notification

Parameters (filters)

  • id (string) : Notification identifier (sentReference).
GET /notification-voucher
{ "id": "446dee88a09c99995754f4d68dc7weq3ea3c909873991" }

Response

Respuesta
{ "success": true, "message": "OK", "data": { "content": "base64", "name": "Resguardo_1xxbbb9x.pdf", "mimeType": "application/pdf", "contentType": "application/pdf", "enabled": true } }
Last updated on