AI Webhooks API

AI Webhooks API: connect your agents to any system

Receive real-time events, trigger agents programmatically and push data anywhere. The Webhooks API is how developers extend MyChatBot to their own stack.

Start free Book a demo
Real-time eventsREST & webhooksCustom toolsMCP integrationsCRM & data syncSecure & scoped
01

Listen to every event

Subscribe to message, lead, deal and hand-off events as they happen.

02

Trigger agents on demand

Fire an agent action from your backend, outbound messages, follow-ups, updates.

03

Build custom tools

Expose your own functions to agents via Webhooks and MCP for bespoke workflows.

04

Scoped and secure

Permission-scoped tokens, signed payloads and graceful degradation by design.

What the Webhooks API is and who it is for

The Webhooks API is a do-it-yourself channel in MyChatBot. If your platform can send and receive HTTP requests, your AI agent can talk to its users: your platform posts each user message in, and the agent’s reply comes back to a URL you control.

Built-in channels such as WhatsApp, Telegram or the Website Widget connect directly in the app. The Webhooks API covers the rest: the systems MyChatBot does not support natively.

It is a good fit for:

  • custom chat applications and in-app chat in a mobile app;
  • an existing customer support system you want to keep;
  • IoT devices with messaging;
  • any third-party platform without a native MyChatBot channel.

Inside your own product, users talk to the assistant you connect to this channel, with its instructions, knowledge and connected tools. Your developers own the transport, and MyChatBot runs the conversation.

How a message flows through MyChatBot

Every integration rests on three values: an API token you generate, a Unique page_id you choose, and a Reply webhook URL, an HTTPS endpoint on your side. With those in place, each message goes through five steps:

  1. A user writes on your platform, and your backend POSTs the message as JSON to the inbound webhook URL shown on the Channels page. Four fields are required: client_id, page_id, platform and text.
  2. MyChatBot checks that the channel is on for that page_id.
  3. The message is added to the user’s conversation history, matched by client_id. If you sent an audio URL, it is transcribed to text first.
  4. The agent reads the conversation and writes a reply.
  5. The reply is posted to your Reply webhook URL as a form-encoded request with text, images, file and audio fields. A long reply may arrive in several parts, so append them in order.

Keep client_id stable for each end user: that is how the conversation continues instead of starting over. You can also send the optional client_name and client_avatar fields, plus an attachments array with file or image URLs.

Key capabilities

Voice in both directions

Include an audio URL in the incoming message and MyChatBot transcribes it automatically, so the agent treats it as a normal message. Turn on Voice reply settings and pick a voice, and replies include an audio URL alongside the text.

Channel options

  • Reply Delay (s) waits before answering, which makes replies feel more natural and helps batch rapid-fire messages.
  • Ignore Reactions skips reaction events that would otherwise trigger unwanted replies.
  • Quick comment reply sets an optional short public reply for comment threads, while the real answer is sent privately.

Clear status codes

The inbound webhook returns standard HTTP codes: 200 when the message is accepted, 400 for a malformed request or a missing required field, 401 when the API token does not match, and 500 when processing failed and the request should be retried.

The assistant’s full setup

A Webhooks API conversation is answered by the assistant you configure on the Agent configuration page, so its instructions, Knowledge Base and connected integrations apply here too. Saved changes take effect from the next reply, on every channel.

How it fits with other channels and integrations

The Webhooks API is one of the channels on the Channels page, next to WhatsApp, Instagram, Telegram, Viber, TikTok, Facebook, Gmail, SMS, Calls and the Website Widget. A channel connects to one assistant at a time, and you can split channels between several assistants.

MyChatBot also offers other ways to wire in your own systems:

  • Trigger Outreach in Automations: an external system POSTs to a unique webhook URL to create a lead and, optionally, have the agent send a message, such as an order update, an appointment reminder or a CRM event. You can create up to 20 named triggers, each in Capture only or Capture and send outreach mode, and pass a context value the agent uses in its message.
  • CRM integrations with KeyCRM, SalesDrive, Bitrix24, Kommo, Zoho, Salesforce, GoHighLevel and HubSpot, so qualified chats are written to your CRM as leads or deals. See all integrations.
  • Custom MCP: add an extra ability to the assistant through your own MCP server.
  • Agents Platform triggers: a secret webhook link or an event in a connected app starts a routine or an agent.

