Number of organizations to skip before returning results.













Beta Users Endpoints
(beta) Users API.












Examples
Real world code examples
Get Identity
GET /v1/users/me#
Get Identity
200
OK
api_key#
organization#
workspace#
Playground
Test the endpoints live
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral();
async function run() {
const result = await mistral.beta.users.getIdentity({
dashboardUserContextAuth: "MISTRAL_DASHBOARD_USER_CONTEXT_AUTH",
});
console.log(result);
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral();
async function run() {
const result = await mistral.beta.users.getIdentity({
dashboardUserContextAuth: "MISTRAL_DASHBOARD_USER_CONTEXT_AUTH",
});
console.log(result);
}
run();
from mistralai.client import Mistral, models
import os
with Mistral() as mistral:
res = mistral.beta.users.get_identity(security=models.UsersAPIGetIdentitySecurity(
dashboard_user_context_auth=os.getenv("MISTRAL_DASHBOARD_USER_CONTEXT_AUTH", ""),
))
# Handle response
print(res)
from mistralai.client import Mistral, models
import os
with Mistral() as mistral:
res = mistral.beta.users.get_identity(security=models.UsersAPIGetIdentitySecurity(
dashboard_user_context_auth=os.getenv("MISTRAL_DASHBOARD_USER_CONTEXT_AUTH", ""),
))
# Handle response
print(res)
curl https://api.mistral.ai/v1/users/me \
-X GET \
-H 'DashboardUserContextAuth: YOUR_DASHBOARDUSERCONTEXTAUTH_HERE' \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'curl https://api.mistral.ai/v1/users/me \
-X GET \
-H 'DashboardUserContextAuth: YOUR_DASHBOARDUSERCONTEXTAUTH_HERE' \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'200
{
"email": null,
"first_name": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"last_name": null
}{
"email": null,
"first_name": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"last_name": null
}List Organizations
GET /v1/users/me/organizations#
List every organization the authenticated user is a member of.
Identity-only: the caller need not have selected an organization, so this reads only the user and never scopes by the active org.
200
OK
Playground
Test the endpoints live
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral();
async function run() {
const result = await mistral.beta.users.listOrganizations({
dashboardUserContextAuth: "MISTRAL_DASHBOARD_USER_CONTEXT_AUTH",
}, {});
for await (const page of result) {
console.log(page);
}
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral();
async function run() {
const result = await mistral.beta.users.listOrganizations({
dashboardUserContextAuth: "MISTRAL_DASHBOARD_USER_CONTEXT_AUTH",
}, {});
for await (const page of result) {
console.log(page);
}
}
run();
from mistralai.client import Mistral, models
import os
with Mistral() as mistral:
res = mistral.beta.users.list_organizations(security=models.UsersAPIListOrganizationsSecurity(
dashboard_user_context_auth=os.getenv("MISTRAL_DASHBOARD_USER_CONTEXT_AUTH", ""),
), offset=0, limit=100)
while res is not None:
# Handle items
res = res.next()
from mistralai.client import Mistral, models
import os
with Mistral() as mistral:
res = mistral.beta.users.list_organizations(security=models.UsersAPIListOrganizationsSecurity(
dashboard_user_context_auth=os.getenv("MISTRAL_DASHBOARD_USER_CONTEXT_AUTH", ""),
), offset=0, limit=100)
while res is not None:
# Handle items
res = res.next()
curl https://api.mistral.ai/v1/users/me/organizations \
-X GET \
-H 'DashboardUserContextAuth: YOUR_DASHBOARDUSERCONTEXTAUTH_HERE' \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'curl https://api.mistral.ai/v1/users/me/organizations \
-X GET \
-H 'DashboardUserContextAuth: YOUR_DASHBOARDUSERCONTEXTAUTH_HERE' \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'200
{
"organizations": [
{
"id": "1a2b3c4d-5e6f-4a8b-9c0d-1e2f3a4b5c6d",
"name": "Acme Corp"
}
]
}{
"organizations": [
{
"id": "1a2b3c4d-5e6f-4a8b-9c0d-1e2f3a4b5c6d",
"name": "Acme Corp"
}
]
}List Workspaces
GET /v1/users/me/workspaces#
List every workspace the authenticated user is a member of, across all their organizations, each tagged with the organization it belongs to.
200
OK
The workspaces the authenticated user is a member of, each tagged with the organization it belongs to.
Playground
Test the endpoints live
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral();
async function run() {
const result = await mistral.beta.users.listWorkspaces({
dashboardUserContextAuth: "MISTRAL_DASHBOARD_USER_CONTEXT_AUTH",
}, {
organizationId: "1a2b3c4d-5e6f-4a8b-9c0d-1e2f3a4b5c6d",
});
for await (const page of result) {
console.log(page);
}
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral();
async function run() {
const result = await mistral.beta.users.listWorkspaces({
dashboardUserContextAuth: "MISTRAL_DASHBOARD_USER_CONTEXT_AUTH",
}, {
organizationId: "1a2b3c4d-5e6f-4a8b-9c0d-1e2f3a4b5c6d",
});
for await (const page of result) {
console.log(page);
}
}
run();
from mistralai.client import Mistral, models
import os
with Mistral() as mistral:
res = mistral.beta.users.list_workspaces(security=models.UsersAPIListWorkspacesSecurity(
dashboard_user_context_auth=os.getenv("MISTRAL_DASHBOARD_USER_CONTEXT_AUTH", ""),
), organization_id="1a2b3c4d-5e6f-4a8b-9c0d-1e2f3a4b5c6d", offset=0, limit=100)
while res is not None:
# Handle items
res = res.next()
from mistralai.client import Mistral, models
import os
with Mistral() as mistral:
res = mistral.beta.users.list_workspaces(security=models.UsersAPIListWorkspacesSecurity(
dashboard_user_context_auth=os.getenv("MISTRAL_DASHBOARD_USER_CONTEXT_AUTH", ""),
), organization_id="1a2b3c4d-5e6f-4a8b-9c0d-1e2f3a4b5c6d", offset=0, limit=100)
while res is not None:
# Handle items
res = res.next()
curl https://api.mistral.ai/v1/users/me/workspaces \
-X GET \
-H 'DashboardUserContextAuth: YOUR_DASHBOARDUSERCONTEXTAUTH_HERE' \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'curl https://api.mistral.ai/v1/users/me/workspaces \
-X GET \
-H 'DashboardUserContextAuth: YOUR_DASHBOARDUSERCONTEXTAUTH_HERE' \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'200
{
"workspaces": [
{
"id": "7f8e9d0c-1b2a-4c3d-8e9f-0a1b2c3d4e5f",
"name": "production",
"organization_id": "1a2b3c4d-5e6f-4a8b-9c0d-1e2f3a4b5c6d"
}
]
}{
"workspaces": [
{
"id": "7f8e9d0c-1b2a-4c3d-8e9f-0a1b2c3d4e5f",
"name": "production",
"organization_id": "1a2b3c4d-5e6f-4a8b-9c0d-1e2f3a4b5c6d"
}
]
}Whoami
GET /v1/whoami#
Return the authenticated caller's identity.
Principal-agnostic: resolves both users and service accounts.
200
OK
The authenticated principal: either a user or a service account.
workspace#
Playground
Test the endpoints live
from mistralai.client import Mistral, models
import os
with Mistral() as mistral:
res = mistral.beta.users.whoami(security=models.UsersAPIWhoamiSecurity(
dashboard_user_or_service_account_context_auth=os.getenv("MISTRAL_DASHBOARD_USER_OR_SERVICE_ACCOUNT_CONTEXT_AUTH", ""),
))
# Handle response
print(res)
from mistralai.client import Mistral, models
import os
with Mistral() as mistral:
res = mistral.beta.users.whoami(security=models.UsersAPIWhoamiSecurity(
dashboard_user_or_service_account_context_auth=os.getenv("MISTRAL_DASHBOARD_USER_OR_SERVICE_ACCOUNT_CONTEXT_AUTH", ""),
))
# Handle response
print(res)
curl https://api.mistral.ai/v1/whoami \
-X GET \
-H 'DashboardUserOrServiceAccountContextAuth: YOUR_DASHBOARDUSERORSERVICEACCOUNTCONTEXTAUTH_HERE' \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'curl https://api.mistral.ai/v1/whoami \
-X GET \
-H 'DashboardUserOrServiceAccountContextAuth: YOUR_DASHBOARDUSERORSERVICEACCOUNTCONTEXTAUTH_HERE' \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'200
{
"principal": {
"id": "8f14e45f-ceea-4e0a-9b0e-8f7d3c2a1b4e"
}
}{
"principal": {
"id": "8f14e45f-ceea-4e0a-9b0e-8f7d3c2a1b4e"
}
}