Skip to main content

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.

POST/v1/data-policies

Body parameters

name*stringHuman-readable policy name.
descriptionstringOptional description of the policy purpose.

Request body

{
  "name": "Invoice Normalization",
  "description": "Standardize currency codes, country names, and date formats"
}

Response

Response fields (201 Created)

idstringData policy UUID.
namestringPolicy name.
descriptionstring | nullPolicy description.
statusstringInitial policy status: draft.
created_atstringISO 8601 creation timestamp.
updated_atstringISO 8601 last update timestamp.
linksobjectURLs to the policy and its subresources (self, versions, fields, rules).

curl

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

400bad_requestInvalid request body or missing required fields.
401unauthorizedMissing or invalid API key.
429rate_limitedToo many requests. Retry after the period indicated in the Retry-After header.
A freshly created policy has no fields or rules yet. It resolves nothing until its output contract and transformation logic are defined; the fields and rules read endpoints let you verify the configuration at any time.