Skip to main content

API Access


The OpenAI API has been rather flaky of late (quite understandably). For the time being, it's probably good practice for a real human to review all output before it gets used in a professional context. Otherwise you might be sending your customers API errors or timeout messages.

Query your bot

Mottle provides a simple JSON API for talking to your bot.

You will find everything you need on the Integrations Page in your account.

Sample code below:

const request = require("request");

const BOT_ID = "YOUR_BOT_ID";

const question = "What is your name?";

const url = `${BOT_ID}`;
const headers = { "Content-Type": "application/json" };
const data = { secret: BOT_SECRET, question: question };{ url, headers, json: data }, (err, response, body) => {
if (err) {
} else {
if (body.error) {
} else {

Email mode

To enable email mode, append &mode=email to the "Connect" API URL. For example: