Skip to main content
POST
/
api
/
v2
/
policies
/
validate
Validate Policy
curl --request POST \
  --url https://{organization_id}.platform.barndoor.ai/api/v2/policies/validate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "mcp_server_id": "<string>",
  "application_ids": [
    "<string>"
  ],
  "exclude_policy_id": "<string>"
}
'
{
  "name_is_unique": true,
  "no_overlap_if_active": true,
  "overlapping_policy_names": [
    "<string>"
  ]
}

Authorizations

Authorization
string
header
required

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

Body

application/json

Request body for validating a policy before creation.

name
string
required

Policy name to validate

Required string length: 1 - 255
mcp_server_id
string | null

MCP server ID to check for overlaps

application_ids
string[] | null

Application IDs to check for overlaps

exclude_policy_id
string | null

Policy ID to exclude from validation (for edit mode)

Response

Successful Response

Response for policy validation.

name_is_unique
boolean
required

Whether the policy name is unique within the organization

no_overlap_if_active
boolean
required

Whether the policy would overlap with existing active policies

overlapping_policy_names
string[]

Names of overlapping active policies, if any