Assign Role To User
POST/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
- application/json
 
Body
required
- MOD1
 
email Email (string)required
organization_id Organization Id (string)required
role
object
anyOf
string
Responses
- 200
 - 422
 
Successful Response
- application/json
 
- Schema
 
Schema
boolean
Validation Error
- application/json
 
- Schema
 - Example (from schema)
 
Schema
Array [
Array [
- MOD1
 - MOD2
 ]
]
detail
object[]
loc
object[]
required
anyOf
string
integer
msg Message (string)required
type Error Type (string)required
{
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
Loading...