curl --request POST \
--url https://{subdomain}.mihu.ai/api/v1/workspace/users/{email}/access \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"roles": [
"loop_agent"
],
"scopes": [
"loop.calls.place",
"contacts"
]
}
'{
"success": true,
"message": "Workspace user access updated",
"data": {
"user": {
"email": "leylatest@mihu.ai",
"name": "leyla leyla",
"is_workspace_owner": false,
"roles": [
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "loop_agent",
"name": "Loop Agent",
"is_system": false,
"scopes": [
"loop.conversations.view",
"loop.conversations.reply"
]
}
],
"role_scopes": [
"loop.conversations.view",
"loop.conversations.reply"
],
"direct_scopes": [
"loop.calls.place"
],
"effective_scopes": [
"loop.conversations.view",
"loop.conversations.reply",
"loop.calls.place"
]
}
}
}{
"success": false,
"message": "Validation failed",
"data": {
"roles": [
"Unknown workspace role(s): missing_role."
]
}
}Workspace User Access
Assign roles or direct scopes to a user
Partially updates a member’s access by email. Send roles, scopes, or both. Role keys assign the role and therefore grant that role’s scopes. Scopes are direct user-specific extras; any direct scope already covered by a submitted role is dropped from direct_scopes but remains in effective_scopes through the role.
POST
/
api
/
v1
/
workspace
/
users
/
{email}
/
access
curl --request POST \
--url https://{subdomain}.mihu.ai/api/v1/workspace/users/{email}/access \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"roles": [
"loop_agent"
],
"scopes": [
"loop.calls.place",
"contacts"
]
}
'{
"success": true,
"message": "Workspace user access updated",
"data": {
"user": {
"email": "leylatest@mihu.ai",
"name": "leyla leyla",
"is_workspace_owner": false,
"roles": [
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "loop_agent",
"name": "Loop Agent",
"is_system": false,
"scopes": [
"loop.conversations.view",
"loop.conversations.reply"
]
}
],
"role_scopes": [
"loop.conversations.view",
"loop.conversations.reply"
],
"direct_scopes": [
"loop.calls.place"
],
"effective_scopes": [
"loop.conversations.view",
"loop.conversations.reply",
"loop.calls.place"
]
}
}
}{
"success": false,
"message": "Validation failed",
"data": {
"roles": [
"Unknown workspace role(s): missing_role."
]
}
}Authorizations
Use a Bearer token to access these API endpoints. Example: "Bearer {your-token}"
Path Parameters
Workspace member email address, URL-encoded
Example:
"leylatest@mihu.ai"
Body
application/json
Workspace role keys or UUIDs. When sent, the user's workspace roles are replaced with exactly this list.
Example:
["loop_agent"]
Direct user scope keys. These may span products because this is user-specific access, not a role definition.
Example:
["loop.calls.place", "contacts"]