Skip to content

Webhooks API ​

Connect any external chat or messaging system to your MyChatBot agent. If your platform can send and receive HTTP requests, your AI assistant can talk to its users β€” custom apps, support systems, mobile chat, IoT devices, or any third-party platform MyChatBot doesn't support natively.

Unlike the built-in channels (Telegram, WhatsApp, Website Widget), the Webhooks API is a do-it-yourself channel: you connect it in the app, then your own platform posts user messages in and receives the agent's replies at a URL you control.

At a glance ​

Field you fill inWhereWhat it does
API tokenYou generate itAuthenticates the messages your platform sends in
Unique page_idYou choose itIdentifies this specific integration channel
Reply webhook URLYour endpointWhere MyChatBot sends the agent's replies back
DirectionHow it flows
Your platform β†’ MyChatBotYour app posts each user message to the MyChatBot inbound webhook
MyChatBot β†’ Your platformThe agent's reply is posted back to your Reply webhook URL

Connect it in the app ​

The Webhooks API channel is set up entirely from the Channels page β€” you only need the fields above.

In the app

  1. Open Channels β†’ https://app.mychatbot.app/channels
  2. Select the agent you want to connect.
  3. Choose Webhooks API from the channel list.
  4. Fill in API token, Unique page_id, and Reply webhook URL.
  5. Turn on Connect agent to this channel.
  6. Set Reply Delay (s) β€” how long the agent waits before answering (a small delay feels more natural).
  7. Click Connect Webhooks API.

To disconnect later, open the same screen and click Revoke.

Your page_id must match

The page_id in every message you send must exactly match the Unique page_id you entered here, and the channel must be turned on for that page_id. Otherwise the message is ignored.

Channel options ​

Once connected, a few extra toggles appear on the same channel screen:

OptionWhat it doesWhen to use
Reply Delay (s)Waits this many seconds before the agent repliesMake replies feel more human, or batch rapid-fire messages
Ignore ReactionsSkips reactions your users add to messages/storiesTurn on if reaction events would otherwise trigger unwanted replies
Quick comment replyOptional short public reply text; leave empty to skip a public reply while still sending the real answer privatelyPublic comment threads where you reply in DM
Voice reply settingsLets the agent answer with a voice message and pick a voiceYou want spoken replies (see Voice messages)

Sending messages to MyChatBot ​

When a user writes on your platform, POST their message as JSON to the inbound webhook URL MyChatBot shows you on the Channels page (https://app.mychatbot.app/channels) when you connect the Webhooks API channel.

Send a JSON body. Only four fields are required:

FieldRequiredWhat it is
client_idYesA unique ID for the end user (keep it stable so their conversation continues)
page_idYesThe Unique page_id you set when connecting the channel
platformYesA name for your platform, e.g. "CustomApp"
textYesThe user's message text
client_nameNoThe user's display name
client_avatarNoURL to the user's avatar image
audioNoURL to an audio file for a voice message
attachmentsNoArray of URLs to attached files or images
json
{
  "client_id": "UNIQUE_CLIENT_IDENTIFIER",
  "page_id": "YOUR_PAGE_ID",
  "client_name": "User Name",
  "client_avatar": "https://example.com/avatar.jpg",
  "platform": "CustomApp",
  "text": "Hello, I have a question",
  "attachments": ["https://example.com/image.jpg"]
}

Receiving the agent's replies ​

MyChatBot posts each reply to the Reply webhook URL you configured, as a form-encoded request. Handle these fields:

FieldWhat it contains
textThe reply message text
imagesURLs to any images in the reply
fileURL to any file attachment
audioURL to a voice reply (when voice replies are enabled)

If a reply is long, it may arrive as several parts sent one after another β€” append them in order.

Voice messages ​

The Webhooks API supports voice in both directions.

  • User voice in β€” include an audio URL in your message. MyChatBot transcribes it automatically and the agent treats it as a normal message.
  • Agent voice out β€” turn on Voice reply settings on the channel screen and pick a voice. Replies then include an audio URL alongside the text.
json
{
  "client_id": "UNIQUE_CLIENT_IDENTIFIER",
  "page_id": "YOUR_PAGE_ID",
  "client_name": "User Name",
  "platform": "CustomApp",
  "audio": "https://example.com/audio.mp3"
}

What happens to a message ​

From your side, the flow is simple: you send a message, and one or more replies come back to your Reply webhook URL. Behind that:

  1. MyChatBot checks the channel is on for your page_id.
  2. The message is added to that user's conversation history (matched by client_id).
  3. If you sent audio, it's transcribed to text first.
  4. The agent reads the conversation and writes a reply.
  5. The reply is delivered to your Reply webhook URL β€” split into parts if it's long, and with a voice version if voice replies are on.

Troubleshooting ​

The inbound webhook returns standard HTTP status codes:

CodeMeaningWhat to check
200 OKMessage acceptedβ€”
400 Bad RequestMalformed request or a missing required fieldYou're sending client_id, page_id, platform, and text
401 UnauthorizedThe API token doesn't matchThe token matches the API token on the channel screen
500 Internal Server ErrorSomething went wrong processing the requestRetry; contact support if it persists

No replies coming through?

The most common cause is a page_id mismatch or the channel being switched off. Confirm the Unique page_id on the Channels screen matches what you send, and that Connect agent to this channel is on.

Use cases ​

The Webhooks API is a fit for:

  • Custom chat applications.
  • Integrating with an existing customer support system.
  • In-app chat for a mobile app.
  • IoT devices with messaging.
  • Any third-party platform MyChatBot doesn't support natively.

See also ​