Skip to content
Dashboard
Theme
Theme

Create an environment or organization role

POST /v1/authorization/roles: Create an environment or organization role.

View Markdown

POST /v1/authorization/roles

Scope
authorization:write
Auth
Secret key (sk_…)
Since
1.0
  • Idempotency-Key string

    Honoured for 24 h; a replay returns the original response.

    min length 1 · max length 255

  • OhAuthCat-Version string

    Minor version; defaults to the environment’s pin.

  • slug string Required

    The role’s slug in the developer’s app.

  • organization string

  • name string

    max length 200

  • description string

    max length 1000

  • priority integer

    min 0 · max 10000

  • permissions array of string

    max items 500

Errors share one shape; see the error code catalogue.

curl -X POST \
"https://api.ohauthcat.com/v1/authorization/roles" \
-H "Authorization: Bearer $OHAUTHCAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"slug": "acme"
}'
Response 201
{
"id": "role_01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
"object": "role",
"organization": "org_01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
"slug": "acme",
"name": "Acme Corp",
"description": "Primary SSO connection for Acme Corp.",
"priority": 0,
"permissions": [
"organizations:read"
],
"created_at": "2026-01-15T09:30:00Z",
"updated_at": "2026-01-15T09:30:00Z"
}