Skip to main content
POST
Create Policy

Authorizations

Authorization
string
header
required

A Barndoor API key, sent as Authorization: Bearer <key>. Keys are prefixed bdai_ and are opaque — do not attempt to decode one. Interchangeable with an OAuth 2.0 access token.

Body

application/json

Request body for creating a new policy.

name
string
required

Human-friendly policy name, unique within an organization. Required when creating.

mcp_server_id
string
required

UUID of the MCP server this policy governs. Immutable after creation — rules reference server-specific tool actions, so target a different server by creating a new policy rather than editing this one. Retrieve real ids from GET /api/registry/v1/servers.

description
string | null

Longer description of the policy.

support_contact
string | null

Primary point of contact associated with the policy.

tags
string[] | null

Tags for categorizing the policy.

status
enum<string> | null

The current lifecycle status of the policy.

Available options:
DRAFT,
ACTIVE,
INACTIVE,
ARCHIVED
application_ids
string[] | null

AI agents this policy applies to, as application UUIDs. An empty or omitted list means the policy applies to ALL agents — it must never contain an empty string. Retrieve real ids from GET /api/registry/v1/agents.

rules
PolicyRule · object[] | null

Full set of rules that govern the policy. This REPLACES the existing rule list on update — send the complete set, not a delta. Anything no rule grants is denied. Write ONE rule per distinct roles_groups set: put every action for a principal on a single rule and let the :approve suffix carry allow-vs-confirm, rather than splitting reads and writes across two rules naming the same principal.

Response

Successful Response

Envelope for detail responses.

policy
PolicyDetail · object
required

Detailed representation of a policy including rules.