---
title: "Create Role"
method: POST
path: "/api/v1/authz/roles"
tags: ["Authorization"]
---

# Create Role

`POST /api/v1/authz/roles`

Create a custom (non-system) role. Superuser-only.

## Request body

- RoleCreate — Payload for creating an authz_role row.
  - `description` string, nullable
  - `name` string, required
  - `parent_role_id` string, uuid, nullable
  - `permissions` string[] — Permission slugs in the canonical ``<resource>:<action>`` form — for example ``flow:read``, ``deployment:execute``, ``share:create``. Resources must be one of flow, deployment, project, knowledge_base, variable, file, share. Actions are constrained per-resource (see ``services/authorization/actions.py``): e.g. ``deploy`` is only valid on ``flow``, ``ingest`` only on ``knowledge_base``, ``update`` only on ``share``. ``*`` (all actions on that resource) is always accepted. A registered authorization plugin is responsible for compiling these into its policy format.

## Response `201`

Successful Response

- RoleRead — Serialized authz_role row returned by the API.
  - `created_at` string, date-time, required
  - `created_by` string, uuid, nullable, required
  - `description` string, nullable, required
  - `id` string, uuid, required
  - `is_system` boolean, required
  - `name` string, required
  - `parent_role_id` string, uuid, nullable, required
  - `permissions` string[], required
  - `updated_at` string, date-time, required
  - `workspace_id` string, uuid, nullable, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/langflow-ai/apis/langflow.md) · [All operations](https://skmtc.net/langflow-ai/apis/langflow/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/langflow-ai/langflow/versions/22962dc5e81b/schema)
