Skip to main content
PUT
Rate limit tier: general, 600 requests/min. See Rate limits. Creates or replaces the ground truth of one dataset document packet, the expected values an eval grades the document against. The first write answers 201, a replace answers 200, and both return the stored document in the shape Get ground truth returns. Send the complete document in ground_truth: every field of the workflow must be present. A list field may be [] and any value may be null. Keys are the workflow schema’s field identifiers: use persistent_id (the API also accepts sanitized_name). The stored document is always keyed by persistent_id. A scalar field maps to string | null; a table or object field maps to an array of row objects keyed the same way. Omit version_id to write to the workflow’s current version, the one an eval grades by default. node_id is the extract node’s id in the workflow graph, required only when the version has more than one extract node. Only a dataset document packet holds ground truth. A production packet answers 409 NOT_IN_DATASET: upload the document to the dataset and set ground truth on the packet it returns.

Errors

Authorizations

Authorization
string
header
required

API key issued from app.anyformat.ai/api-key. Send as Authorization: Bearer <key>.

Path Parameters

document_packet_id
string
required

Body

application/json

Body for PUT /v3/document-packets/{document_packet_id}/ground-truth/.

ground_truth
Ground Truth · object
required

The complete expected document. Keys are the workflow schema's field identifiers: advertise persistent_id (the API also accepts sanitized_name). A scalar field maps to string | null; a table or object field maps to an array of row objects. Every field must be present; a list field may be [].

Example:
version_id
string | null

A version_id from GET /v3/workflows/{workflow_id}/versions/. Omit it for the workflow's current version, the one an eval grades by default.

Example:

"FGaV4I2JAA"

node_id
string | null

The extract node's id in the workflow graph, as GET /v3/workflows/{workflow_id}/ returns it. Required only when the version has more than one extract node.

Example:

"extract_1"

Response

Successful Response

A document packet's stored ground truth and the (version, node) it belongs to.

ground_truth
Ground Truth · object | null
required

The expected document, keyed by the workflow's field persistent_ids. A scalar field maps to string | null; a table or object field maps to an array of row objects keyed the same way. null until ground truth is first set for this version and node.

Example:
version_id
string
required

The workflow version the ground truth belongs to.

Example:

"FGaV4I2JAA"

node_id
string
required

The extract node's id in the workflow graph.

Example:

"extract_1"