PerceptionDocs

Parse a document

Converts a document to Markdown, text or layout blocks.

POST
/v1/documents/parse
  • Body: the document service's request for this operation. Parse lists its options and result.
  • source: a url, a parse_result of one of your own jobs, or a workspace_file in your own workspace. Upload one with POST /v1/documents/upload-grants.
  • Billing: admitted only while the account's balance is positive. The job's final credits are charged once, when it finishes.
  • Retries: the same Idempotency-Key with the same body returns the same job. With a different body, it answers 409.

Other errors (413, 500, 502, 503, 504, 529) are on Errors.

Authorization

bearerAuth
AuthorizationBearer <token>

Your API key from the dashboard's API Keys page: nace_sk_ followed by 43 URL-safe characters (A-Z, a-z, 0-9, _ and -), shown once when you create it. Send it as Authorization: Bearer nace_sk_... Any other value returns 401 authentication_error. An account can hold at most 3 active keys.

In: header

Query Parameters

wait_seconds?integer

Hold the request open until the job finishes, up to this many seconds (at most 60). 0 (default) returns at once.

Range0 <= value <= 60

Header Parameters

Idempotency-Key?string

Up to 200 characters, unique per account. Retry with the same key and body to get the same job instead of a second one.

Lengthlength <= 200

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/documents/parse" \  -H "Content-Type: application/json" \  -d '{    "source": {}  }'
{  "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",  "kind": "parse",  "status": "queued",  "result": null,  "credits": 0,  "usage_final": true}