Whether to include archived Workspaces.













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












Examples
Real world code examples
Get Workspaces
GET /api/admin/workspaces
List Workspaces in the Organization.
AdminApiKey
is_archived
page
Page number to return.
page_size
Maximum number of results per page.
search
Search term to filter Workspaces by name.
200
OK
object
Default Value: "list"
Type of paginated API object.
page
Page number returned.
page_size
Maximum number of results per page.
total
Total number of Workspaces that match the request.
Playground
Test the endpoints live
curl https://api.mistral.ai/api/admin/workspaces \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'curl https://api.mistral.ai/api/admin/workspaces \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'200
{
"items": [
{
"description": null,
"icon": null,
"is_default": false,
"name": "My resource",
"uuid": "019b2bd7-96e7-7219-8c0b-45a73da50088"
}
],
"page": "1",
"page_size": "1000",
"total": 56
}{
"items": [
{
"description": null,
"icon": null,
"is_default": false,
"name": "My resource",
"uuid": "019b2bd7-96e7-7219-8c0b-45a73da50088"
}
],
"page": "1",
"page_size": "1000",
"total": 56
}Create Workspace
POST /api/admin/workspaces
Create a Workspace.
AdminApiKey
add_all_org_members
Default Value: false
Whether to add all Organization members to the Workspace.
admin_user_id
User ID to grant the Workspace Admin role to.
description
Default Value: ""
Workspace description.
icon
Default Value: ""
Workspace icon.
name
Workspace name.
200
OK
description
Workspace description.
icon
Workspace icon.
is_default
Whether this is the default Workspace for the Organization.
members_count
Number of members in the Workspace.
name
Workspace name.
raw_role
Deprecated single role for the Workspace. Use 'raw_roles' instead.
raw_roles
Roles granted for the Workspace.
uuid
Workspace ID.
Playground
Test the endpoints live
curl https://api.mistral.ai/api/admin/workspaces \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"admin_user_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource"
}'curl https://api.mistral.ai/api/admin/workspaces \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"admin_user_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource"
}'200
{
"description": null,
"icon": null,
"is_default": false,
"name": "My resource",
"raw_role": "A",
"raw_roles": [
"A"
],
"uuid": "019b2bd7-96e7-7219-8c0b-45a73da50088"
}{
"description": null,
"icon": null,
"is_default": false,
"name": "My resource",
"raw_role": "A",
"raw_roles": [
"A"
],
"uuid": "019b2bd7-96e7-7219-8c0b-45a73da50088"
}Delete Workspaces
DELETE /api/admin/workspaces/{workspace_uuid}
Archive a Workspace.
AdminApiKey
workspace_uuid
Workspace ID.
Playground
Test the endpoints live
curl https://api.mistral.ai/api/admin/workspaces/{workspace_uuid} \
-X DELETE \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json'curl https://api.mistral.ai/api/admin/workspaces/{workspace_uuid} \
-X DELETE \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json'Update Workspaces
PATCH /api/admin/workspaces/{workspace_uuid}
Update a Workspace.
AdminApiKey
workspace_uuid
Workspace ID.
description
Updated Workspace description.
icon
Updated Workspace icon.
name
Updated Workspace name.
200
OK
description
Workspace description.
icon
Workspace icon.
is_default
Whether this is the default Workspace for the Organization.
members_count
Number of members in the Workspace.
name
Workspace name.
uuid
Workspace ID.
Playground
Test the endpoints live
curl https://api.mistral.ai/api/admin/workspaces/{workspace_uuid} \
-X PATCH \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{}'curl https://api.mistral.ai/api/admin/workspaces/{workspace_uuid} \
-X PATCH \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{}'200
{
"description": null,
"icon": null,
"is_default": false,
"name": "My resource",
"uuid": "019b2bd7-96e7-7219-8c0b-45a73da50088"
}{
"description": null,
"icon": null,
"is_default": false,
"name": "My resource",
"uuid": "019b2bd7-96e7-7219-8c0b-45a73da50088"
}Add Users Workspaces
POST /api/admin/workspaces/{workspace_uuid}/add-users
Add members to a Workspace.
AdminApiKey
workspace_uuid
Workspace ID.
200
OK
added_members_count
Number of users added to the Workspace.
Playground
Test the endpoints live
curl https://api.mistral.ai/api/admin/workspaces/{workspace_uuid}/add-users \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{}'curl https://api.mistral.ai/api/admin/workspaces/{workspace_uuid}/add-users \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{}'200
{
"added_members_count": 87
}{
"added_members_count": 87
}Add Or Update Users Workspaces
PATCH /api/admin/workspaces/{workspace_uuid}/users
Add or update Workspace members.
AdminApiKey
workspace_uuid
Workspace ID.
200
OK
added_members_count
Number of users added to the Workspace.
updated_members_count
Number of Workspace members updated.
Playground
Test the endpoints live
curl https://api.mistral.ai/api/admin/workspaces/{workspace_uuid}/users \
-X PATCH \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{}'curl https://api.mistral.ai/api/admin/workspaces/{workspace_uuid}/users \
-X PATCH \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{}'200
{
"added_members_count": 87,
"updated_members_count": 14
}{
"added_members_count": 87,
"updated_members_count": 14
}Remove Users Workspaces
DELETE /api/admin/workspaces/{workspace_uuid}/remove-users
Remove members from a Workspace.
AdminApiKey
workspace_uuid
Workspace ID.
200
OK
deleted_members_count
Number of Workspace members removed.
not_deleted_members
Users that could not be removed.
Playground
Test the endpoints live
curl https://api.mistral.ai/api/admin/workspaces/{workspace_uuid}/remove-users \
-X DELETE \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"members": [
{
"user_uuid": "019b2bd7-96e7-7219-8c0b-45a73da50088"
}
]
}'curl https://api.mistral.ai/api/admin/workspaces/{workspace_uuid}/remove-users \
-X DELETE \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"members": [
{
"user_uuid": "019b2bd7-96e7-7219-8c0b-45a73da50088"
}
]
}'200
{
"deleted_members_count": 87
}{
"deleted_members_count": 87
}