When a human takes over, and the limits to know

Handoff rules live in Handoff Control on the Agent configuration page and apply to the assistant’s chats:

  • Stop word for manual handoff: when an operator types the keyword, the chat switches to operator mode.
  • Implicit operator handoff: any operator message switches the chat to operator mode. You pick either this or the keyword, not both.
  • Silent handoff: the client is not notified about the switch.
  • Auto return: when it is on, the agent is re-enabled in the chat after 24 hours by default, or after a custom interval from 1 minute to 1 week.

Read more about human handoff.

A few limits are worth planning for:

  • The page_id in every message must exactly match the Unique page_id on the channel, and the channel must be on. Otherwise the message is ignored.
  • When the assistant is paused, by hand or by a Work Hours schedule, it stops replying on its channels. Messages that arrive in that time stay unanswered but visible to your team, and the assistant does not go back to reply to them later.
  • If your account balance runs out, assistants are switched off automatically. After topping up, check the status switch.
  • Your platform, not MyChatBot, shows users the replies it receives at the Reply webhook URL.

How to set it up

  1. Open Channels and select the agent you want to connect.
  2. Choose Webhooks API from the channel list.
  3. Fill in API token, Unique page_id and Reply webhook URL.
  4. Turn on Connect agent to this channel and set Reply Delay (s).
  5. Click Connect Webhooks API and copy the inbound webhook URL shown on the Channels page.
  6. Send a test message with client_id, page_id, platform and text, and confirm the reply arrives at your endpoint.

No replies coming through? The most common cause is a page_id mismatch or the channel being switched off. A 401 response means the token in your request does not match the API token on the channel screen. To disconnect later, open the same screen and click Revoke.

Before going live, test the assistant in a private chat, and turn the channel switch on only after reviewing the settings. Plans are listed on the pricing page.

Frequently asked questions

Do I need a developer to use the Webhooks API?

Yes, some development work is needed. Connecting the channel in the app takes only a few fields, but your platform has to POST user messages as JSON to MyChatBot and handle the replies at your own Reply webhook URL. If you only need chat on your website, the built-in Website Widget is the simpler option.

What does a message sent to MyChatBot have to contain?

Four fields are required: client_id, page_id, platform and text. Optional fields are client_name, client_avatar, audio for a voice message and attachments for file or image URLs. Keep client_id stable so each user’s conversation continues.

How do the agent’s replies come back?

MyChatBot posts each reply to your Reply webhook URL as a form-encoded request with text, images, file and audio fields. A long reply may arrive as several parts sent one after another, so append them in order.

Does the Webhooks API support voice messages?

Yes, in both directions. Send an audio URL and MyChatBot transcribes it before the agent replies. Turn on Voice reply settings and choose a voice, and replies include an audio URL next to the text.

Why is the agent not replying to my messages?

The most common cause is a page_id mismatch or the channel being switched off. Check that the page_id you send exactly matches the Unique page_id and that Connect agent to this channel is on. A 400 response means a malformed request or a missing required field, and a 401 means the API token does not match.

Can an external system create leads or start outreach without a chat?

Yes, with Trigger Outreach in Automations. Your system POSTs a phone number or email, with optional name and context, to a trigger’s unique webhook URL, and MyChatBot creates the lead and can have the agent send a message. The URL itself is the credential, so treat it like a password.

Can an operator take over the conversation?

Yes. Handoff Control on the Agent configuration page switches a chat to operator mode by a stop word or by any operator message, and Silent handoff can hide the switch from the client. With Auto return on, the agent is re-enabled automatically after 24 hours or a custom interval.

Build on the MyChatBot API

Grab your API key, subscribe to events and ship your first integration in an afternoon.

Start free