---
title: "Test a Spec on samples"
method: POST
path: "/v1/specs/{id}/test"
tags: ["Specs"]
---

# Test a Spec on samples

`POST /v1/specs/{id}/test`

## Request

- Base URL: `https://api.talonic.com`
- URL: `https://api.talonic.com/v1/specs/{id}/test`
- Auth: HTTP bearer

Runs the draft on `document_ids`, or on the pinned samples when you
send none, as a preview: preview runs are never delivered to your
destinations. A draft with unpublished changes is published first,
exactly as when you test in the Spec editor, so a draft with errors
is refused (422). Uses credits like any run.

Poll `links.progress`, then read rows with their evidence from
`GET /v1/pipelines/{pipeline_id}/results?include=provenance`.
Requires `specs:write` and `runs:write`, and the workspace Admin role.

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `document_ids` string[]
  - `acknowledge_issues` boolean

## Response `201`

The preview run started.

- object
  - `spec_id` string, uuid
  - `pipeline_id` string, uuid
  - `version` integer
  - `schema_id` string, uuid
  - `status` 'processing'
  - `document_count` integer
  - `issues` object[]
  - `links` object
    - `pipeline` string
    - `progress` string
    - `results` string

## Other responses

- `401`: Missing or invalid API key.
- `402`: Not enough credits.
- `403`: The API key does not have the required scope.
- `404`: The requested resource was not found.
- `422`: Nothing to test on

## Changes

- **2026-11-26** `622d429de7ea`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/talonic/apis/talonic-api/changes/v1/specs/:id/test/post.md)

---

[API](https://skmtc.dev/talonic/apis/talonic-api.md) - [All operations](https://skmtc.dev/talonic/apis/talonic-api/llms.txt) - [OpenAPI document](https://skmtc.dev/talonic/apis/talonic-api/revisions/9f6d53e2ab5e?raw)
