Create Data Policy
Create a data policy: a named container for field transformation rules, lookup cascades, and normalization logic applied during resolution. Write scope.
Create a new data policy: a named, versioned container for the transformation rules and output fields that normalize your extracted values. The policy starts empty with status draft. After creation, define its output contract and transformation logic; the policy only does useful work once it has at least one field and one rule.
Choose a name descriptive enough to distinguish the policy from others in the workspace, and use the optional description to document what the policy targets: the document types it applies to and the normalization strategies it employs. Both help later when a pipeline builder picks policies for a Resolve stage. name accepts 1-255 characters and description up to 2,000; a value beyond either limit is rejected with 400 before anything is created.
Creation is atomic with versioning: the platform mints the policy row and its version 1 (status draft) in one transaction, and points the policy's current-version pointer at it. Every subsequent write resolves the editable version from that pointer, so the policy is immediately editable — in the policy editor and via imports — the moment this call returns. The version also anchors the audit trail: [List Data Policy Versions](list-data-policy-versions) starts at 1 for every policy created here.
The 201 response is the same policy header shape the list returns, including the links object: links.fields and links.rules are the read URLs for the contract you author next, and links.self accepts PATCH for metadata updates and DELETE for removal. Once authored, wire the policy into a Spec's Resolve stage — its UUID goes into the rail stage's policy_ids — or run it standalone through a resolution.
/v1/data-policiesBody parameters
Request body
{
"name": "Invoice Normalization",
"description": "Standardize currency codes, country names, and date formats"
}Response
Response fields (201 Created)
curl
curl -s -X POST https://api.talonic.com/v1/data-policies \
-H "Authorization: Bearer tlnc_your_api_key" \
-H "Content-Type: application/json" \
-d '{"name":"Invoice Normalization","description":"Standardize currency codes, country names, and date formats"}'Response (201 Created)
{
"id": "p1a2b3c4-e5f6-7890-abcd-ef1234567890",
"name": "Invoice Normalization",
"description": "Standardize currency codes, country names, and date formats",
"status": "draft",
"created_at": "2024-10-01T09:00:00.000Z",
"updated_at": "2024-10-01T09:00:00.000Z",
"links": {
"self": "/v1/data-policies/p1a2b3c4-e5f6-7890-abcd-ef1234567890",
"versions": "/v1/data-policies/p1a2b3c4-e5f6-7890-abcd-ef1234567890/versions",
"fields": "/v1/data-policies/p1a2b3c4-e5f6-7890-abcd-ef1234567890/fields",
"rules": "/v1/data-policies/p1a2b3c4-e5f6-7890-abcd-ef1234567890/rules"
}
}Errors
Error responses