Skip to main content
POST
/
v1
/
policies
Create policy
curl --request POST \
  --url https://api.truthlocks.com/v1/policies \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "name": "<string>",
  "rules": {
    "rules": [
      {
        "id": "<string>",
        "description": "<string>",
        "conditions": [
          {}
        ]
      }
    ]
  },
  "description": "<string>",
  "language": "json_rules"
}
'
{
  "id": "<string>",
  "name": "<string>",
  "category": "<string>",
  "status": "<string>",
  "version": 123,
  "created_at": "<string>"
}
Creates a policy for the authenticated tenant. Set status to DRAFT to save without enforcing, or ACTIVE to begin enforcement immediately. Each policy contains a set of rules evaluated in order. The first matching rule determines the outcome. If no rule matches, the default_effect applies.
See the issuance policies guide for a walkthrough of rule syntax, condition operators, and lifecycle management.

Parameters

name
string
required
A human-readable name for the policy (e.g., “US Issuers Only”).
category
string
required
The action this policy applies to: MINT, VERIFY, or BUNDLE_EXPORT.
status
string
required
Initial status: DRAFT, ACTIVE, or DISABLED. Only ACTIVE policies are enforced.
description
string
Optional description explaining the policy’s purpose.
language
string
Rule language. Use json_rules for the built-in JSON rules engine.
rules
object
required
The rule set containing an array of rules and a default_effect.

Responses

Authorizations

X-API-Key
string
header
required

API key for machine-to-machine authentication

Body

application/json
name
string
required
category
enum<string>
required
Available options:
MINT,
VERIFY,
BUNDLE_EXPORT
status
enum<string>
required
Available options:
DRAFT,
ACTIVE,
DISABLED
rules
object
required

Rule set with rules array and default_effect

description
string
language
string
default:json_rules

Response

Policy created

id
string
name
string
category
string
status
string
version
integer
created_at
string