Messages
Create Conversation
Starts a one-to-one conversation. On Instagram and Facebook it can be read once it has a 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 <= lengthIdempotency-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
recipient*stringWho to message: a Bluesky handle or DID, an Instagram username or user id, or a Facebook page-scoped user id.
1 <= length <= 256Conversation
application/json- response
id*stringA conversation id from List Conversations, Create Conversation or an inbox webhook.
accountId*stringmembers*array<>The people in the conversation.
muted*booleanBluesky: true when the account muted the conversation. Always false on Instagram and Facebook.
unreadCount*integerMessages the account has not read yet. 0 when the platform does not report it.
lastMessage*|The newest message. Null when the platform does not include it in the list.
import { Configuration, InboxApi } from "@onepostly/sdk";const inboxApi = new InboxApi( new Configuration({ accessToken: process.env.ONEPOSTLY_API_KEY }));const response = await inboxApi.createConversation({ id: "acc_YOUR_BLUESKY_ACCOUNT_ID", createConversationBody: { "recipient": "alice.bsky.social" },});console.log(response);{ "id": "cnv_xZWwUFsb6q2nrlD7GUiqQxNHfiqbgdNAjqlcvDLTpafW1UHpqYkJAIRnqf5uJ71zS3gigSZp", "accountId": "acc_YOUR_BLUESKY_ACCOUNT_ID", "members": [ { "id": "did:plc:4y7hqd2kz3rbe6mfxw5tnc2a", "username": "yourbrand.bsky.social", "displayName": "Your Brand" }, { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "alice.bsky.social", "displayName": "Alice" } ], "muted": false, "unreadCount": 0, "lastMessage": null}