Policies API Reference
Policies API Reference
Section titled “Policies API Reference”Complete endpoints for agent policy management.
Create/Update Policy
Section titled “Create/Update Policy”Endpoint: POST /v1/policies/{agent_id}
Requires Pro plan or higher (agent policies feature).
Request
Section titled “Request”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 }'Response
Section titled “Response”{ "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 }}List Policies
Section titled “List Policies”Endpoint: GET /v1/policies
Requires Pro plan or higher (agent policies feature).
Request
Section titled “Request”curl -H "Authorization: Bearer once_live_xxxxxxxxxxxxx" \ "https://api.onceonly.tech/v1/policies"Response
Section titled “Response”[ { "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 } }]Get Policy
Section titled “Get Policy”Endpoint: GET /v1/policies/{agent_id}
Requires Pro plan or higher (agent policies feature).
Request
Section titled “Request”curl -H "Authorization: Bearer once_live_xxxxxxxxxxxxx" \ "https://api.onceonly.tech/v1/policies/support_bot"Response
Section titled “Response”{ "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 }}Create Policy From Template
Section titled “Create Policy From Template”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).
Templates
Section titled “Templates”strictmoderatepermissiveread_onlysupport_bot
Request
Section titled “Request”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 } }'Response
Section titled “Response”{ "agent_id": "support_bot", "policy": { "max_actions_per_hour": 200, "max_spend_usd_per_day": 10 }}See also: Policy Templates Guide