Skip to main content

Data Policies Endpoint Reference

Reference for 4 Data Policies endpoints of the Talonic API: parameters, request body, curl and Node.js examples, response and errors.

Versioned normalization policies (fields + rules) applied by resolution runs.

Every request needs an API key in the Authorization: Bearer header. Examples read the key from the TALONIC_API_KEY environment variable.

POST/v1/data-policies/{id}/compile

Required scope: specs:write

Path parameters

id*string (uuid)

curl

curl -X POST 'https://api.talonic.com/v1/data-policies/3fa85f64-5717-4562-b3fc-2c963f66afa6/compile' \
  -H "Authorization: Bearer $TALONIC_API_KEY"

Node.js (18+)

const res = await fetch("https://api.talonic.com/v1/data-policies/3fa85f64-5717-4562-b3fc-2c963f66afa6/compile", {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
  },
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const data = await res.json();

Response 200 — OK

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "compiled",
  "rule_count": 1
}
  • 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.
POST/v1/data-policies/{id}/test

Required scope: specs:write

Path parameters

id*string (uuid)

Request body (application/json)

record_set_id*string (uuid)
sample_record_idstringThe record to show; the first one when absent.

curl

curl -X POST 'https://api.talonic.com/v1/data-policies/3fa85f64-5717-4562-b3fc-2c963f66afa6/test' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "record_set_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "sample_record_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}'

Node.js (18+)

const res = await fetch("https://api.talonic.com/v1/data-policies/3fa85f64-5717-4562-b3fc-2c963f66afa6/test", {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "record_set_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "sample_record_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  }),
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const data = await res.json();

Response 200 — OK

{
  "ok": true,
  "sample": {},
  "total_records": 1,
  "error": null
}
  • 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.
POST/v1/data-policies/{id}/publish

Required scope: specs:write

Path parameters

id*string (uuid)

Request body (application/json)

expected_versioninteger

curl

curl -X POST 'https://api.talonic.com/v1/data-policies/3fa85f64-5717-4562-b3fc-2c963f66afa6/publish' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "expected_version": 1
}'

Node.js (18+)

const res = await fetch("https://api.talonic.com/v1/data-policies/3fa85f64-5717-4562-b3fc-2c963f66afa6/publish", {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "expected_version": 1
  }),
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const data = await res.json();

Response 200 — OK

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "published",
  "version_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "version": 1
}
  • 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.
  • 409 — The request conflicts with the current resource state.
  • 429 — Daily rate limit exceeded.
POST/v1/data-policies/{id}/runs

Required scope: runs:write

Path parameters

id*string (uuid)

Request body (application/json)

source_run_id*string (uuid)
user_schema_idstring (uuid)Write against another schema than the source run's.

curl

curl -X POST 'https://api.talonic.com/v1/data-policies/3fa85f64-5717-4562-b3fc-2c963f66afa6/runs' \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "source_run_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "user_schema_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}'

Node.js (18+)

const res = await fetch("https://api.talonic.com/v1/data-policies/3fa85f64-5717-4562-b3fc-2c963f66afa6/runs", {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "source_run_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "user_schema_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  }),
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const data = await res.json();

Response 202 — The started run (resolution run shape) plus `data_policy_id` and `data_policy_version_id`.

{}
  • 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.
  • 409 — The request conflicts with the current resource state.
  • 429 — Daily rate limit exceeded.