---
title: "Create a role definition"
method: POST
path: "/api/v1/access-control/roles/definitions"
tags: ["Access Control"]
---

# Create a role definition

`POST /api/v1/access-control/roles/definitions`

## Request

- Base URL: `https://dashboard.sealgate.ai`
- URL: `https://dashboard.sealgate.ai/api/v1/access-control/roles/definitions`
- Auth: HTTP bearer

Create a new role in the caller's domain. Requires the admin role.

## Request body

- CreateRoleRequest
  - `role` string, required: Role name (alphanumeric, hyphens, underscores)
  - `description` string, nullable: Human-readable description

## Response `201`

The created role definition

- RoleDefinition
  - `id` integer, required
  - `role` string, required: Role name
  - `domain` string, required: Domain scope
  - `priority` integer, required: Ordinal rank within the org (0 = highest priority)
  - `description` string, nullable
  - `created_at` string, date-time, required

## Other responses

- `400`: The request was invalid
- `401`: Missing or invalid API key
- `403`: The caller's role is not permitted to perform this action
- `409`: The resource already exists or conflicts with current state
- `422`: Request validation failed

---

[API](https://skmtc.dev/sealgate/apis/sealgate-management-api.md) · [All operations](https://skmtc.dev/sealgate/apis/sealgate-management-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sealgate/apis/sealgate-management-api/revisions/c9ca2e599065?raw)
