Messages

Send Message

Sends a message in a conversation. Instagram and Facebook also take attachments, quick replies, buttons and cards, within 24 hours of the person's last message. Supported on Bluesky, Instagram and Facebook.

POST
/v1/accounts/{id}/conversations/{conversationId}/messages

Authorization

Bearer
headerAuthorizationBearer <op_>

Workspace API key, sent as Authorization: Bearer op_... Keys are created in the dashboard.

Path Parameters

id*string
Length1 <= length
conversationId*string

A conversation id from List Conversations, Create Conversation or an inbox webhook. It only works in the workspace that received it.

Length1 <= length <= 512

Header Parameters

Idempotency-Key?string

A unique key, such as a UUID, that makes retrying this request safe. A repeat with the same key and body within 24 hours returns the first response instead of acting again. A 429 or 5xx response is not kept, so a retry with the same key runs again.

Length1 <= length <= 255

Request Body

application/json
  1. body
text*string

The message text, up to 1,000 characters on Bluesky, 1,000 on Instagram and 2,000 on Facebook. A longer text returns TEXT_TOO_LONG.

Length1 <= length <= 2000
attachmentUrl?string

Instagram and Facebook: public HTTPS URL of an image, video, audio file or PDF to attach. Cannot be combined with buttons or cards.

Formaturi
Lengthlength <= 2048
quickReplies?array<>

Instagram and Facebook: quick reply buttons under the message.

Itemsitems <= 13
buttons?array<>

Instagram and Facebook: buttons shown with the message.

Itemsitems <= 3
cards?array<>

Instagram and Facebook: cards shown as a swipeable carousel.

Itemsitems <= 10

Response Body

Sent message

application/json
  1. response
id*string

The platform's id for the message.

conversationId*string

A conversation id from List Conversations, Create Conversation or an inbox webhook.

text*|

The message text. Null for a message with only attachments.

senderId*string

The platform's id for the sender.

sentAt*|

When the message was sent. Null when the platform does not report it.

Formatdate-time
attachments*array<>

Instagram and Facebook: media attached to the message.

Example Request
import { Configuration, InboxApi } from "@onepostly/sdk";const inboxApi = new InboxApi(  new Configuration({ accessToken: process.env.ONEPOSTLY_API_KEY }));const response = await inboxApi.sendMessage({  id: "acc_YOUR_FACEBOOK_ACCOUNT_ID",  conversationId: "cnv_YOUR_CONVERSATION_ID",  sendMessageBody: {    "text": "Yes, we deliver on Sundays from 10:00 to 14:00."  },});console.log(response);
Example Response
{  "id": "m_Xq2b7KfRz1nT8vLp3sWcYd9GhJ0aMeU4oQiN5kB6xZtVrHlF2gDsAy7wEcP1uOjI3mK8nL",  "conversationId": "cnv_YOUR_CONVERSATION_ID",  "text": "Yes, we deliver on Sundays from 10:00 to 14:00.",  "senderId": "104987654321098",  "sentAt": "2027-03-15T12:05:31.000Z",  "attachments": []}