---
title: "Preview a data policy"
method: POST
path: "/v1/data-policies/{id}/test"
tags: ["Data Policies"]
---

# Preview a data policy

`POST /v1/data-policies/{id}/test`

## Request

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

Previews the latest version on one record set without writing anything: one sample record as the policy would leave it, and how many records the set holds. A rule that fails on the record answers 200 with `ok: false` and the error, so an editor can show it inline. Answers 504 when the preview does not finish within 5 seconds (retry). Requires `specs:write`. The person behind the key must be an Admin of the workspace, and the workspace must manage its own configuration; otherwise the answer is 403 `insufficient_role`.

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `record_set_id` string, uuid, required
  - `sample_record_id` string: The record to show; the first one when absent.

## Response `200`

OK

- object
  - `ok` boolean
  - `sample` object
  - `total_records` integer
  - `error` unknown

## Other responses

- `400`: The request is invalid.
- `401`: Missing or invalid API key.
- `403`: The API key does not have the required scope.
- `404`: The requested resource was not found.
- `429`: Daily rate limit exceeded.

## Changes

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

[Operation history](https://skmtc.dev/talonic/apis/talonic-api/changes/v1/data-policies/: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)
