Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.wisdom.ai/llms.txt

Use this file to discover all available pages before exploring further.

The listUsers query returns users in a workspace along with their attributes and role assignments. Use it to look up user IDs before calling impersonateUser or setUserAttributes.

Signature

listUsers(workspaceId: ID): [User!]!

Parameters

workspaceId
ID
Filters results to a specific workspace. Required for multi-workspace deployments.

Response

Returns an array of User objects. See User for the full schema. The fields most relevant to user management are:
id
ID!
The user’s unique ID. Pass this to impersonateUser, setUserAttributes, or deleteUsersFromWorkspace.
email
String!
The user’s email address.
userAttributes
[UserAttribute!]
Key-value pairs associated with the user. Each entry includes:
  • key — attribute name
  • value — attribute value
  • source — either DATABASE (set via API) or JWT (from SSO claims, read-only)
See User attributes for how these sources differ.
roleAssignments
[RoleAssignment!]
The roles assigned to the user and their scope.

Usage example

query ListUsers($workspaceId: ID) {
  listUsers(workspaceId: $workspaceId) {
    id
    email
    userAttributes {
      key
      value
      source
    }
    roleAssignments {
      roleId
      scopes
    }
  }
}
curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <access_token>" \
  -d '{
    "query": "query ListUsers($workspaceId: ID) { listUsers(workspaceId: $workspaceId) { id email userAttributes { key value source } roleAssignments { roleId scopes } } }",
    "variables": {
      "workspaceId": "workspace_123"
    }
  }' \
  https://{ACCOUNT}.askwisdom.ai/graphql
{
  "data": {
    "listUsers": [
      {
        "id": "user_abc123",
        "email": "alice@yourcompany.com",
        "userAttributes": [
          { "key": "account_id", "value": "acct_456", "source": "DATABASE" },
          { "key": "department", "value": "finance", "source": "JWT" }
        ],
        "roleAssignments": [
          { "roleId": "00000000-0000-0000-0000-000000000003", "scopes": ["{{DOMAIN_ID}}"] }
        ]
      }
    ]
  }
}

Impersonate user

Use the user ID to start an embedded session

Set user attributes

Update DATABASE-sourced attributes on a user

Delete users from workspace

Remove users from a workspace