Skip to content

DSN API: errors, limits and quotas

A technical error always returns the same object, with a stable code. The anomalies of a DSN are not errors: they are in the report, with a 200 response.

The error object has three fields: code, message and request_id. The message is text in French, which may state the configured limits; it never repeats a value from your request, a file name, a server path or an internal detail. Only the code field is stable for a program. The request_id is generated by the server. With the status, it is all that its logs keep of the exchange: quote it to support.

Error codes
Code
demande_invalide
400409415
The request does not match the required format or batch state; correct it before sending it again.
authentification
401
The Authorization header is absent, the token is rejected or the key is inactive; check your authentication before calling again.
exemple_requis
403
A test key accepts only exact copies of published files, attachments included; use a published example.
interrompu
408
Processing was interrupted.
idempotence_conflit
409
The same idempotency key was used with different content; use that key only for the original submission.
deja_en_cours
409
The same submission is already being processed under this idempotency key; wait for it to finish before calling again.
taille
411413
The required size is missing or exceeds a limit; supply the exact size or reduce the submission before retrying.
options_incompatibles
422
The requested options are incompatible; correct their combination before resubmitting the request.
annexe_invalide
422
An attachment is invalid or could not be fully read; correct it before resubmitting the request.
norme_non_embarquee
422
The requested standard is not included in the software.
option_non_disponible—The requested option is not available.
sature
429
The service is temporarily at capacity; retry after the delay specified by Retry-After.
releve_usage_indisponible
503
Usage reporting is unavailable; do not retry automatically, as the service requires intervention and no Retry-After is provided.
quota_depasse
429
A quota or spending cap has been exceeded; honour Retry-After when present, otherwise check your quotas and spending cap before retrying.
introuvable
404
The requested object cannot be found; check its identifier.
rapport_recupere
410
The batch result has already been retrieved and can only be read once; use your saved copy.
rapport_trop_grand
413
The report exceeds the accepted size; reduce the request before retrying, as no truncated result is delivered or billed.
deja_traite—The request has already been processed.
interne
500
An internal error occurred.
trop_grand_pour_l_instance
413
The request exceeds the instance’s capacity even when idle; this rejection is permanent for this request, so do not retry it unchanged.
memoire_insuffisante
422503
Processing was stopped due to insufficient memory, with no usage counted: 503 for a direct call, 422 when reading a batch result; another attempt is possible.
instance_incorrecte
421
Keep the affinity cookie between the submission and the reads: the report is in the memory of the instance that produced it. Any batch operation that reaches another instance receives 421 instance_incorrecte, with no redirect or Retry-After. Affinity reduces these wrong arrivals without ruling them out.
indisponible
503
The service is unavailable; wait for service to be restored before resuming your calls.
plan_controle_invalide
503
On a Dedicated instance, check metering returned an invalid response; the check does not complete.
plan_controle_indisponible
503
The control plane is unavailable, when authorising a key on its first use or, on a Dedicated instance, when metering checks; the check does not complete: wait for it to be restored before resuming your calls.
operation_non_autorisee
403
The requested operation is not authorised.
A dash: the contract publishes no HTTP status for this code.

All the error codes and their statuses, in the API reference

Service capacity. Each workspace has 3,600 operations per hour, and at most 4 at the same time, on Cloud as on a Dedicated instance: every function draws on them, except the simple check of a DSN file and its batches. Each API key can send 120 calls per UTC minute, as many as its workspace. The workspace protection can also refuse a request beyond 120 calls per sliding minute, 20 per second and 10,000 per day, and, for each key, beyond 60 per minute and 10 per second. A refusal is a 429 response, with the delay to wait in the Retry-After header; it is never billed.

The functions that draw on this budget: check with supporting documents, comparison of two versions, payroll, gender equality, HR statements, accounting reconciliation, direct debits, official returns, substitution, extraction, splitting, pseudonymisation and corrections.

