Errors and limits
Every error has one JSON shape with the HTTP status as its code, and each key works within fixed limits.
The shape
{ "error": "what went wrong, in a sentence" }
An error from run a workflow after the case exists adds applicationId, so you continue with that case instead of sending the packet again. The red-flag refusal also adds flags.
Statuses
| Status | Meaning |
|---|---|
| 400 | The request is malformed: a missing field, a wrong multipart field name, a file that is not a PDF, an image or a text file, a PDF that needs a password to open, a text file over 10 MB, or more files than a call takes. |
| 401 | No key, or a wrong or revoked one. |
| 403 | Not something a key, or your role, may do. Also: a run was asked of an organization that has no email yet — a Manager adds one in the app first. |
| 404 | Not there, or not in your organization. |
| 409 | A conflict with the state of the case: a workflow already active ("Parse → Classify workflow active"), a draft workflow, red flags at the gate, nothing new to read, a document in edit, a fourth Priority document, or archiving part of a matched document. |
| 413 | A file is over the size limit. |
| 429 | Too many requests. Retry-After says how many seconds to wait. |
| 502 | The analyzer could not be reached. The case was put back as it was. |
Limits
| Limit | Value |
|---|---|
| Requests per key | 500 a minute |
| Requests per guest key | 10 a minute |
| Guest sandboxes | 3 a day in all |
| Research questions in a workspace without an email | 20 an hour, 50 a day |
| Briefs in a workspace without an email | 5 an hour, 10 a day |
| Pages a workspace without an email holds | 50 (a text file counts its pages) |
| Files per call | 100, of any type |
| File size | 100 MB |
| Text file size | 10 MB, in pages of about 2,000 tokens, estimated as characters ÷ 2.8 + 20 a line |
| File type when running a workflow | PDF, image (jpg, png) or text file (HTML, markdown, plain text) |
Doing the same thing twice
Run a workflow is not idempotent: every successful call without an applicationId creates a new case. If a call fails after the case is made, the error carries applicationId. Continue with that case; do not send the packet again.
Sheaf