mistralM

Docs

sideBar

Beta Admin User Groups

(beta) Admin API - manage user groups. Requires an admin API key.

GET /v1/admin/user-groups

Get User Groups

Get all user groups across the organization.

Security

AdminApiKey
bearerhttp

Parameters

page
integerquery

Page number to return.

page_size
integerquery

Maximum number of results per page.

string | nullquery

Search term used to filter user groups by name.

workspace_uuid
string | nullquery

Filter groups to those assigned to this Workspace. Assignments to archived Workspaces never match.

role
"user" | "dev" | "mistral_code_user" | "cloud_user" | "workspace_contributor" | "workspace_admin"query

Filter groups to those holding this role on a Workspace. When combined with workspace_uuid, the role must be held on that Workspace. Assignments to archived Workspaces never match.

Responses

OK

items
array<AdminUserGroupOut>* required

User groups on this page.

AdminUserGroupOut
description
string | null* required

Optional description of the user group.

Example:

Members of the platform engineering team
externally_managed
boolean | null

Whether the group is managed by an external system.

name
stringMax Length: 255* required

Name of the user group.

Example:

Engineering Team
organization_role
string | null

Organization role assigned to the group.

uuid
string* required

User group ID.

page
integer* required

Page number returned.

Example:

1
page_size
integer* required

Maximum number of results per page.

Example:

25
total
integer* required

Total number of user groups that match the request.

Example:

4

POST /v1/admin/user-groups

Create User Group

Create a new user group.

Security

AdminApiKey
bearerhttp

Request Example

{
  "name": "Engineering Team"
}

Request Body

description
string | null

Optional description of the user group.

Example:

Members of the platform engineering team
name
stringMax Length: 255* required

Name of the user group.

Example:

Engineering Team

Responses

OK

description
string | null* required

Optional description of the user group.

Example:

Members of the platform engineering team
externally_managed
boolean | null

Whether the group is managed by an external system.

name
stringMax Length: 255* required

Name of the user group.

Example:

Engineering Team
organization_role
string | null

Organization role assigned to the group.

uuid
string* required

User group ID.

POST /v1/admin/user-groups/provision-workspace

Provision Group To Workspace

Deprecated: provision all users from a user group to a workspace with a specific role.

Use POST /user-groups/\{group_uuid\}/workspaces with role_names to assign the group to a workspace, and PATCH /user-groups/\{group_uuid\}/workspaces/\{workspace_uuid\} to change the roles of an existing assignment.

Security

AdminApiKey
bearerhttp

Request Example

{
  "user_group_uuid": "ipsum eiusmod",
  "workspace_uuid": "consequat do"
}

Request Body

user_group_uuid
string* required

User group ID to provision.

workspace_role
"A" | "M" | "48436751-ee56-44bd-8a2d-712233977821" | "578584f1-4319-4c88-9948-38a5184483b6" | "252a0825-40b9-4b98-be80-7658956f13e9" | "17aa61c5-1c61-477e-a40a-e52c8ccd74b9" | "b23cd6e0-91cd-4a8a-9869-b30366bf3966" | "731eb2be-a74f-4070-b797-35bf7009e553" | null

Workspace role value to assign to the group. Mutually exclusive with 'workspace_role_name'.

workspace_role_name
"user" | "dev" | "mistral_code_user" | "cloud_user" | "workspace_contributor" | "workspace_admin"

Workspace role name to assign to the group. Mutually exclusive with 'workspace_role'.

workspace_uuid
string* required

Workspace ID where the group is provisioned.

GET /v1/admin/user-groups/{group_uuid}

Get User Group

Get a specific user group.

Security

AdminApiKey
bearerhttp

Parameters

group_uuid
stringpath* required

User group ID.

Responses

OK

description
string | null* required

Optional description of the user group.

Example:

Members of the platform engineering team
externally_managed
boolean | null

Whether the group is managed by an external system.

name
stringMax Length: 255* required

Name of the user group.

Example:

Engineering Team
organization_role
string | null

Organization role assigned to the group.

uuid
string* required

User group ID.

DELETE /v1/admin/user-groups/{group_uuid}

Delete User Group

Delete a user group.

Security

AdminApiKey
bearerhttp

Parameters

group_uuid
stringpath* required

User group ID.

PATCH /v1/admin/user-groups/{group_uuid}

Update User Group

Update User Group

Security

AdminApiKey
bearerhttp

Parameters

group_uuid
stringpath* required

Request Example

{}

Request Body

description
string | null

