Skip to content

Policies API Reference

Complete endpoints for agent policy management.

Endpoint: POST /v1/policies/{agent_id} Requires Pro plan or higher (agent policies feature).

Terminal window
curl -X POST https://api.onceonly.tech/v1/policies/support_bot \
-H "Authorization: Bearer once_live_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "support_bot",
"allowed_tools": ["send_email", "create_ticket"],
"blocked_tools": ["delete_user"],
"max_actions_per_hour": 100,
"max_spend_usd_per_day": 50
}'
{
"agent_id": "support_bot",
"policy": {
"allowed_tools": ["send_email", "create_ticket"],
"blocked_tools": ["delete_user"],
"max_actions_per_hour": 100,
"max_spend_usd_per_day": 50
}
}

Endpoint: GET /v1/policies Requires Pro plan or higher (agent policies feature).

Terminal window
curl -H "Authorization: Bearer once_live_xxxxxxxxxxxxx" \
"https://api.onceonly.tech/v1/policies"
[
{
"agent_id": "support_bot",
"policy": {
"allowed_tools": ["send_email", "create_ticket"],
"blocked_tools": ["delete_user"],
"max_actions_per_hour": 100,
"max_spend_usd_per_day": 50
}
}
]

Endpoint: GET /v1/policies/{agent_id} Requires Pro plan or higher (agent policies feature).

Terminal window
curl -H "Authorization: Bearer once_live_xxxxxxxxxxxxx" \
"https://api.onceonly.tech/v1/policies/support_bot"
{
"agent_id": "support_bot",
"policy": {
"allowed_tools": ["send_email", "create_ticket"],
"blocked_tools": ["delete_user"],
"max_actions_per_hour": 100,
"max_spend_usd_per_day": 50
}
}

Endpoint: POST /v1/policies/{agent_id}/from-template

Create or update a policy using a built-in template + overrides. Requires Pro plan or higher (agent policies feature).

  • strict
  • moderate
  • permissive
  • read_only
  • support_bot
Terminal window
curl -X POST https://api.onceonly.tech/v1/policies/support_bot/from-template \
-H "Authorization: Bearer once_live_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "support_bot",
"template": "moderate",
"overrides": {
"max_actions_per_hour": 200
}
}'
{
"agent_id": "support_bot",
"policy": {
"max_actions_per_hour": 200,
"max_spend_usd_per_day": 10
}
}

See also: Policy Templates Guide