Skip to main content
PATCH
/
api
/
v2
/
policies
/
{policy_id}
Update Policy
curl --request PATCH \
  --url https://{organization_id}.platform.barndoor.ai/api/v2/policies/{policy_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "support_contact": "<string>",
  "tags": [
    "<string>"
  ],
  "status": "DRAFT",
  "application_ids": [
    "<string>"
  ],
  "rules": [
    {
      "name": "",
      "authorized": false,
      "actions": [
        "<string>"
      ],
      "roles_groups": [
        "<string>"
      ],
      "condition": {
        "match": {
          "expr": "<string>"
        }
      }
    }
  ]
}
'
{
  "policy": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "organization_id": "<string>",
    "name": "<string>",
    "status": "<string>",
    "mcp_server_id": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "created_by_user_id": "<string>",
    "updated_by_user_id": "<string>",
    "support_contact": "<string>",
    "description": "<string>",
    "application_ids": [
      "<string>"
    ],
    "tags": [
      "<string>"
    ],
    "rules": [
      {
        "name": "",
        "authorized": false,
        "actions": [
          "<string>"
        ],
        "roles_groups": [
          "<string>"
        ],
        "condition": {
          "match": {
            "expr": "<string>"
          }
        }
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

policy_id
string<uuid>
required

Body

application/json

Request body for partial updates to an existing policy.

name
string | null

Human-friendly policy name, unique within an organization

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

List of application (agent) identifiers to which this policy applies.

rules
PolicyRule · object[] | null

Full set of rules that govern the policy.

Response

Successful Response

Envelope for detail responses.

policy
PolicyDetail · object
required

Detailed representation of a policy including rules.