Skip to main content
POST
Send a channel message as a chat agent
This operation supports WhatsApp only. The target chat agent must have a connected WhatsApp number. Use a message inside the 24-hour messaging window. Outside that window, send an approved template. The key needs Send channel messages and access to the target agent.

Authorizations

Authorization
string
header
required

An API key (tars_sk_…) sent as Authorization: Bearer <key>. Each operation names the permission it needs. Create keys in Settings → Integrations → API keys.

Body

application/json

A WhatsApp template or message sent as a chat agent.

agentId
string
required

The chat agent id.

Maximum string length: 128
channel
enum<string>
required
Available options:
whatsapp
to
string
required

The recipient in international format.

type
enum<string>
required
Available options:
template,
message
template
object

Required when type is template.

message
object

Required when type is message.

Response

The message was sent.

The message that was sent.

messageType
enum<string>
required
Available options:
template,
message
channel
any
required
messageId
string

The provider's message id, when it returned one. Use it to match delivery events.