Output and reference
Handle errors
An API error prints one line with the status, then the error type and code in brackets as [type/code] (only the parts Drex sent), the message and the request_id. Below it come up to five fields that failed validation, from the error's issues or detail.errors, then (+N more):
error: 422 [invalid_request_error/invalid_request] The request does not match the schema for this method. See detail.errors for the fields that failed. (req_...)
- output.formats.0: Input should be 'markdown', 'text' or 'blocks'Some errors add a line on what to do next:
- A
402addsTop up or add a card at <your Drex host>/dashboard/billing, orPay the unpaid invoice at <your Drex host>/dashboard/billingwhen its type ispayment_required. - A
409 path_conflictadds how to upload anyway. - A
503 job_pendingaddsRerun the same command with --idempotency-key <key> to resume it, naming the key the run sent. 404 workspace_not_found,409 session_busy,429 rate_limitedand403 access_deniedadd what to do next.
The error types are in Errors.
On the document commands
Exits 1: the request or the job failed.
| What happened | What you see |
|---|---|
| The document service refused the request, such as for an unsupported file type or an unknown field | error: 422 [invalid_request_error/<code>] ..., then up to five fields from the error's detail.errors. See Errors. |
| A different file is already at the upload path | 409 path_conflict, then how to upload anyway: another --upload-path (--path on nace upload), or --on-conflict new_version. From 32 MiB: error: Upload did not finish: ... (path_conflict: ...). |
The same --idempotency-key with a different document-tool body | 409 idempotency_conflict. For workspace jobs, reuse a key only for identical inputs; changed inputs may replay an earlier job or be rejected with a different error code. |
| The job isn't confirmed yet | 503 [service_unavailable/job_pending], then Rerun the same command with --idempotency-key <key> to resume it. The job may be running and billed: the same key and body return it. |
| No available funds: the balance isn't positive, and no card pays for usage beyond it | 402 [insufficient_credit], then Top up or add a card at <your Drex host>/dashboard/billing. |
| The account has an unpaid invoice | 402 [payment_required], then Pay the unpaid invoice at <your Drex host>/dashboard/billing. |
| A job you waited for failed or was cancelled | error: [<code>] job <id> <status>: <message>. |
The wait ran past --wait-timeout | error: job <id> still <status> after <N>s; read it later with ... on stderr, and the job id on stdout (the whole job with -o json). The job keeps running. |
Content is still being prepared after --wait-timeout, or couldn't be prepared | An error naming the job and path, or 409. |
Exits 2: nace refused the input before any request. Stderr shows error: ..., and stdout stays empty. For example:
- An
http://or missingSOURCE, or--file-namewithout anhttps://SOURCE. - A
job:SOURCEonclassify, or with-ponparseorextract, or with--mode medium,--mode highor--password. - Both or neither of
-sand--schema-id. - A
--limitout of range. - A workspace command with no workspace to use, when the account doesn't have exactly one. Listing them is its only request.