Skip to content

Add a policy (owners only)

POST
/policies
curl --request POST \
--url https://api.global.stillbox.example/v1/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "description": "example", "team_id": "example", "source": "example", "enabled": true }'

A policy is Cedar forbid rules; anything no rule forbids is allowed. @approval asks a person instead of refusing, @four_eyes needs a second person, and @reason("...") is what the agent is told.

Media typeapplication/json
object
name
required
string
>= 1 characters <= 100 characters
description
string
<= 500 characters
team_id
string
source
required
string
>= 1 characters <= 20000 characters
enabled

Defaults to true.

boolean

Example generated

{
"name": "example",
"description": "example",
"team_id": "example",
"source": "example",
"enabled": true
}

The policy

Media typeapplication/json
object
id
required
string
name
required
string
description
required
string
team_id

Only this team’s sandboxes; absent for the whole organization.

string
source
required

Cedar forbid rules

string
enabled
required
boolean
created_at
required
string format: date-time
updated_at
required
string format: date-time

Example generated

{
"id": "example",
"name": "example",
"description": "example",
"team_id": "example",
"source": "example",
"enabled": true,
"created_at": "2026-04-15T12:00:00Z",
"updated_at": "2026-04-15T12:00:00Z"
}

The request is invalid

Media typeapplication/json
object
code
required
string
message
required
string

Example

{
"code": "not_found"
}

The API key is missing or invalid

Media typeapplication/json
object
code
required
string
message
required
string

Example

{
"code": "not_found"
}

Only an owner can do this (owner_only), or the invitation is for another address (not_invited)

Media typeapplication/json
object
code
required
string
message
required
string

Example

{
"code": "not_found"
}

The change would leave the organization without an owner (last_owner), its seats are full (member_limit), or the person is already a member (already_member)

Media typeapplication/json
object
code
required
string
message
required
string

Example

{
"code": "not_found"
}