Docs / API reference
Error codes
Every status code, what caused it, and the fix.
| Status | error | Cause | Fix |
|---|---|---|---|
| 400 | bad_text | Text missing, empty or over 8,000 characters. | Send a text string between 1 and 8,000 characters. Split long articles by section. |
| 400 | bad_json | The body is not valid JSON. | Check quotes and commas. Send Content-Type: application/json. |
| 401 | invalid_api_key | Key missing, mistyped, revoked, or sent in the wrong header. | Use Authorization: Bearer pij_live_.... Check for spaces. Create a new key if unsure. |
| 402 | free_limit_reached | You have used the free checks this month and billing is not on. | Wait for the 1st of the month, or ask about billing. The body shows used and limit. |
| 403 | account_suspended | The account is suspended. | Contact us through the community or pijalance.com. |
| 404 | no_such_job | Wrong job ID, or the job belongs to another account. | Use the ID returned by the same account's key. |
| 502 | check_failed | The check did not complete. It is not counted. | Try again. If it repeats, send a shorter text and quote the request_id. |
| 504 | check_failed | The API could not be reached in time. Not counted. | Retry. Use async mode. |
Error body
{ "ok": false, "error": "invalid_api_key", "message": "That API key is not valid or has been revoked." }
Always show your users the message, not the raw error.
Retry advice
- Retry 502 and 504 up to three times, waiting longer each time (5, 15, 45 seconds).
- Do not retry 400, 401, 402, 403 or 404. They will not change by themselves.