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.

The document_count field shows how many entries exist. For large datasets, the samples array may produce a sizable response. The user_schema_id shows which extraction schema the dataset is scoped to, which keeps benchmark comparisons meaningful by ensuring field name alignment.

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

Response (GET)

Response fields

idstringDataset UUID.
namestringDataset name.
descriptionstring | nullOptional description.
user_schema_idstring | nullAssociated user schema ID, if any.
document_countintegerNumber of entries in the dataset.
created_atstringISO 8601 creation timestamp.
links.selfstringURL to this dataset.
samplesarrayArray of ground truth entry objects (id, document_id, expected_data, notes, created_at).

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.