Skip to main content
The exchangeAccessToken query exchanges a dedicated access key for a JWT token that can be used to authenticate subsequent GraphQL API requests.
Deprecation Notice
For embedding use cases, use the Impersonate User API instead, which provides better security and user context.

Signature

exchangeAccessToken(accessToken: String!): String!

Parameters

accessToken
String!
required
The dedicated access key provided by WisdomAI for your organization. Contact support@askwisdom.ai to obtain your access key.

Response

Returns a JWT token as a string that should be used in the Authorization header for subsequent API requests.

Usage Example

query ExchangeAccessToken($accessToken: String!) {
  exchangeAccessToken(accessToken: $accessToken)
}
curl -X POST https://{ACCOUNT}.askwisdom.ai/graphql \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query ExchangeAccessToken($accessToken: String!) { exchangeAccessToken(accessToken: $accessToken) }",
    "variables": {
      "accessToken": "your-access-key-here"
    }
  }'
JWT tokens have a limited lifetime. You will need to exchange your access key for a new JWT token periodically.
I