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.
BearerAuthorizationBearer <op_>Workspace API key, sent as Authorization: Bearer op_... Keys are created in the dashboard.
id*string1 <= lengthconversationId*stringA conversation id from List Conversations, Create Conversation or an inbox webhook. It only works in the workspace that received it.
1 <= length <= 512Idempotency-Key?stringA 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.
1 <= length <= 255application/json- body
text*stringThe 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.
1 <= length <= 2000attachmentUrl?stringInstagram and Facebook: public HTTPS URL of an image, video, audio file or PDF to attach. Cannot be combined with buttons or cards.
urilength <= 2048quickReplies?array<>Instagram and Facebook: quick reply buttons under the message.
items <= 13buttons?array<>Instagram and Facebook: buttons shown with the message.
items <= 3cards?array<>Instagram and Facebook: cards shown as a swipeable carousel.
items <= 10Sent message
application/json- response
id*stringThe platform's id for the message.
conversationId*stringA conversation id from List Conversations, Create Conversation or an inbox webhook.
text*|The message text. Null for a message with only attachments.
senderId*stringThe platform's id for the sender.
sentAt*|When the message was sent. Null when the platform does not report it.
date-timeattachments*array<>Instagram and Facebook: media attached to the message.
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);{ "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": []}