Retrying after a 429 response:

  • A 429 means a quota is reached or capacity is saturated. This refusal adds no billable unit.
  • sature: temporary saturation. The response carries Retry-After with the value 2: wait 2 seconds, then try again.
  • quota_depasse: call limit, operations budget, spending cap or individuals cap of a Dedicated instance. For a limit, Retry-After gives in seconds the delay before the next attempt; it is absent for these two caps.
  • Retry-After never accompanies a 409 conflict.
  • DSNLint Connect never retries a submission on its own: the decision to send again is yours.
  • Even an authenticated refusal uses up the request quota.
  • Each format requested is a separate call, counted in the call quotas. It adds nothing to billing.

The limits of a submission:

  • A file is one DSN submission in the sense of Net-entreprises: one monthly DSN, which may cover several establishments.
  • Maximum size: 128 MiB (134,217,728 bytes) and 5,000,000 lines per file, which is of the order of 50,000 declared individuals. Beyond that, the file is refused with a clear message: send one file per establishment. For a readable document (PDF, Excel, CSV for Excel), a very large DSN can be refused for lack of memory: ask for JSON or machine CSV instead.
  • Immediate response: 120 seconds at most per exchange; the report is streamed, even a very large one.
  • Deferred response (on request): the report is kept in memory for 300 seconds and can be read once only; 2 MiB per report by default.
  • Batches: from 1 to 32 files.

The other limits, by default:

  • Limit
    Uncompressed bytes, cumulative
    Default value
    128 MiB
  • Limit
    DSN lines, cumulative
    Default value
    5,000,000
  • Limit
    Archive members
    Default value
    4,096
  • Limit
    Supporting documents per request
    Default value
    512
  • Limit
    Request manifest
    Default value
    1 MiB

A size overrun is refused with a 413, an exchange that takes too long is interrupted with a 408: no document is truncated and nothing is counted. The values in the table are default values; an instance can configure them. The limits specific to each function come on top of these ceilings.

Each submission carries an Idempotency-Key header: an opaque value of 1 to 128 characters (ASCII letters, digits, hyphen or underscore). The --idempotence option of DSNLint Connect sets the UUID of the submission: format=UUID for the simple check (for example json=UUID), UUID alone for a function with supporting documents or a single submission to a batch, always a version 4 UUID. The same submission, replayed with the same key, is neither processed nor billed twice:

  • Same key, same bytes, same options, submission finished: 204, with no document. Keep your first response: DSNLint keeps no copy of it.
  • Same key while the submission is in progress: 409, deja_en_cours. Same key with other bytes or other options: 409, idempotence_conflit.
  • The idempotency record lasts 900 seconds at most and is scoped to your workspace and your test or production mode; it may be lost earlier, rarely, for example during a service update. A failure before any result removes it: you can try again with the same key.
  • A replay still involves receiving the body and calculating its fingerprint. It uses network capacity but requires no new computation and adds nothing to the billing count.
  • If you have lost the response, a new submission with a new key recomputes the document. Billing does not change: the month’s maxima are already known.

DSNLint Connect keeps the exit code of the simple check and the one the API returns for the other functions. Its error messages are fixed and in French: they never repeat data from your files nor a technical server message. For functions with supporting documents, the table below gives the business exit codes accepted with a complete document; it does not list the call errors of DSNLint Connect: 2 for usage or configuration, 3 for a technical error.

  • Function
    Check with supporting documents
    Codes returned with a document
    0, 1, 2, 3, 10
  • Function
    Official returns
    Codes returned with a document
    0, 10
  • Function
    Substitution, gender equality, HR documents, extraction, splitting, pseudonymisation
    Codes returned with a document
    0
  • Function
    Payroll, accounting, direct debits, correction
    Codes returned with a document
    0, 2
  • Simple check: 0 with no blocking anomaly, 1 with blocking anomalies, 2 for a usage error, 3 for a technical error.
  • The other functions keep the business code supplied by the API in the X-DSN-Code-Sortie header.
  • Code 2 indicates a blocking check with supporting documents (1 for a warning under strict) or a result for payroll, accounting, direct debits or incomplete corrections. With a complete document, it is a business result; without a document, it can signal a usage error.
  • Code 10 indicates that some official returns were not read or were only partly read.
  • The MCP server returns this code in code_sortie and signals a call error with isError. A batch’s counters never constitute a DSN verdict.
Submit DSN checks in batches
Previous section
DSN billing: the declared individual
Next section