Skip to main content

Assign Role To User

POST 

https://cloud.agenta.ai/api/workspaces/:workspace_id/roles

Assigns a role to a user in a workspace.

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

Returns: bool: True if the role was successfully assigned, False otherwise.

Raises: HTTPException: If the user does not have permission to perform this action. HTTPException: If there is an error assigning the role to the user.

Request

Path Parameters

    workspace_id Workspace Idrequired

Body

required

    email Email (string)required
    organization_id Organization Id (string)required
    role WorkspaceRole (string)

    Possible values: [owner, viewer, editor, evaluator, workspace_admin, deployment_manager]

    An enumeration.

Responses

Successful Response

Schema

    boolean

curl -L 'https://cloud.agenta.ai/api/workspaces/:workspace_id/roles' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
-d '{
"email": "string",
"organization_id": "string",
"role": "owner"
}'
Request Collapse all
Base URL
https://cloud.agenta.ai/api
Auth
Parameters
— pathrequired
Body required
{
  "email": "string",
  "organization_id": "string",
  "role": "owner"
}
ResponseClear

Click the Send API Request button above and see the response here!