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 setUserAttributes mutation updates the DATABASE-sourced attributes for an existing user. Use this to update persistent key-value pairs that control parameterized connections and row-level data access.
This mutation replaces all DATABASE-sourced attributes on the user. Any attributes not included in the new list will be removed. JWT-sourced attributes (from SSO claims) are not affected. See User attributes for the difference between attribute sources.

Signature

setUserAttributes(input: SetUserAttributesInput!): SetUserAttributesResponse!

Arguments

input
SetUserAttributesInput!
required
Input object identifying the user and the new attribute set.

SetUserAttributesInput fields

userId
ID!
required
The ID of the user whose attributes should be updated. Use listUsers to find user IDs.
userAttributes
[UserAttributeInput!]!
required
The complete new set of DATABASE-sourced attributes. This replaces all existing DATABASE-sourced attributes — include every attribute you want the user to have after the call, not just the ones you’re changing.

Response

status
ResponseStatus!
Indicates whether the operation succeeded. See ResponseStatus.

Usage example

mutation SetUserAttributes($input: SetUserAttributesInput!) {
  setUserAttributes(input: $input) {
    status {
      code
      message
    }
  }
}
curl -s -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <access_token>" \
  -d '{
    "query": "mutation SetUserAttributes($input: SetUserAttributesInput!) { setUserAttributes(input: $input) { status { code message } } }",
    "variables": {
      "input": {
        "userId": "user_abc123",
        "userAttributes": [
          { "key": "account_id", "value": "acct_456" },
          { "key": "region", "value": "us-west" }
        ]
      }
    }
  }' \
  https://{ACCOUNT}.askwisdom.ai/graphql
{
  "data": {
    "setUserAttributes": {
      "status": {
        "code": "OK",
        "message": "User attributes updated successfully"
      }
    }
  }
}
For attributes that are stable (e.g., account_id), set them once at creation via userAttributes in createUsers. For session-scoped overrides that should not be persisted, use attributes in impersonateUser instead.

User attributes

Understand attribute sources and how they interact

Impersonate user

Pass transient attributes at session time

List users

Query users and inspect their current attributes