mistralM

Docs

sideBar

Beta Admin Workspaces

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

GET /v1/admin/workspaces

Get Workspaces

List Workspaces in the Organization.

Security

AdminApiKey
bearerhttp

Parameters

page
integerquery

Page number to return.

page_size
integerquery

Maximum number of results per page.

is_archived
booleanquery

Whether to include archived Workspaces.

string | nullquery

Search term to filter Workspaces by name.

Responses

OK

items
array<WorkspaceOUT>* required

Workspaces on this page.

WorkspaceOUT
description
string | null* required

Workspace description.

Example:

Workspace for product and design teams
groups_count
integer | null

Number of groups assigned to the Workspace.

Example:

3
icon
string | null* required

Workspace icon.

Example:

★
is_default
boolean* required

Whether this is the default Workspace for the Organization.

members_count
integer | null

Number of members in the Workspace.

name
stringMax Length: 255* required

Workspace name.

Example:

Product Team
spend_limit
WorkspaceSpendLimitOUT | null

Workspace spending limit.

WorkspaceSpendLimitOUT

Workspace spending limit.

currency
string | null* required

Currency used for the Workspace spending limit.

Example:

USD
no_monthly_limit
boolean | null* required

Whether the Workspace has no monthly spending limit.

value
number | null* required

Monthly spending limit for the Workspace.

uuid
string* required

Workspace ID.

object
"list"

Type of paginated API object.

Default Value: "list"

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 Workspaces that match the request.

Example:

3

POST /v1/admin/workspaces

Create Workspace

Create a Workspace.

Security

AdminApiKey
bearerhttp

Request Example

{
  "admin_user_id": "ipsum eiusmod",
  "name": "Product Team"
}

Request Body

add_all_org_members
boolean

Whether to add all Organization members to the Workspace.

Default Value: false

admin_user_id
string* required

User ID to grant the Workspace Admin role to.

description
stringMax Length: 255

Workspace description.

Example:

Workspace for product and design teams

Default Value: ""

icon
stringMax Length: 2

Workspace icon.

Example:

★

Default Value: ""

name
stringMax Length: 255* required

Workspace name.

Example:

Product Team

Responses

OK

description
string | null* required

Workspace description.

Example:

Workspace for product and design teams
groups_count
integer | null

Number of groups assigned to the Workspace.

Example:

3
icon
string | null* required

Workspace icon.

Example:

★
is_default
boolean* required

Whether this is the default Workspace for the Organization.

members_count
integer | null

Number of members in the Workspace.

name
stringMax Length: 255* required

Workspace name.

Example:

Product Team
raw_role
"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" | "0d48f530-095c-43fe-8aea-6673bcacabe6" | "c955f4e1-9477-43f0-8349-6fbc629fccc9" | "7bde5959-d676-47d2-b779-35b64323d278"* required
exclamationMark

Deprecated first role of 'raw_roles'. Use 'raw_roles' instead.

raw_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" | "0d48f530-095c-43fe-8aea-6673bcacabe6" | "c955f4e1-9477-43f0-8349-6fbc629fccc9" | "7bde5959-d676-47d2-b779-35b64323d278">Min Items: 1* required

Roles granted for the Workspace.

role
string* required
exclamationMark

Deprecated name of the first role of 'raw_roles'. Use 'raw_roles' instead.

spend_limit
WorkspaceSpendLimitOUT | null

Workspace spending limit.

WorkspaceSpendLimitOUT

Workspace spending limit.

currency
string | null* required

Currency used for the Workspace spending limit.

Example:

USD
no_monthly_limit
boolean | null* required

Whether the Workspace has no monthly spending limit.

value
number | null* required

Monthly spending limit for the Workspace.

uuid
string* required

Workspace ID.

DELETE /v1/admin/workspaces/{workspace_uuid}

Delete Workspace

Archive a Workspace.

Security

AdminApiKey
bearerhttp

Parameters

workspace_uuid
stringpath* required

Workspace ID.

PATCH /v1/admin/workspaces/{workspace_uuid}

Update Workspace

Update a Workspace.

Security

AdminApiKey
bearerhttp

Parameters

workspace_uuid
stringpath* required

Workspace ID.

Request Example

{}

Request Body

description
string | null

Updated Workspace description.

Example:

Workspace for product and design teams
icon
string | null

Updated Workspace icon.

Example:

★
name
string | null

Updated Workspace name.

Example:

Product Team

Responses

OK

description
string | null* required

Workspace description.

Example:

Workspace for product and design teams
groups_count
integer | null

Number of groups assigned to the Workspace.

Example:

3
icon
string | null* required

Workspace icon.

Example:

★
is_default
boolean* required

Whether this is the default Workspace for the Organization.

members_count
integer | null

Number of members in the Workspace.

name
stringMax Length: 255* required

Workspace name.

Example:

Product Team
spend_limit
WorkspaceSpendLimitOUT | null

Workspace spending limit.

WorkspaceSpendLimitOUT

Workspace spending limit.

currency
string | null* required

Currency used for the Workspace spending limit.

