Create a policy
Creates a new policy in a gateway. An optional mcp_scope narrows it to MCP registries, tools and principals; the response echoes the stored scope and may carry non-blocking warnings. The policy starts attached to no consumer and not global, so it runs nowhere and holds no level until it is attached or promoted.
A valid request URL is required to generate request examples{
"consumer_ids": [
"<string>"
],
"created_at": "<string>",
"description": "<string>",
"enabled": true,
"gateway_id": "<string>",
"global": true,
"id": "<string>",
"mcp_scope": {
"except_groups": [
"<string>"
],
"groups": [
"<string>"
],
"registry_ids": [
"<string>"
],
"tools": [
{
"registry_id": "<string>",
"tool": "<string>"
}
]
},
"mcp_wide": true,
"mode": "<string>",
"name": "<string>",
"parallel": true,
"priority": 123,
"settings": {},
"slug": "<string>",
"stages": [
"<string>"
],
"status": "active",
"status_message": "<string>",
"updated_at": "<string>",
"warnings": [
"<string>"
]
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
Path Parameters
Gateway id
Body
Policy to create
MCPScope narrows the policy to MCP destinations and principals. Omitted (or null) keeps the policy consumer-wide; {} is rejected as it would never match.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Created
MCPScope is echoed as stored: absent when the policy is consumer-wide, {} when a registry delete pruned every destination.
Show child attributes
Show child attributes
MCPWide marks a policy that runs on every MCP consumer of the gateway and on the MCP Store, narrowed by its mcp_scope. It is never true together with Global, and an MCP-wide policy has no consumer_ids.
Show child attributes
Show child attributes
Status is "active" (enabled and running), "paused" (disabled) or "error" (enabled but the gateway cannot run it; see status_message).
active, paused, error StatusMessage is the reason the gateway cannot run the policy. It is present only when status is "error".
Warnings are non-blocking notes about the write that just succeeded, such as a consumer that already runs the same plugin without scope.
A valid request URL is required to generate request examples{
"consumer_ids": [
"<string>"
],
"created_at": "<string>",
"description": "<string>",
"enabled": true,
"gateway_id": "<string>",
"global": true,
"id": "<string>",
"mcp_scope": {
"except_groups": [
"<string>"
],
"groups": [
"<string>"
],
"registry_ids": [
"<string>"
],
"tools": [
{
"registry_id": "<string>",
"tool": "<string>"
}
]
},
"mcp_wide": true,
"mode": "<string>",
"name": "<string>",
"parallel": true,
"priority": 123,
"settings": {},
"slug": "<string>",
"stages": [
"<string>"
],
"status": "active",
"status_message": "<string>",
"updated_at": "<string>",
"warnings": [
"<string>"
]
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}