Download OpenAPI specification:Download
REST API for managing dynamic policies in AxonFlow.
Policies define conditions and actions for request processing, enabling:
The Agent (port 8080) is the single entry point for all client traffic
(ADR-026). Clients authenticate at the Agent with HTTP Basic auth
(clientId:clientSecret); the Agent proxies policy requests to the
Orchestrator and stamps the X-Tenant-ID header from the authenticated
client's tenant. When calling the Orchestrator directly (internal
deployments only), supply X-Tenant-ID yourself. X-User-ID is optional
and used for audit attribution.
Note: /api/v1/templates* is NOT proxied by the Agent — the template
endpoints are reachable only on the Orchestrator directly (or via the
customer portal catch-all).
Policies are isolated per tenant. Each API call operates only on policies belonging to the authenticated tenant.
/api/v1/static-policies*) is served
by the Agent and specified in agent-api.yaml.A terminology migration renaming static→system and dynamic→tenant policy endpoints is planned (#1431). No alias routes exist yet; the paths below are current.
Dynamic policy CRUD via the ADR-026 /api/v1/dynamic-policies surface
(Orchestrator, proxied by the Agent). Accepts only policies whose
category starts with dynamic- or media-.
Retrieve a paginated list of dynamic policies. Only policies whose
category starts with dynamic- or media- are returned. When
type=media is passed without a category, results are filtered to
media-* categories.
limit is the preferred pagination parameter; page_size is
deprecated but still accepted.
| type | string (PolicyType) Enum: "content" "user" "risk" "cost" "context_aware" "media" "rate-limit" "budget" "time-access" "role-access" "mcp" "connector" Filter by policy type |
| category | string Filter by category. Must start with |
| enabled | boolean Filter by enabled status |
| search | string <= 100 characters Search in policy name and description |
| page | integer >= 1 Default: 1 Page number (1-indexed) |
| limit | integer [ 1 .. 100 ] Default: 20 Items per page (preferred over the deprecated page_size) |
| page_size | integer [ 1 .. 100 ] Deprecated Items per page (deprecated — use limit instead) |
| sort_by | string Default: "created_at" Enum: "name" "created_at" "updated_at" "priority" Sort field |
| sort_dir | string Default: "desc" Enum: "asc" "desc" Sort direction |
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
{- "policies": [
- {
- "id": "pol_abc123def456",
- "name": "Block PII Access",
- "description": "Prevent unauthorized access to personally identifiable information",
- "type": "content",
- "category": "dynamic-risk",
- "tier": "system",
- "conditions": [
- {
- "field": "query",
- "operator": "equals",
- "value": "string"
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Request blocked by policy",
- "channel": "security-alerts"
}
}
], - "priority": 0,
- "enabled": true,
- "version": 1,
- "tenant_id": "string",
- "organization_id": "string",
- "tags": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by": "string",
- "updated_by": "string",
- "deleted_at": "2019-08-24T14:15:22Z"
}
], - "pagination": {
- "page": 1,
- "page_size": 20,
- "total_items": 45,
- "total_pages": 3
}
}Create a new dynamic policy. category is required and must start
with dynamic- or media- (e.g., dynamic-risk, media-safety).
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
| X-User-ID |
| name required | string [ 3 .. 100 ] characters |
| description | string <= 500 characters |
| type required | string (PolicyType) Enum: "content" "user" "risk" "cost" "context_aware" "media" "rate-limit" "budget" "time-access" "role-access" "mcp" "connector" Policy type determines evaluation context:
|
| category | string Policy category (dynamic-risk, dynamic-compliance, media-safety, etc.).
Required on the /api/v1/dynamic-policies surface, where it must
start with |
| tier | string Enum: "organization" "tenant" Policy tier. Only organization or tenant is allowed via the API. |
required | Array of objects (PolicyCondition) non-empty |
required | Array of objects (PolicyAction) non-empty |
| priority | integer [ 0 .. 1000 ] Default: 0 |
| enabled | boolean Default: true |
| tags | Array of strings Tags for categorization |
{- "name": "string",
- "description": "string",
- "type": "content",
- "category": "string",
- "tier": "organization",
- "conditions": [
- {
- "field": "query",
- "operator": "equals",
- "value": "string"
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Request blocked by policy",
- "channel": "security-alerts"
}
}
], - "priority": 0,
- "enabled": true,
- "tags": [
- "string"
]
}{- "policy": {
- "id": "pol_abc123def456",
- "name": "Block PII Access",
- "description": "Prevent unauthorized access to personally identifiable information",
- "type": "content",
- "category": "dynamic-risk",
- "tier": "system",
- "conditions": [
- {
- "field": "query",
- "operator": "equals",
- "value": "string"
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Request blocked by policy",
- "channel": "security-alerts"
}
}
], - "priority": 0,
- "enabled": true,
- "version": 1,
- "tenant_id": "string",
- "organization_id": "string",
- "tags": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by": "string",
- "updated_by": "string",
- "deleted_at": "2019-08-24T14:15:22Z"
}
}Bulk import dynamic policies from JSON. Supports up to 100 policies
per request. Every policy must have a category starting with
dynamic- or media-.
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
| X-User-ID |
required | Array of objects (CreatePolicyRequest) [ 1 .. 100 ] items |
| overwrite_mode | string Default: "skip" Enum: "skip" "overwrite" "error" How to handle existing policies |
{- "policies": [
- {
- "name": "string",
- "description": "string",
- "type": "content",
- "category": "string",
- "tier": "organization",
- "conditions": [
- {
- "field": "query",
- "operator": "equals",
- "value": "string"
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Request blocked by policy",
- "channel": "security-alerts"
}
}
], - "priority": 0,
- "enabled": true,
- "tags": [
- "string"
]
}
], - "overwrite_mode": "skip"
}{- "created": 0,
- "updated": 0,
- "skipped": 0,
- "errors": [
- "string"
]
}Export the tenant's dynamic policies as JSON. Only policies with a
dynamic-* or media-* category are included.
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
{- "policies": [
- {
- "id": "pol_abc123def456",
- "name": "Block PII Access",
- "description": "Prevent unauthorized access to personally identifiable information",
- "type": "content",
- "category": "dynamic-risk",
- "tier": "system",
- "conditions": [
- {
- "field": "query",
- "operator": "equals",
- "value": "string"
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Request blocked by policy",
- "channel": "security-alerts"
}
}
], - "priority": 0,
- "enabled": true,
- "version": 1,
- "tenant_id": "string",
- "organization_id": "string",
- "tags": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by": "string",
- "updated_by": "string",
- "deleted_at": "2019-08-24T14:15:22Z"
}
], - "exported_at": "2019-08-24T14:15:22Z",
- "tenant_id": "string"
}Returns the enabled dynamic policies for the tenant (both dynamic-*
and media-* categories), sorted by priority ascending. Returns up to
100 policies.
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
{- "policies": [
- {
- "id": "pol_abc123def456",
- "name": "Block PII Access",
- "description": "Prevent unauthorized access to personally identifiable information",
- "type": "content",
- "category": "dynamic-risk",
- "tier": "system",
- "conditions": [
- {
- "field": "query",
- "operator": "equals",
- "value": "string"
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Request blocked by policy",
- "channel": "security-alerts"
}
}
], - "priority": 0,
- "enabled": true,
- "version": 1,
- "tenant_id": "string",
- "organization_id": "string",
- "tags": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by": "string",
- "updated_by": "string",
- "deleted_at": "2019-08-24T14:15:22Z"
}
], - "pagination": {
- "page": 1,
- "page_size": 20,
- "total_items": 45,
- "total_pages": 3
}
}Retrieve a single dynamic policy by ID. Returns 404 if the policy
exists but is not a dynamic policy (category not dynamic-*/media-*).
| id required | string Example: pol_abc123def456 Policy unique identifier |
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
{- "policy": {
- "id": "pol_abc123def456",
- "name": "Block PII Access",
- "description": "Prevent unauthorized access to personally identifiable information",
- "type": "content",
- "category": "dynamic-risk",
- "tier": "system",
- "conditions": [
- {
- "field": "query",
- "operator": "equals",
- "value": "string"
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Request blocked by policy",
- "channel": "security-alerts"
}
}
], - "priority": 0,
- "enabled": true,
- "version": 1,
- "tenant_id": "string",
- "organization_id": "string",
- "tags": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by": "string",
- "updated_by": "string",
- "deleted_at": "2019-08-24T14:15:22Z"
}
}Update an existing dynamic policy. Only provided fields are updated.
If category is changed, the new value must still start with
dynamic- or media-.
| id required | string Example: pol_abc123def456 Policy unique identifier |
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
| X-User-ID |
| name | string [ 3 .. 100 ] characters |
| description | string <= 500 characters |
| type | string (PolicyType) Enum: "content" "user" "risk" "cost" "context_aware" "media" "rate-limit" "budget" "time-access" "role-access" "mcp" "connector" Policy type determines evaluation context:
|
| category | string Policy category. Only changeable on non-system policies. |
Array of objects (PolicyCondition) | |
Array of objects (PolicyAction) | |
| priority | integer [ 0 .. 1000 ] |
| enabled | boolean |
| tags | Array of strings Tags for categorization |
{- "name": "string",
- "description": "string",
- "type": "content",
- "category": "string",
- "conditions": [
- {
- "field": "query",
- "operator": "equals",
- "value": "string"
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Request blocked by policy",
- "channel": "security-alerts"
}
}
], - "priority": 1000,
- "enabled": true,
- "tags": [
- "string"
]
}{- "policy": {
- "id": "pol_abc123def456",
- "name": "Block PII Access",
- "description": "Prevent unauthorized access to personally identifiable information",
- "type": "content",
- "category": "dynamic-risk",
- "tier": "system",
- "conditions": [
- {
- "field": "query",
- "operator": "equals",
- "value": "string"
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Request blocked by policy",
- "channel": "security-alerts"
}
}
], - "priority": 0,
- "enabled": true,
- "version": 1,
- "tenant_id": "string",
- "organization_id": "string",
- "tags": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by": "string",
- "updated_by": "string",
- "deleted_at": "2019-08-24T14:15:22Z"
}
}Soft-delete a dynamic policy. The policy is marked as deleted but retained for audit purposes.
| id required | string Example: pol_abc123def456 Policy unique identifier |
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
| X-User-ID |
{- "error": {
- "code": "VALIDATION_ERROR",
- "message": "Request validation failed",
- "details": [
- {
- "field": "name",
- "message": "Name must be between 3 and 100 characters"
}, - {
- "field": "conditions[0].operator",
- "message": "Invalid operator: like. Must be one of: equals, contains, regex"
}
]
}
}Retrieve the complete version history of a dynamic policy for audit purposes
| id required | string Example: pol_abc123def456 Policy unique identifier |
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
{- "versions": [
- {
- "version": 0,
- "snapshot": {
- "id": "pol_abc123def456",
- "name": "Block PII Access",
- "description": "Prevent unauthorized access to personally identifiable information",
- "type": "content",
- "category": "dynamic-risk",
- "tier": "system",
- "conditions": [
- {
- "field": "query",
- "operator": "equals",
- "value": "string"
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Request blocked by policy",
- "channel": "security-alerts"
}
}
], - "priority": 0,
- "enabled": true,
- "version": 1,
- "tenant_id": "string",
- "organization_id": "string",
- "tags": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by": "string",
- "updated_by": "string",
- "deleted_at": "2019-08-24T14:15:22Z"
}, - "changed_by": "string",
- "changed_at": "2019-08-24T14:15:22Z",
- "change_type": "create",
- "change_summary": "string"
}
]
}Retrieve a paginated list of policies with optional filtering
| type | string (PolicyType) Enum: "content" "user" "risk" "cost" "context_aware" "media" "rate-limit" "budget" "time-access" "role-access" "mcp" "connector" Filter by policy type |
| enabled | boolean Filter by enabled status |
| search | string <= 100 characters Search in policy name and description |
| page | integer >= 1 Default: 1 Page number (1-indexed) |
| page_size | integer [ 1 .. 100 ] Default: 20 Items per page |
| sort_by | string Default: "created_at" Enum: "name" "created_at" "updated_at" "priority" Sort field |
| sort_dir | string Default: "desc" Enum: "asc" "desc" Sort direction |
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
{- "policies": [
- {
- "id": "pol_abc123def456",
- "name": "Block PII Access",
- "description": "Prevent unauthorized access to personally identifiable information",
- "type": "content",
- "category": "dynamic-risk",
- "tier": "system",
- "conditions": [
- {
- "field": "query",
- "operator": "equals",
- "value": "string"
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Request blocked by policy",
- "channel": "security-alerts"
}
}
], - "priority": 0,
- "enabled": true,
- "version": 1,
- "tenant_id": "string",
- "organization_id": "string",
- "tags": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by": "string",
- "updated_by": "string",
- "deleted_at": "2019-08-24T14:15:22Z"
}
], - "pagination": {
- "page": 1,
- "page_size": 20,
- "total_items": 45,
- "total_pages": 3
}
}Create a new policy with conditions and actions
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
| X-User-ID |
| name required | string [ 3 .. 100 ] characters |
| description | string <= 500 characters |
| type required | string (PolicyType) Enum: "content" "user" "risk" "cost" "context_aware" "media" "rate-limit" "budget" "time-access" "role-access" "mcp" "connector" Policy type determines evaluation context:
|
| category | string Policy category (dynamic-risk, dynamic-compliance, media-safety, etc.).
Required on the /api/v1/dynamic-policies surface, where it must
start with |
| tier | string Enum: "organization" "tenant" Policy tier. Only organization or tenant is allowed via the API. |
required | Array of objects (PolicyCondition) non-empty |
required | Array of objects (PolicyAction) non-empty |
| priority | integer [ 0 .. 1000 ] Default: 0 |
| enabled | boolean Default: true |
| tags | Array of strings Tags for categorization |
{- "name": "Block PII Access",
- "description": "Prevent unauthorized access to personally identifiable information",
- "type": "content",
- "conditions": [
- {
- "field": "query",
- "operator": "contains_any",
- "value": [
- "ssn",
- "social security",
- "credit card"
]
}, - {
- "field": "user.role",
- "operator": "not_in",
- "value": [
- "admin",
- "compliance"
]
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Access to PII requires admin or compliance role"
}
}
], - "priority": 100,
- "enabled": true
}{- "policy": {
- "id": "pol_abc123def456",
- "name": "Block PII Access",
- "description": "Prevent unauthorized access to personally identifiable information",
- "type": "content",
- "category": "dynamic-risk",
- "tier": "system",
- "conditions": [
- {
- "field": "query",
- "operator": "equals",
- "value": "string"
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Request blocked by policy",
- "channel": "security-alerts"
}
}
], - "priority": 0,
- "enabled": true,
- "version": 1,
- "tenant_id": "string",
- "organization_id": "string",
- "tags": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by": "string",
- "updated_by": "string",
- "deleted_at": "2019-08-24T14:15:22Z"
}
}Retrieve a single policy by ID
| id required | string Example: pol_abc123def456 Policy unique identifier |
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
{- "policy": {
- "id": "pol_abc123def456",
- "name": "Block PII Access",
- "description": "Prevent unauthorized access to personally identifiable information",
- "type": "content",
- "category": "dynamic-risk",
- "tier": "system",
- "conditions": [
- {
- "field": "query",
- "operator": "equals",
- "value": "string"
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Request blocked by policy",
- "channel": "security-alerts"
}
}
], - "priority": 0,
- "enabled": true,
- "version": 1,
- "tenant_id": "string",
- "organization_id": "string",
- "tags": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by": "string",
- "updated_by": "string",
- "deleted_at": "2019-08-24T14:15:22Z"
}
}Update an existing policy. Only provided fields are updated.
| id required | string Example: pol_abc123def456 Policy unique identifier |
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
| X-User-ID |
| name | string [ 3 .. 100 ] characters |
| description | string <= 500 characters |
| type | string (PolicyType) Enum: "content" "user" "risk" "cost" "context_aware" "media" "rate-limit" "budget" "time-access" "role-access" "mcp" "connector" Policy type determines evaluation context:
|
| category | string Policy category. Only changeable on non-system policies. |
Array of objects (PolicyCondition) | |
Array of objects (PolicyAction) | |
| priority | integer [ 0 .. 1000 ] |
| enabled | boolean |
| tags | Array of strings Tags for categorization |
{- "name": "string",
- "description": "string",
- "type": "content",
- "category": "string",
- "conditions": [
- {
- "field": "query",
- "operator": "equals",
- "value": "string"
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Request blocked by policy",
- "channel": "security-alerts"
}
}
], - "priority": 1000,
- "enabled": true,
- "tags": [
- "string"
]
}{- "policy": {
- "id": "pol_abc123def456",
- "name": "Block PII Access",
- "description": "Prevent unauthorized access to personally identifiable information",
- "type": "content",
- "category": "dynamic-risk",
- "tier": "system",
- "conditions": [
- {
- "field": "query",
- "operator": "equals",
- "value": "string"
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Request blocked by policy",
- "channel": "security-alerts"
}
}
], - "priority": 0,
- "enabled": true,
- "version": 1,
- "tenant_id": "string",
- "organization_id": "string",
- "tags": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by": "string",
- "updated_by": "string",
- "deleted_at": "2019-08-24T14:15:22Z"
}
}Soft-delete a policy. The policy is marked as deleted but retained for audit purposes.
| id required | string Example: pol_abc123def456 Policy unique identifier |
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
| X-User-ID |
{- "error": {
- "code": "UNAUTHORIZED",
- "message": "Missing tenant ID"
}
}Retrieve the complete version history of a policy for audit purposes
| id required | string Example: pol_abc123def456 Policy unique identifier |
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
{- "versions": [
- {
- "version": 0,
- "snapshot": {
- "id": "pol_abc123def456",
- "name": "Block PII Access",
- "description": "Prevent unauthorized access to personally identifiable information",
- "type": "content",
- "category": "dynamic-risk",
- "tier": "system",
- "conditions": [
- {
- "field": "query",
- "operator": "equals",
- "value": "string"
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Request blocked by policy",
- "channel": "security-alerts"
}
}
], - "priority": 0,
- "enabled": true,
- "version": 1,
- "tenant_id": "string",
- "organization_id": "string",
- "tags": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by": "string",
- "updated_by": "string",
- "deleted_at": "2019-08-24T14:15:22Z"
}, - "changed_by": "string",
- "changed_at": "2019-08-24T14:15:22Z",
- "change_type": "create",
- "change_summary": "string"
}
]
}Legacy endpoint. Returns the array of active dynamic policies visible to the CALLING tenant — its own plus the shared global/default baseline (no pagination). Policies owned by other tenants are never returned in the same response, and requests without a resolvable tenant are rejected with 401 (fail closed).
The tenant scope is read from the X-Tenant-ID header. When the
request arrives through the AxonFlow Agent, that header is set from
the validated credential and overwrites any client-supplied value,
so the caller cannot choose the scope. The orchestrator itself does
not authenticate this route, so a caller with direct network access
to the orchestrator can name a tenant — deploy the orchestrator on a
private network behind the Agent.
Prefer GET /api/v1/dynamic-policies.
[- { }
]Evaluate a dynamic policy against sample input without executing
actions. query is required.
| id required | string Example: pol_abc123def456 Policy unique identifier |
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
| query required | string Sample query to test against |
object User context for testing | |
| request_type | string Type of request being simulated |
object Additional context for testing |
{- "query": "string",
- "request_type": "string",
- "context": { }
}{- "matched": true,
- "blocked": true,
- "actions": [
- {
- "type": "string",
- "config": { },
- "message": "string"
}
], - "explanation": "string",
- "eval_time_ms": 0.1
}Evaluate a policy against sample input without executing actions. Useful for validating policy behavior before enabling.
| id required | string Example: pol_abc123def456 Policy unique identifier |
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
| query required | string Sample query to test against |
object User context for testing | |
| request_type | string Type of request being simulated |
object Additional context for testing |
{- "query": "Show me the customer's SSN and credit card",
- "request_type": "query",
- "context": {
- "connector": "salesforce"
}
}{- "matched": true,
- "blocked": true,
- "actions": [
- {
- "type": "block",
- "config": {
- "message": "Access to PII requires admin or compliance role"
}, - "message": "Access to PII requires admin or compliance role"
}
], - "explanation": "Policy 'Block PII Access' matched: all 2 conditions evaluated to true",
- "eval_time_ms": 0.45
}Legacy endpoint. Evaluates the supplied input against all active
dynamic policies and returns the raw policy evaluation result. Prefer
POST /api/v1/policies/simulate (dry-run semantics, tier-aware) or
POST /api/v1/dynamic-policies/{id}/test (single-policy testing).
| query | string Sample query to test against |
object (SimulationUserContext) User context for policy simulation and testing | |
| request_type | string Type of request being simulated |
{- "query": "string",
- "user": {
- "id": 0,
- "role": "analyst",
- "region": "string",
- "permissions": [
- "string"
], - "tenant_id": "string",
- "org_id": "string"
}, - "request_type": "string"
}{- "allowed": true,
- "applied_policies": [
- "string"
], - "risk_score": 0.1,
- "severity": "string",
- "required_actions": [
- "string"
], - "processing_time_ms": 0
}Run all active policies against the provided input as a dry run — no audit writes and no policy actions are applied.
Evaluation tier and above — requires an Evaluation or Enterprise license. Daily simulation quotas apply per tier (unlimited on Enterprise); exceeding the quota returns 429.
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
| query required | string Input to evaluate against all active policies |
| request_type | string Type of request being simulated (defaults to "simulation") |
object (SimulationUserContext) User context for policy simulation and testing | |
object (SimulationClientContext) Client context for policy simulation | |
object Additional context for evaluation |
{- "query": "string",
- "request_type": "string",
- "user": {
- "id": 0,
- "role": "analyst",
- "region": "string",
- "permissions": [
- "string"
], - "tenant_id": "string",
- "org_id": "string"
}, - "client": {
- "id": "string",
- "name": "string",
- "org_id": "string",
- "tenant_id": "string"
}, - "context": { }
}{- "allowed": true,
- "applied_policies": [
- "string"
], - "risk_score": 0.1,
- "required_actions": [
- "string"
], - "processing_time_ms": 0,
- "total_policies": 0,
- "dry_run": true,
- "simulated_at": "2019-08-24T14:15:22Z",
- "tier": "string",
- "daily_usage": {
- "used": 0,
- "limit": 0
}
}Test a single policy against multiple inputs and return aggregate match/block statistics plus per-input results.
Evaluation tier and above — requires an Evaluation or Enterprise license. The number of inputs per request is capped per tier.
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
| policy_id required | string Policy to test against the inputs |
required | Array of objects (ImpactReportInput) non-empty Test inputs (per-tier maximum applies) |
{- "policy_id": "string",
- "inputs": [
- {
- "query": "string",
- "request_type": "string",
- "user": { },
- "context": { }
}
]
}{- "policy_id": "string",
- "policy_name": "string",
- "total_inputs": 0,
- "matched": 0,
- "blocked": 0,
- "match_rate": 0.1,
- "block_rate": 0.1,
- "results": [
- {
- "input_index": 0,
- "matched": true,
- "blocked": true,
- "actions": [
- "string"
]
}
], - "processing_time_ms": 0,
- "generated_at": "2019-08-24T14:15:22Z",
- "tier": "string"
}Analyze the tenant's active policies for contradictions, shadows, and
redundancies. Optionally scope the analysis to a single policy by
passing policy_id in the request body (the body may be omitted
entirely to check all policies).
Evaluation tier and above — requires an Evaluation or Enterprise license. Counts against the daily simulation quota.
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
| policy_id | string Optional: check a specific policy against all others |
{- "policy_id": "string"
}{- "conflicts": [
- {
- "policy_a": {
- "id": "string",
- "name": "string",
- "type": "string"
}, - "policy_b": {
- "id": "string",
- "name": "string",
- "type": "string"
}, - "conflict_type": "contradictory_action",
- "description": "string",
- "severity": "high",
- "overlapping_field": "string"
}
], - "total_policies": 0,
- "conflict_count": 0,
- "checked_at": "2019-08-24T14:15:22Z",
- "tier": "string"
}Bulk import policies from JSON. Supports up to 100 policies per request.
Overwrite modes:
skip: Skip policies that already exist (by name)overwrite: Update existing policieserror: Fail if any policy already exists| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
| X-User-ID |
required | Array of objects (CreatePolicyRequest) [ 1 .. 100 ] items |
| overwrite_mode | string Default: "skip" Enum: "skip" "overwrite" "error" How to handle existing policies |
{- "policies": [
- {
- "name": "string",
- "description": "string",
- "type": "content",
- "category": "string",
- "tier": "organization",
- "conditions": [
- {
- "field": "query",
- "operator": "equals",
- "value": "string"
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Request blocked by policy",
- "channel": "security-alerts"
}
}
], - "priority": 0,
- "enabled": true,
- "tags": [
- "string"
]
}
], - "overwrite_mode": "skip"
}{- "created": 0,
- "updated": 0,
- "skipped": 0,
- "errors": [
- "string"
]
}Export all policies for the tenant as JSON
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
{- "policies": [
- {
- "id": "pol_abc123def456",
- "name": "Block PII Access",
- "description": "Prevent unauthorized access to personally identifiable information",
- "type": "content",
- "category": "dynamic-risk",
- "tier": "system",
- "conditions": [
- {
- "field": "query",
- "operator": "equals",
- "value": "string"
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Request blocked by policy",
- "channel": "security-alerts"
}
}
], - "priority": 0,
- "enabled": true,
- "version": 1,
- "tenant_id": "string",
- "organization_id": "string",
- "tags": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by": "string",
- "updated_by": "string",
- "deleted_at": "2019-08-24T14:15:22Z"
}
], - "exported_at": "2019-08-24T14:15:22Z",
- "tenant_id": "string"
}Retrieve available policy templates for quick policy creation. Templates provide pre-configured policies for common use cases like HIPAA compliance, GDPR data protection, and rate limiting.
| category | string Enum: "general" "security" "compliance" "content_safety" "rate_limiting" "access_control" "data_protection" "custom" Filter by template category |
| search | string Search in name and description |
| tags | string Comma-separated tags to filter by |
| active | boolean Filter by active status |
| builtin | boolean Filter by builtin status |
| page | integer >= 1 Default: 1 Page number (1-indexed) |
| page_size | integer [ 1 .. 100 ] Default: 20 Number of items per page |
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
{- "templates": [
- {
- "id": "hipaa_phi_protection",
- "name": "hipaa_phi_protection",
- "display_name": "HIPAA PHI Protection",
- "description": "Protects PHI data in accordance with HIPAA requirements",
- "category": "compliance",
- "subcategory": "healthcare",
- "template": {
- "type": "content",
- "conditions": [
- {
- "field": "query",
- "operator": "equals",
- "value": "string"
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Request blocked by policy",
- "channel": "security-alerts"
}
}
]
}, - "variables": [
- {
- "name": "threshold",
- "type": "string",
- "required": false,
- "default": "string",
- "description": "Maximum requests allowed per window",
- "validation": "string"
}
], - "is_builtin": true,
- "is_active": true,
- "version": "1.0",
- "tags": [
- "hipaa",
- "healthcare",
- "phi"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
], - "pagination": {
- "page": 1,
- "page_size": 20,
- "total_items": 45,
- "total_pages": 3
}
}Retrieve a single policy template by ID
| id required | string Example: hipaa_phi_protection Template unique identifier |
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
{- "template": {
- "id": "hipaa_phi_protection",
- "name": "hipaa_phi_protection",
- "display_name": "HIPAA PHI Protection",
- "description": "Protects PHI data in accordance with HIPAA requirements",
- "category": "compliance",
- "subcategory": "healthcare",
- "template": {
- "type": "content",
- "conditions": [
- {
- "field": "query",
- "operator": "equals",
- "value": "string"
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Request blocked by policy",
- "channel": "security-alerts"
}
}
]
}, - "variables": [
- {
- "name": "threshold",
- "type": "string",
- "required": false,
- "default": "string",
- "description": "Maximum requests allowed per window",
- "validation": "string"
}
], - "is_builtin": true,
- "is_active": true,
- "version": "1.0",
- "tags": [
- "hipaa",
- "healthcare",
- "phi"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
}Create a new policy from a template by providing variable values. Templates may have required and optional variables that customize the generated policy.
| id required | string Example: hipaa_phi_protection Template unique identifier |
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
| X-User-ID |
| policy_name required | string [ 3 .. 100 ] characters Name for the new policy |
| description | string <= 500 characters Optional policy description |
required | object Variable values for the template |
| enabled | boolean Default: false Whether to enable the policy immediately |
| priority | integer [ 0 .. 1000 ] Policy priority (overrides template default) |
{- "policy_name": "Production Rate Limit",
- "description": "Rate limiting for production API",
- "variables": {
- "threshold": 1000,
- "window_seconds": 60
}, - "enabled": true,
- "priority": 75
}{- "success": true,
- "policy": {
- "id": "pol_abc123def456",
- "name": "Block PII Access",
- "description": "Prevent unauthorized access to personally identifiable information",
- "type": "content",
- "category": "dynamic-risk",
- "tier": "system",
- "conditions": [
- {
- "field": "query",
- "operator": "equals",
- "value": "string"
}
], - "actions": [
- {
- "type": "block",
- "config": {
- "message": "Request blocked by policy",
- "channel": "security-alerts"
}
}
], - "priority": 0,
- "enabled": true,
- "version": 1,
- "tenant_id": "string",
- "organization_id": "string",
- "tags": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by": "string",
- "updated_by": "string",
- "deleted_at": "2019-08-24T14:15:22Z"
}, - "usage_id": "string",
- "message": "string"
}Retrieve all available template categories
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
{- "categories": [
- "general",
- "security",
- "compliance",
- "content_safety",
- "rate_limiting",
- "access_control",
- "data_protection",
- "custom"
]
}Retrieve usage statistics for templates in your tenant
| X-Tenant-ID required | string Example: tenant_abc123 Tenant identifier for multi-tenancy isolation. When calling through the Agent (recommended), this header is stamped automatically from the authenticated client — you do not set it yourself. Required only on direct Orchestrator calls (internal deployments). |
{- "stats": [
- {
- "template_id": "hipaa_phi_protection",
- "template_name": "HIPAA PHI Protection",
- "usage_count": 15,
- "last_used_at": "2025-01-15T14:30:00Z"
}, - {
- "template_id": "gdpr_data_protection",
- "template_name": "GDPR Data Protection",
- "usage_count": 8,
- "last_used_at": "2025-01-14T09:15:00Z"
}
]
}