Skip to main content
These endpoints send messages as your business: what an agent would write from the inbox. To pass a message from a customer to the AI agent, use the AI service integration instead. Every request goes to https://back.leap.onclarity.com with Authorization: Bearer $CLARITY_API_KEY (see Authentication). Sends are asynchronous: a 200 means Clarity accepted the message and queued it for delivery on the ticket’s channel.

Reply on a ticket

POST /api/message/send writes into an existing ticket on whatever channel the ticket is on.
integer
required
The ticket to write to.
string
required
message (the customer sees it), private_note (only agents see it), or system_notification (a system line in the ticket timeline).
string
required
The message text.
integer[]
default:"[]"
Attachment ids from POST /api/attachment/upload. At most 5.
integer[]
For a private note: the agents to mention.
string[]
Email tickets only. The CC recipients. Omit it to reply to everyone on the thread; send [] to reply to the author only.
object[]
Buttons and other interactive elements to show under the message on channels that support them. See the API reference for the widget types.
string
When Clarity accepted the message.
string
The message’s id.
object[]
The attached files, each with id, original_url, thumbnail_url, mime_type, and original_filename.

Rules for mode: "message"

  • The ticket must have an assigned agent. Otherwise the request answers 400 ticket_no_agent. Assign one first with POST /api/ticket/assign/v2.
  • On a closed ticket the message is saved as a private note instead. Reopen the ticket first if the customer must receive it.
  • On WhatsApp, interactive widgets need an open 24-hour window: a customer message in the last 24 hours. When the window is closed and you call with an organization API key, the message is sent as plain text without the widgets. Outside the window, WhatsApp delivers only approved templates, which you send from the Clarity inbox.
  • On X, Instagram, and LinkedIn, the request answers 409 account_reauth_required when the connected account must be re-authenticated in Clarity.

Errors

Attachments

Upload a file first, then pass its id in files.
The request body can be up to 50 MB. A message carries at most 5 attachments.

See also

Customers and tickets

Assign tickets, change their status, and look up ids.

Webhooks

Get notified when the customer replies.