Skip to main content

Ground Truth Entries

List, add, or delete ground truth entries with the /v1/quality/ground-truth entries endpoints. Each entry pairs a document with its verified field values.

Ground truth entries are the individual verified data points inside a ground truth dataset: each entry pairs a document_id with the expected_data a correct extraction should produce for that document. Use the entries endpoints to list, add, and delete them, building the gold standard that benchmark runs score extraction accuracy against.

The typical workflow is: extract a set of representative documents, manually verify the correct value for each schema field, then POST one entry per document. When a benchmark runs, it compares the extracted value for each field against the matching key in expected_data and reports per-field accuracy. Fetch candidate document ids from [GET /v1/documents](list-documents) — document_id must be an existing document in your workspace, not an arbitrary identifier.

expected_data is deliberately free-form JSON: any shape is accepted at write time, so you can store nested structures or extra keys for your own bookkeeping. Only keys that match your schema's field names participate in benchmark comparison; everything else is carried along untouched. notes is a free-text field for reviewer context — ambiguities, edge cases, or why a particular value was chosen — and is returned verbatim on every read.

The entries list is returned in full, oldest-first, with no pagination parameters — datasets are expected to hold tens to low hundreds of entries, not millions. Reads are filtered by document visibility: entries whose documents are hidden from your API key's minting user by source IAM rules are omitted. Writes require the write scope; the dataset itself is always tenant-checked first, so a foreign datasetId returns 404 before any entry is touched.

document_id must reference a document in your workspace that is visible to your API key's minting user. An unknown, foreign, or hidden id is rejected with 404 not_found ("Document ... not found") before anything is written — resolve ids from GET /v1/documents.
Each entry maps a document_id to an expected_data object containing the verified field values. Field keys in expected_data should match the field names used in your extraction schema for accurate benchmark comparisons.
GET/v1/quality/ground-truth/:datasetId/entries

Response (List entries)

Response fields

dataarrayArray of entry objects.
data[].idstringEntry UUID.
data[].document_idstringDocument this entry corresponds to.
data[].expected_dataobjectKey-value map of verified field values.
data[].notesstring | nullOptional notes about this entry.
data[].created_atstringISO 8601 creation timestamp.

Response

{
  "data": [
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "document_id": "doc_abc123",
      "expected_data": {
        "vendor_name": "Acme Corp",
        "total_amount": 14250.00,
        "invoice_number": "INV-2024-0847"
      },
      "notes": null,
      "created_at": "2024-09-05T12:00:00.000Z"
    }
  ]
}
POST/v1/quality/ground-truth/:datasetId/entries

Body parameters

document_id*stringDocument this entry corresponds to.
expected_data*objectKey-value map of verified field values.
notesstringOptional notes about this entry.

Request (Add entry)

curl -X POST https://api.talonic.com/v1/quality/ground-truth/a1b2c3d4-e5f6-7890-abcd-ef1234567890/entries \
  -H "Authorization: Bearer tlnc_..." \
  -H "Content-Type: application/json" \
  -d '{
    "document_id": "b8b00d51-eecc-49b3-affc-89fee95b9518",
    "expected_data": {
      "vendor_name": "Acme Corp",
      "total_amount": 14250.00,
      "invoice_number": "INV-2024-0847"
    },
    "notes": "Verified against the signed original"
  }'

Response (Add entry)

Response fields (201 Created)

idstringEntry UUID.
document_idstringDocument ID.
expected_dataobjectSaved field values.
notesstring | nullOptional notes.
created_atstringISO 8601 creation timestamp.

Response (POST entry)

{
  "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "document_id": "doc_abc123",
  "expected_data": {
    "vendor_name": "Acme Corp",
    "total_amount": 14250.00,
    "invoice_number": "INV-2024-0847"
  },
  "notes": null,
  "created_at": "2024-09-05T12:00:00.000Z"
}
DELETE/v1/quality/ground-truth/:datasetId/entries/:entryId

Response (Delete entry)

Response fields

deletedbooleanAlways true on success.

Response (DELETE entry)

{ "deleted": true }

Errors

Error responses

401unauthorizedMissing or invalid API key.
404not_foundDataset or entry not found for your workspace.
429rate_limitedToo many requests. Retry after the period indicated in the Retry-After header.

Frequently asked questions

How do I add entries in bulk?+
Call POST /v1/quality/ground-truth/:datasetId/entries once per document from a script or loop. Each call requires a document_id (UUID) and an expected_data object; there is no separate bulk-upload endpoint.
Can I add multiple entries for the same document?+
Keep one entry per document per dataset. Benchmark comparison matches entries to documents by document_id, so duplicate entries for the same document make per-document accuracy ambiguous.
What happens if expected_data field names do not match the schema?+
Every key in expected_data is scored, so a misspelled key that no extraction ever produces counts as a permanent miss and drags accuracy down. Extra fields in the extraction output that have no expected_data key are ignored. Keep expected keys aligned with schema field names.
Why does the entries list show fewer entries than I created?+
Entry reads are filtered by document visibility: if source IAM rules hide a document from the user who minted your API key, its entries are omitted from list and samples responses. Use a key minted by a user with broader source access to see the full dataset.