Errors
What each docsgen status code means, what to do about it, and how errors come back as JSON that says what is missing.
When something goes wrong
| Code | What happened | What to do |
|---|---|---|
401 |
The authorization header is missing |
Something along the way swallowed it: a proxy, or an HTTP client that doesn’t forward it after a redirect |
401 |
Unknown key | The key doesn’t exist or was revoked |
400 |
The type doesn’t exist | The response includes the list of available types |
400 |
data is missing, or the body is not JSON |
Check the request body |
400 |
Required data for the type is missing (payslip, report and inventory movements) | faltan says which |
400 |
cifrar was requested on something that is not a payslip, the payslip lacks tipoDocumento (CC or NIT) and numeroDocumento, or cifrar is not a boolean |
error says what failed; see Password-protected payslips |
405 |
It is not a POST |
— |
500 |
The document could not be composed | Almost always an unsupported tag in a contract. The response includes an 8-character referencia: quote it when you contact us and we will find the case without you sending us the body |
503 |
The key could not be verified, or the service has no keys configured | This is on us, not your request; let us know, quoting the referencia if the response includes it |
Errors come as JSON
Errors come back as JSON and say what is missing: the message in error, the list of missing fields in faltan when required data is absent, and a referencia when the document could not be composed. This is deliberate: you have to be able to fix it without calling us or waiting for someone to look at a log.
A plantilla that doesn’t exist responds 400 with the list of the ones that do, so you don’t have to go looking for it elsewhere.