Updated description of the user group. Pass an empty string to clear it; omit the field or pass null to leave it unchanged.

Example:

Members of the platform engineering team
name
string | null

Updated name of the user group.

Example:

Engineering Team

Responses

OK

description
string | null* required

Optional description of the user group.

Example:

Members of the platform engineering team
externally_managed
boolean | null

Whether the group is managed by an external system.

name
stringMax Length: 255* required

Name of the user group.

Example:

Engineering Team
organization_role
string | null

Organization role assigned to the group.

uuid
string* required

User group ID.

GET /v1/admin/user-groups/{group_uuid}/members

Get User Group Members

Get members of a user group.

Security

AdminApiKey
bearerhttp

Parameters

group_uuid
stringpath* required

User group ID.

page
integerquery

Page number to return.

page_size
integerquery

Maximum number of results per page.

Responses

OK

members
array<AdminUserGroupMemberOut>* required

Group members on this page.

AdminUserGroupMemberOut
email
string | null* required

Email address of the group member.

Example:

alice.martin@example.com
name
string | null* required

Name of the group member.

Example:

Alice Martin
user_uuid
string* required

User ID of the group member.

page
integer* required

Page number returned.

Example:

1
page_size
integer* required

Maximum number of results per page.

Example:

25
total
integer* required

Total number of group members that match the request.

Example:

12

POST /v1/admin/user-groups/{group_uuid}/members

Assign Users To Group

Assign users to a user group.

Security

AdminApiKey
bearerhttp

Parameters

group_uuid
stringpath* required

Request Example

{
  "user_uuids": [
    "ipsum eiusmod"
  ]
}

Request Body

user_uuids
array<string>Max Items: 1000* required

User IDs to add to the group.

DELETE /v1/admin/user-groups/{group_uuid}/members

Remove Users From Group

Remove users from a user group.

Security

AdminApiKey
bearerhttp

Parameters

group_uuid
stringpath* required

Request Example

{
  "user_uuids": [
    "ipsum eiusmod"
  ]
}

Request Body

user_uuids
array<string>Max Items: 1000* required

User IDs to add to the group.

GET /v1/admin/user-groups/{group_uuid}/workspaces

Get Group Workspace Assignments

List workspace assignments for a user group.

Security

AdminApiKey
bearerhttp

Parameters

group_uuid
stringpath* required

User group ID.

page
integerquery

Page number to return.

page_size
integerquery

Maximum number of results per page.

Responses

OK

items
array<GroupWorkspaceAssignmentOut>* required

Workspace assignments on this page.

GroupWorkspaceAssignmentOut
created
date-time* required
role_name
string | null
exclamationMark

Deprecated: Workspace assignments now support multiple roles. This field only contains the name of the first entry in roles; use roles instead.

role_uuid
string | null
exclamationMark

Deprecated: Workspace assignments now support multiple roles. This field only contains the UUID of the first entry in roles; use roles instead.

roles
array<WorkspaceRoleRef>* required
WorkspaceRoleRef
name
string* required
uuid
string* required
workspace_name
string* required

Name of the Workspace.

Example:

Product Team
workspace_uuid
string* required
page
integer* required

Page number returned.

Example:

1
page_size
integer* required

Maximum number of results per page.

Example:

25
total
integer* required

Total number of Workspace assignments that match the request.

Example:

2

POST /v1/admin/user-groups/{group_uuid}/workspaces

Assign Group To Workspace

Assign a user group to a workspace.

Security

AdminApiKey
bearerhttp

Parameters

group_uuid
stringpath* required

User group ID.

Request Example

{
  "workspace_uuid": "ipsum eiusmod"
}

Request Body

role
"A" | "M" | "48436751-ee56-44bd-8a2d-712233977821" | "578584f1-4319-4c88-9948-38a5184483b6" | "252a0825-40b9-4b98-be80-7658956f13e9" | "17aa61c5-1c61-477e-a40a-e52c8ccd74b9" | "b23cd6e0-91cd-4a8a-9869-b30366bf3966" | "731eb2be-a74f-4070-b797-35bf7009e553"
role_names
array<"user" | "dev" | "mistral_code_user" | "cloud_user" | "workspace_contributor" | "workspace_admin"> | null

Simplified role names to assign. Mutually exclusive with 'roles'.

roles
array<"A" | "M" | "48436751-ee56-44bd-8a2d-712233977821" | "578584f1-4319-4c88-9948-38a5184483b6" | "252a0825-40b9-4b98-be80-7658956f13e9" | "17aa61c5-1c61-477e-a40a-e52c8ccd74b9" | "b23cd6e0-91cd-4a8a-9869-b30366bf3966" | "731eb2be-a74f-4070-b797-35bf7009e553"> | null

