Skip to main content

Get Dataset

Retrieve a ground truth dataset by ID with GET /v1/quality/ground-truth/:id. Returns metadata, entry count, and every verified entry in the samples array.

GET /v1/quality/ground-truth/:id retrieves a single ground truth dataset with its metadata and all of its verified entries. The response includes a samples array with the actual ground truth entries, allowing you to inspect the expected values for each document before you benchmark extraction accuracy against them.

Use this endpoint to inspect the dataset contents before running a benchmark. The samples array contains all ground truth entries with their document_id, expected_data (key-value map of verified field values), and optional notes. This lets you verify the dataset is correctly populated.

Use samples.length — not document_count — to measure the dataset: the counter is maintained by the platform's ground-truth workflow and does not track entries added through the API, so it can read 0 while samples holds real entries. For large datasets the samples array makes the response sizable, since there is no pagination on this endpoint. The user_schema_id shows which extraction schema the dataset is scoped to, which keeps benchmark comparisons meaningful by ensuring field name alignment.

A pre-benchmark audit pays for itself: check that every expected_data object uses exactly the schema's field names (a misspelled key scores as a permanent miss), that each document_id still exists and has a completed extraction under the schema, and that numeric expected values are actual numbers where the schema types them — the comparator applies a 0.01 numeric tolerance only to numeric-typed fields.

GET/v1/quality/ground-truth/:id

Request

curl https://api.talonic.com/v1/quality/ground-truth/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  -H "Authorization: Bearer tlnc_..."

Entries in samples are returned oldest-first (created_at ascending) and are filtered by document visibility: if source IAM rules hide a document from the user who minted your API key, that document's entries are silently omitted from samples. A dataset that looks smaller through the API than in the platform UI usually indicates a restricted key rather than missing data.

Response (GET)

Response fields

idstringDataset UUID.
namestringDataset name.
descriptionstring | nullOptional description.
user_schema_idstring | nullAssociated user schema ID, if any.
document_countintegerPlatform-maintained counter. Not incremented by API-added entries — use `samples.length` for the authoritative count.
created_atstringISO 8601 creation timestamp.
links.selfstringURL to this dataset.
samplesarrayArray of ground truth entry objects (id, document_id, expected_data, notes, created_at), oldest first.

Response

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "name": "Invoice Accuracy Set",
  "description": "Manually verified invoices for Q3 2024",
  "user_schema_id": null,
  "document_count": 50,
  "created_at": "2024-09-01T10:00:00.000Z",
  "links": {
    "self": "/v1/quality/ground-truth/a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  },
  "samples": [
    {
      "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"
    }
  ]
}

Removing ground truth data

The public API does not expose a delete operation for the dataset itself. To remove outdated ground truth data, delete individual entries with DELETE /v1/quality/ground-truth/:datasetId/entries/:entryId, or create a fresh dataset with corrected entries and point new benchmark runs at it. Completed benchmark runs keep their results and their dataset_id reference either way, so historical accuracy scores stay intact.

Datasets are append-and-prune: add entries with POST, remove them with DELETE on the entries path. Keep a dataset stable while you compare benchmark runs against it, because changing entries between runs makes accuracy deltas harder to interpret.

Errors

Error responses

401unauthorizedMissing or invalid API key.
404not_foundNo dataset with this ID exists for your workspace.
429rate_limitedToo many requests. Retry after the period indicated in the Retry-After header.

Frequently asked questions

Can I delete a ground truth dataset through the API?+
No. The public API exposes GET on the dataset but no DELETE. Remove individual entries with DELETE /v1/quality/ground-truth/:datasetId/entries/:entryId, or create a new dataset and benchmark against that instead.
Does the GET response include all entries?+
Yes. The `samples` array contains all ground truth entries in the dataset. For very large datasets, this response may be sizable.
What is in the samples array?+
Each sample is one ground truth entry: its `id`, the `document_id` it evaluates, the `expected_data` map of verified field values, optional reviewer `notes`, and a `created_at` timestamp.
Why does document_count disagree with the samples array?+
document_count is maintained by the platform workflow and does not increment for entries added via the API, so it can lag or read 0. samples.length (equivalently the entries list endpoint) is the authoritative count. Benchmark runs are unaffected — they count live entries at creation.