Test token provider API

For more information about the token auth process, please refer to the authentication docs. This service is turned off by default, you can switch it on from the Chatkit instance settings in your dashboard.

While perfect for getting up and running, the test token provider should only be used for testing purposes and disabled before your Chatkit application is in production.


Test Token Provider requests should be sent to


appended with the right endpoint for the resource you're interested in, in this case the /token endpoint. You can get your pre-built endpoint from your dashboard settings tab where you enable the test token provider.

Create a Token

POST /token

Used to generate valid Chatkit tokens for your app. Supply it with a grant type and user id to generate a new token.

You are able to use either a query string or request body, but please only use one or the other.

Use a query string

A query string with the following required fields:

  • user_id: your desired user id

Use a request body

A JSON object with the following keys

  • grant_type (string | required): Use "client_credentials".
  • user_id (string | required): name of the new user, must be < 60 characters with no spaces.

JSON format

  "grant_type": "client_credentials",
  "user_id": "phil_usher"
Response Body

A JSON object containing the following keys

  • access_token (string): access JWT.
  • user_id (string): user_id included as the token subject.
  • token_type (string): type of token returned (will be "bearer").
  • expires_in (int): expiry time of the token.
Response Codes
  • 200 if successful
  • 400 if user error
  • 404 if the instance locator not found (make sure the test token provider is turned on in the application dashboard)
  • 5xx if server error