Skip to main content
The Channels API connects the chat in your system (app, website, customer portal) to the BluBash AI agent. Your server sends the message the user wrote, BluBash finds or creates the contact by contactIdentifier, forwards the message to the AI agent, and returns the reply in the same call, synchronously.
The API channel is inbound only: the conversation always starts with a message sent by your system. Conversations on this channel are handled by the AI agent, and the API response carries the AI agent’s messages. There is no transfer to a team member on this channel.

Before you start

  • Ask BluBash support to set up the API channel and give you its channelId.
  • Have the workspace API Key. See API introduction →.
  • Configure and test the AI agent that will handle the channel. See Test the AI agent →.

URL

Headers

Path parameters

string
required
ID of the API channel configured in the workspace.

Request body

string
required
Message type: TEXT, IMAGE, AUDIO, VIDEO, or DOCUMENT.
string
required
Unique identifier of the contact in your system. BluBash uses this value to create the contact on the first message and to find it on the next ones. We recommend the user’s email.
string
Contact name. Used when creating a new contact.
object
required
Message content. The format depends on type, as shown in the table below.
Always use the same contactIdentifier for the same person. Different values for the same user (for example, john@company.com in one call and an internal ID in another) create separate contacts and break the conversation history.

Request examples

Response example

The response structure is the same for every message type.

Response fields

boolean
required
Whether the operation completed.
string
required
ID of the contact created or found by contactIdentifier.
string
required
Conversation ID.
string
required
ID of the message sent in the request.
object
required
Conversation and assignment data.
array
required
The AI agent’s reply messages, from oldest to newest. It is a list because the AI agent can split its reply into several messages, depending on the Split Responses setting. Display all of them, in order.
object
required
Credit usage.

HTTP status codes

Integration examples

The response returns only after the AI agent finishes replying. Set a compatible timeout in your HTTP client and show a “typing” indicator to the user while waiting.

Limitations

Next steps

Train the AI agent

Teach the AI agent that handles the API channel.

Campaigns API

Feed ongoing WhatsApp campaigns from your system.