Documents

Ground claims

Finds where each of your claims or targets appears in a document.

  • Body: the document service's request for this operation. Ground lists its options and result.
  • source: a url, a parse_result of one of your own jobs, or a workspace_file you uploaded. Upload one with POST /v1/documents/upload-grants.
  • Billing: admitted only with reserved free/prepaid credit or explicitly enabled pay-as-you-go. Execution stops at its funded limit. Final credits are charged once after successful completion. A job that fails or is cancelled before completion is not charged.
  • Retries: the same Idempotency-Key with the same body returns the same job. With a different body, it answers 409.
post/v1/documents/ground

Request

Query parameters

wait_secondsinteger

Hold the request open until the job finishes, up to this many seconds. 0 (default) returns at once; a value above 60 waits 60.

Headers

Idempotency-Keystring

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

Request body

namestring nullable

Optional display name for the run.

project_idstring uuid nullable

Caller-minted grouping id; jobs submitted together share it. Not a server-side resource.

sourceobject required

One of three kinds:

  • A URL: {"type":"url","url":"https://...","file_name":"a.pdf"}
  • A parse of one of your jobs: {"type":"parse_result","job_id":"..."}
  • A workspace file: {"type":"workspace_file","workspace_id":"...","file_id":"..."}

Response

The job finished within wait_seconds, or this is a replay of its Idempotency-Key.

job_idstring uuid required
kind'parse' | 'split' | 'classify' | 'extract' | 'ground' required
status'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled' required
resultunknown
creditsinteger nullable

Credits the job used; final once usage_final is true. Drex charges the job's final billable usage once, at the USD price pinned when it was admitted (see Models & pricing). credits is the document service's usage count, not a multiplier for the per-page or per-target price. A failed job is never charged, including when it produced partial results. A job cancelled before completion is not charged, including delivered parts.

usage_finalboolean

Changes

No recorded changes to this operation across all 1 revision of this API.