Skip to content
View as Markdown
Enter your site to enable Send. Requests are sent from your browser, so the site must allow cross-origin calls (CORS).

POST Send Thread Message​

POST
/messaging/threads/{id}/messages

Send a message into an existing conversation from the Inbox, on the thread's own channel. The send runs inline (no queue); the message row is written as pending before the provider is called and updated to sent or failed, so a request that dies leaves a record. On a provider failure the response is 422 and still carries sent_message (with status: failed and error_message).

Text (message_type omitted or text): content is required (422 Write a message first. when blank).

  • SMS: always allowed (no session window).
  • WhatsApp 24-hour rule: free-form text is accepted only while the contact's last inbound message is less than 24 hours old (session.has_active_session). Outside the window the call returns 409 This WhatsApp conversation is outside its 24-hour window, so only an approved template can be sent. Send a template instead.

Template (message_type = template): WhatsApp only (422 on SMS threads). Needs template_name and optionally template_language (or language); the template must be approved for the current provider (422 Pick an approved template.). Variables in template_variables are rendered against the thread's linked contact. The thread needs a phone number, and the provider must support templates (409 otherwise). Templates are allowed inside or outside the 24-hour window. The stored message content is the template body text.

409 is also returned when Pro is inactive or the channel is not configured/active. This endpoint does not check the thread's consent status; the profile-level POST /messaging/subscribers/{id}/send does. PRO (FluentCampaign Pro Messaging module).

Required capability: fcrm_read_emails or fcrm_manage_emails — which one applies depends on the action being performed.

Enforced by InboxPolicy::verifyRequest(), the policy default for this route group.

Requires: FluentCampaign Pro with the Messaging module enabled. While no messaging channel (SMS or WhatsApp) is switched on the route is not registered at all and returns a 404.

Authorizations​

ApplicationPasswords

WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password

Type
API Key (header: Authorization)

Parameters​

Path Parameters

id*

Message thread ID.

Type
integer
Required

Request Body​

application/json
JSON
{
"message_type": "text",
"content": "string",
"template_name": "string",
"template_language": "string",
"template_variables": {
"additionalProperties": "string"
}
}

Responses​

Message sent.

application/json
JSON
{
"sent_message": {
"id": 0,
"thread_id": 0,
"direction": "string",
"message_type": "string",
"content": "string",
"template_name": "string",
"media": [
{
}
],
"status": "string",
"error_message": "string",
"created_at": "string"
},
"message": "string"
}

Playground​

Authorization
Variables
Key
Value
Body

Samples​

Powered by VitePress OpenAPI