Role values to assign. Mutually exclusive with 'role_names'.

workspace_uuid
string* required

DELETE /v1/admin/user-groups/{group_uuid}/workspaces/{workspace_uuid}

Remove Group From Workspace

Remove a user group from a workspace.

Security

AdminApiKey
bearerhttp

Parameters

group_uuid
stringpath* required

User group ID.

workspace_uuid
stringpath* required

Workspace ID.

PATCH /v1/admin/user-groups/{group_uuid}/workspaces/{workspace_uuid}

Update Group Workspace Assignment

Update the workspace role assignment for a user group.

Either set the group's roles with role_names or roles, which replaces all the roles it has on the Workspace, or change them with add_role_names/add_roles and remove_role_names/remove_roles, which keeps its other roles.

Security

AdminApiKey
bearerhttp

Parameters

group_uuid
stringpath* required

User group ID.

workspace_uuid
stringpath* required

Workspace ID.

Request Example

{}

Request Body

Either set the group's roles on the Workspace, or add and remove some of them.

add_role_names
array<"user" | "dev" | "mistral_code_user" | "cloud_user" | "workspace_contributor" | "workspace_admin"> | null

Simplified role names to add to the existing roles. Mutually exclusive with 'add_roles'.

add_roles
array<"48436751-ee56-44bd-8a2d-712233977821" | "578584f1-4319-4c88-9948-38a5184483b6" | "252a0825-40b9-4b98-be80-7658956f13e9" | "17aa61c5-1c61-477e-a40a-e52c8ccd74b9" | "b23cd6e0-91cd-4a8a-9869-b30366bf3966" | "731eb2be-a74f-4070-b797-35bf7009e553">Min Items: 1

Workspace roles assigned to the member.

remove_role_names
array<"user" | "dev" | "mistral_code_user" | "cloud_user" | "workspace_contributor" | "workspace_admin"> | null

Simplified role names to remove from the existing roles. Mutually exclusive with 'remove_roles'.

remove_roles
array<"48436751-ee56-44bd-8a2d-712233977821" | "578584f1-4319-4c88-9948-38a5184483b6" | "252a0825-40b9-4b98-be80-7658956f13e9" | "17aa61c5-1c61-477e-a40a-e52c8ccd74b9" | "b23cd6e0-91cd-4a8a-9869-b30366bf3966" | "731eb2be-a74f-4070-b797-35bf7009e553">Min Items: 1

Workspace roles assigned to the member.

role
"A" | "M" | "48436751-ee56-44bd-8a2d-712233977821" | "578584f1-4319-4c88-9948-38a5184483b6" | "252a0825-40b9-4b98-be80-7658956f13e9" | "17aa61c5-1c61-477e-a40a-e52c8ccd74b9" | "b23cd6e0-91cd-4a8a-9869-b30366bf3966" | "731eb2be-a74f-4070-b797-35bf7009e553"
role_names
array<"user" | "dev" | "mistral_code_user" | "cloud_user" | "workspace_contributor" | "workspace_admin"> | null

Simplified role names to assign. Mutually exclusive with 'roles'.

roles
array<"A" | "M" | "48436751-ee56-44bd-8a2d-712233977821" | "578584f1-4319-4c88-9948-38a5184483b6" | "252a0825-40b9-4b98-be80-7658956f13e9" | "17aa61c5-1c61-477e-a40a-e52c8ccd74b9" | "b23cd6e0-91cd-4a8a-9869-b30366bf3966" | "731eb2be-a74f-4070-b797-35bf7009e553"> | null

Role values to assign. Mutually exclusive with 'role_names'.

PATCH /v1/admin/user-groups/{group_uuid}/organization-role

Update User Group Organization Role

Update the organization role for a user group.

Security

AdminApiKey
bearerhttp

Parameters

group_uuid
stringpath* required

User group ID.

Request Example

{
  "organization_role": "member"
}

Request Body

organization_role
"member" | "billing_manager" | "organization_admin" | "A" | "M" | "B" | "0d48f530-095c-43fe-8aea-6673bcacabe6" | "c955f4e1-9477-43f0-8349-6fbc629fccc9" | "7bde5959-d676-47d2-b779-35b64323d278"* required

Organization role to assign to the group: a role name (member, billing_manager, organization_admin) or a role UUID.