Skip to main content
POST
/
inbox
/
conversations
/
{id}
/
messages
Send a message in a conversation
curl --request POST \
  --url https://api.social-api.ai/v1/inbox/conversations/{id}/messages \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "account_id": "acc_abc123",
  "attachment_url": "https://cdn.example.com/photo.jpg",
  "attachments": [
    {
      "source": "550e8400-e29b-41d4-a716-446655440000",
      "source_type": "media_id",
      "type": "image"
    }
  ],
  "buttons": [
    {
      "payload": "VIEW_ORDER",
      "title": "View order",
      "type": "url",
      "url": "https://shop.example.com/orders/1"
    }
  ],
  "cards": [
    {
      "buttons": [
        {
          "payload": "VIEW_ORDER",
          "title": "View order",
          "type": "url",
          "url": "https://shop.example.com/orders/1"
        }
      ],
      "image_url": "https://cdn.example.com/p.jpg",
      "subtitle": "Short description",
      "title": "Product name"
    }
  ],
  "message_tag": "HUMAN_AGENT",
  "quick_replies": [
    {
      "payload": "TRACK_ORDER",
      "title": "Track my order"
    }
  ],
  "reply_to_message_id": "m_1234567890",
  "text": "Thanks for your message!"
}
'
{
  "message_id": "m_1234567890",
  "message_ids": [
    "m_1234567890"
  ],
  "success": true
}

Authorizations

Authorization
string
header
required

Prefix your API key with "Bearer ". Example: Authorization: Bearer sapi_key_...

Path Parameters

id
string
required

Conversation ID

Body

application/json

Message payload

account_id
string
required
Example:

"acc_abc123"

attachment_url
string

AttachmentURL is a single-attachment shorthand. Ignored when attachments is non-empty; its type is inferred from the URL extension.

Deprecated: use Attachments instead, which supersedes it and supports one or many items.

Example:

"https://cdn.example.com/photo.jpg"

attachments
object[]

Attachments sends one or more media items, each as its own message bubble.

buttons
object[]

Buttons renders a button template (1-3 buttons); uses text as the bubble body.

cards
object[]

Cards renders a generic/carousel template (up to 10 cards).

message_tag
string

MessageTag attaches a Meta message tag so the DM can be sent outside the standard 24-hour window. Instagram/Facebook only. Instagram accepts only HUMAN_AGENT; Facebook also accepts ACCOUNT_UPDATE, CONFIRMED_EVENT_UPDATE, CUSTOMER_FEEDBACK, POST_PURCHASE_UPDATE. Requires Meta "Human Agent" advanced access for HUMAN_AGENT. Ignored by non-Meta platforms. For beta testers replying on Facebook Messenger, HUMAN_AGENT is applied automatically when this field is omitted.

Example:

"HUMAN_AGENT"

quick_replies
object[]

QuickReplies renders up to 13 tappable chips above the keyboard; requires text.

reply_to_message_id
string

ReplyToMessageID makes the first sent bubble a reply to a specific prior message (Meta message.reply_to.mid). Instagram/Facebook only.

Example:

"m_1234567890"

text
string
Example:

"Thanks for your message!"

Response

Message sent with ID

message_id
string

MessageID is the first sent message's ID; for a multi-attachment send it is only the first of several IDs.

Deprecated: use MessageIDs instead.

Example:

"m_1234567890"

message_ids
string[]

MessageIDs holds every sent message's ID, in send order.

Example:
["m_1234567890"]
success
boolean
Example:

true