---
title: "Assign Role To User"
method: POST
path: "/workspaces/{workspace_id}/roles"
tags: ["Workspaces"]
---

# Assign Role To User

`POST /workspaces/{workspace_id}/roles`

Assign a role to a user in a workspace.

Args:
    payload (UserRole): The organization id, user email, and role to assign.
    workspace_id (str): The ID of the workspace.

## Path parameters

- `workspace_id` string, required

## Request body

- UserRole
  - `email` string, required
  - `role` string, nullable
  - `organization_id` string, required

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

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