Create a custom role with specific capabilities for an organization. Requires the manage_roles capability.
POSThttps://api.aitronos.com/v1/organizations/{organization_id}/roles
The calling user can only assign capabilities they themselves possess (anti-escalation).
organization_id string required
Organization ID (org_ prefixed string).
name string required
Role name. Must be unique within the organization. Max 100 characters.
description string optional
Human-readable description. Max 500 characters.
capabilities array of strings required
List of capability keys to assign. Must be valid values from the capabilities endpoint. At least one capability required.
The created role object with capabilities, member count of 0, and creation timestamp.
cURL
- Bash
- Python
- Python
- JavaScript
curl -X POST "https://api.aitronos.com/v1/organizations/org_abc123/roles" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Marketing Analyst",
"description": "Can view audit logs and manage knowledge slices",
"capabilities": ["view_audit_log", "manage_knowledge_slices"]
}'