API Access

Chat API is designed to extend conversation builder capabilities in a custom channel and enable bi-direction communication.

Download the GraphQL playground from the link below:


Once configured, in the new workspace dialog paste the following endpoint:


Click “Open”.

GraphQL APIs are self-descriptive, the schema tab will give you an overview of the available operations (mutations) and queries for a given api endpoint.

Obtain your API key from configure (⚙) -> API Access as shown below:

Paste it to the HTTP headers for x-api-key:


We are now ready to make requests to the Chat API. Below, an example of how to send a message to the subscriber using ‘sendToUser’ method.

Here, you will add a mutation to the GraphQL API:

# Write your query or mutation here
mutation SendToUser($botId: ID!, $userId: ID!, $messages: JSON) {
  sendToUser(botId: $botId, userId: $userId, messages: $messages)

Next, you will define the variables that are required for the particular operation:

  "botId": "667e4ca643834eeaddaba2738689325b",
  "messages":"[{\"type\":\"text\", \"text\":\"Hello\"}]"

Click on the play button to execute it.

Please check out the documentation to understand the basics of user attributes and get an overview on how to obtain a user Id:



Note that messages is an array and it can be used to send out the following types:

  • Text
  • Image
  • Button Template

Below is are examples of payload for each type:


    "type" : "text",
    "text": "Hello world"


	"type" : "image",
	"image": "URL"

Button Template:

	"type" : "button-template",
	"text": "description"
	"buttons": [
				"type": "url",
				"title": "Test",
				"url": "https://..."
				"type": "postback",
				"title": "Test",
				"postback": "block_id"

Last Updated: 9/4/2019, 10:20:47 AM