Skip to main content

List Golden Samples

List golden sample datasets with GET /v1/validation/ground-truth. Each holds verified per-field expected values that validation runs score a job run against.

This namespace is Benchmarks (the /v1/validation namespace): measuring how accurately a completed job run extracted data, by comparing its output against manually verified expected values. It is not the in-pipeline validation checks (see the Structuring API) that gate individual results before delivery — those keep the Validation name. GET /v1/validation/ground-truth lists the golden samples those accuracy measurements run against.

A golden sample (shown as Ground Truth in the platform) is a curated set of verified document-field value pairs: each entry names a document_id, a field_name, and the expected_value a correct extraction should produce. Every golden sample is bound to exactly one schema via user_schema_id — the schema whose fields the expected values describe — so a validation run always compares like with like. API payloads reference a dataset through the golden_sample_id field.

Do not confuse golden samples with the benchmark datasets under [/v1/quality/ground-truth](list-quality-datasets). Both store verified values, but a /v1/quality dataset holds one expected_data object per document and feeds repeatable benchmark runs, while a golden sample holds individual per-field expected values and scores one specific Structuring Run (a job run) via POST /v1/validation/runs.

The list returns every golden sample in your organization, newest first, in a single response — there are no pagination parameters on this endpoint. entry_count is the number of expected values stored on the sample (one per document-field pair). Golden samples are curated in the Talonic platform (Review → Benchmarks); through the public API you list them, inspect their expected values, delete them, and run benchmarks against them.

A typical integration lists datasets, picks the one matching the schema of the Structuring Run it wants to score, then passes its id as golden_sample_id to [POST /v1/validation/runs](create-validation-run). Because each dataset is schema-bound, filter client-side on user_schema_id to find the dataset that matches the run you are validating.

Golden samples are reusable. Curate a dataset once and benchmark against it repeatedly as you refine your schemas and extraction pipeline — each validation run references the dataset, it never consumes it.
GET/v1/validation/ground-truth

Request

curl https://api.talonic.com/v1/validation/ground-truth \
  -H "Authorization: Bearer tlnc_..."

Response

Response fields

dataarrayArray of golden sample dataset objects, ordered by created_at descending.
data[].idstringDataset UUID (used as `golden_sample_id` when creating validation runs).
data[].namestringDataset name.
data[].user_schema_idstringSchema this dataset is bound to. Always set — every golden sample is scoped to one schema.
data[].entry_countnullReserved. Currently always null through the public API — count entries via the values array on the detail endpoint.
data[].created_atstringISO 8601 creation timestamp.
data[].updated_atstringISO 8601 last update timestamp.
data[].linksobjectRelated resource URLs (self).

Response

{
  "data": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "Invoice Validation Set",
      "user_schema_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "entry_count": null,
      "created_at": "2024-08-01T00:00:00.000Z",
      "updated_at": "2024-08-01T00:00:00.000Z",
      "links": {
        "self": "/v1/validation/ground-truth/a1b2c3d4-e5f6-7890-abcd-ef1234567890"
      }
    }
  ]
}

Errors

Error responses

401unauthorizedMissing or invalid API key.
429rate_limitedToo many requests. Retry after the period indicated in the Retry-After header.

Frequently asked questions

Can I create golden samples through the public API?+
No. Golden samples are curated in the Talonic platform, where reviewers record the verified expected value per document and field. The public API lists, inspects, and deletes datasets and runs benchmarks against them.
Can a golden sample exist without a schema?+
No. Every golden sample is bound to exactly one schema via user_schema_id — the field is non-nullable — so validation runs always compare extraction output against expected values defined for the same schema fields.
How many entries should a golden sample have?+
There is no minimum or maximum. For statistically meaningful accuracy results, aim for at least 20-30 document-field pairs covering the fields you care about most.
How is this different from /v1/quality ground truth?+
A /v1/quality dataset stores one expected_data object per document and drives repeatable benchmark runs with per-field accuracy scores. A golden sample stores individual per-field expected values and scores one specific job run through /v1/validation/runs.