Policies
Create a policy
Create a user-authored policy. scope_id is auto-filled from context when omitted (layer 1 → null, layer 2 → org_id, layer 3 → tenant_id); layer 4 requires an explicit workflow_id. Layer-3 policies are validated stricter-wins against the parent org (422 policy_looser_than_parent when looser). Auth: NextAuth session OR an sk_live_ API key (Authorization: Bearer or X-API-Key); requires the admin role.
post/api/v1/tenants/{tenantId}/policies
Request
- Base URL: http://dobby-ai.com
- URL: http://dobby-ai.com/api/v1/tenants/{tenantId}/policies
- Auth: HTTP bearer
Path parameters
tenantIdstring required
Tenant (workspace) ID
Request body
Example request
{
"text": "Never send customer PII to external email addresses"
}Response
Policy created
Example response
{
"success": true,
"data": {
"policy_id": "pol_user_abc123",
"layer": 3,
"text": "Never send customer PII to external email addresses",
"source": "user_authored",
"severity": "high",
"is_active": true,
"version": 1
}
}Changes
No recorded changes to this operation across all 1 revision of this API.