- get_identity - Get Identity
- list_organizations - List Organizations
- list_workspaces - List Workspaces
Get Identity
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)| Parameter | Type | Required | Description |
|---|---|---|---|
security |
models.UsersAPIGetIdentitySecurity | ✔️ | The security requirements to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
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.
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()| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
security |
models.UsersAPIListOrganizationsSecurity | ✔️ | N/A | |
offset |
Optional[int] | ➖ | Number of organizations to skip before returning results. | 0 |
limit |
Optional[int] | ➖ | Maximum number of organizations to return. | 100 |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.UsersAPIListOrganizationsResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
List every workspace the authenticated user is a member of, across all their organizations, each tagged with the organization it belongs to.
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()| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
security |
models.UsersAPIListWorkspacesSecurity | ✔️ | N/A | |
organization_id |
OptionalNullable[str] | ➖ | Return only workspaces belonging to this organization. | 1a2b3c4d-5e6f-4a8b-9c0d-1e2f3a4b5c6d |
offset |
Optional[int] | ➖ | Number of workspaces to skip before returning results. | 0 |
limit |
Optional[int] | ➖ | Maximum number of workspaces to return. | 100 |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.UsersAPIListWorkspacesResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |