---
title: "Create Assignment"
method: POST
path: "/api/v1/authz/role-assignments/"
tags: ["Authorization"]
---

# Create Assignment

`POST /api/v1/authz/role-assignments/`

Assign a role to a user. Superuser-only.

## Request body

- RoleAssignmentCreate — Payload for assigning a role to a user.
  - `domain_id` string, uuid, nullable — Required when ``domain_type`` is org/workspace/project; must be null for ``global``.
  - `domain_type` 'global' | 'org' | 'workspace' | 'project' — Domain scope of the assignment. ``global`` is unscoped (no ``domain_id``); ``org``/``workspace``/``project`` require a matching ``domain_id``.
  - `role_id` string, uuid, required
  - `user_id` string, uuid, required

## Response `201`

Successful Response

- RoleAssignmentRead — Serialized authz_role_assignment row returned by the API.
  - `assigned_at` string, date-time, required
  - `assigned_by` string, uuid, nullable, required
  - `domain_id` string, uuid, nullable, required
  - `domain_type` string, required
  - `id` string, uuid, required
  - `role_id` string, uuid, required
  - `user_id` string, uuid, 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)