Example:

USD
no_monthly_limit
boolean | null* required

Whether the Workspace has no monthly spending limit.

value
number | null* required

Monthly spending limit for the Workspace.

uuid
string* required

Workspace ID.

GET /v1/admin/workspaces/{workspace_uuid}/users

List Workspace Users

List the members of a Workspace, direct or through a group, with their roles.

Security

AdminApiKey
bearerhttp

Parameters

workspace_uuid
stringpath* required

Workspace ID.

page
integerquery

Page number to return.

page_size
integerquery

Maximum number of results per page.

include_inactive
booleanquery

Whether to include deactivated and blocked members.

Responses

OK

items
array<AdminWorkspaceMemberOUT>* required

Members of the Workspace on this page, direct or through a group.

AdminWorkspaceMemberOUT
direct_member
boolean* required

Whether the user is a direct member of the Workspace. Members who only belong to it through a group are managed by changing the group.

Example:

true
email
string | null* required

Email address of the Workspace member.

Example:

alice.martin@example.com
externally_managed
boolean* required

Whether the member is managed by an external identity provider, through SSO or SCIM.

Example:

false
group_grants
array<AdminWorkspaceGroupGrantOUT>* required

Groups assigned to the Workspace that grant the member roles, with the roles each one grants.

AdminWorkspaceGroupGrantOUT
group_id
string* required

ID of the group assigned to the Workspace.

group_name
string* required

Name of the group assigned to the Workspace.

Example:

Engineering
roles
array<"user" | "dev" | "mistral_code_user" | "cloud_user" | "workspace_contributor" | "workspace_admin">* required

Names of the Workspace roles the group assignment grants.

name
string | null* required

Name of the Workspace member.

Example:

Alice Martin
roles
array<"user" | "dev" | "mistral_code_user" | "cloud_user" | "workspace_contributor" | "workspace_admin">* required

Names of the Workspace roles assigned directly to the member.

status
"active" | "deactivated" | "blocked"* required
user_id
string* required

User ID of the Workspace 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 members of the Workspace.

Example:

42

PATCH /v1/admin/workspaces/{workspace_uuid}/users

Add Or Update Users Workspaces

Add or update Workspace members.

For each member, either set its roles with roles or role_names, which replaces all the roles it has in the Workspace, or change them with add_roles/add_role_names and remove_roles/remove_role_names, which keeps its other roles. Users who are not yet members are added with the given roles.

Security

AdminApiKey
bearerhttp

Parameters

workspace_uuid
stringpath* required

Workspace ID.

Request Example

{}

Request Body

Workspace members to add or update. 'roles' or 'role_names' replace the member's roles; 'add_' and 'remove_' change them without touching the others.

AdminWorkspaceMemberUpsertSingleIN

Workspace member to add or update, either by setting its roles or by adding and removing some.

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" | null
exclamationMark

Deprecated legacy single role value, kept for backward compatibility. Mutually exclusive with 'role_name'.

role_name
"user" | "dev" | "mistral_code_user" | "cloud_user" | "workspace_contributor" | "workspace_admin"
exclamationMark

Deprecated single role name, kept for backward compatibility. Mutually exclusive with 'role'.

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"> | 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"> | null

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

user_uuid
string* required

User ID of the Workspace member.

Responses

OK

added_members_count
integer* required

Number of users added to the Workspace.

Example:

1
updated_members_count
integer* required

Number of Workspace members updated.

Example:

0

POST /v1/admin/workspaces/{workspace_uuid}/add-users

Add Users Workspaces

Add members to a Workspace.

Security

AdminApiKey
bearerhttp

Parameters

workspace_uuid
stringpath* required

Workspace ID.

Request Example

{}

Request Body

members
array<AdminWorkspaceMemberSingleIN> | null

Workspace members to add or update.

AdminWorkspaceMemberSingleIN
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
exclamationMark

Deprecated legacy single role value, kept for backward compatibility. Mutually exclusive with 'role_name'.

role_name
"user" | "dev" | "mistral_code_user" | "cloud_user" | "workspace_contributor" | "workspace_admin"
exclamationMark

Deprecated single role name, kept for backward compatibility. Mutually exclusive with 'role'.

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"> | 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"> | null

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

user_uuid
string* required

User ID of the Workspace member.

Responses

OK

added_members_count
integer* required

Number of users added to the Workspace.

Example:

1

DELETE /v1/admin/workspaces/{workspace_uuid}/remove-users

Remove Users Workspaces

Remove members from a Workspace.

Security

AdminApiKey
bearerhttp

Parameters

workspace_uuid
stringpath* required

Workspace ID.

Request Example

{
  "members": [
    {
      "user_uuid": "ipsum eiusmod"
    }
  ]
}

Request Body

members
array<BaseWorkspaceMemberIN>* required

Workspace members to remove.

BaseWorkspaceMemberIN
user_uuid
string* required

User ID of the Workspace member.

Responses

OK

deleted_members_count
integer* required

Number of Workspace members removed.

Example:

1
not_deleted_members
array<string> | null

Users that could not be removed.