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.

POST
/v1/accounts/{id}/conversations

Authorization

Bearer
headerAuthorizationBearer <op_>

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

Path Parameters

id*string
Length1 <= length

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
recipient*string

Who to message: a Bluesky handle or DID, an Instagram username or user id, or a Facebook page-scoped user id.

Length1 <= length <= 256

Response Body

Conversation

application/json
  1. response
id*string

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

accountId*string
members*array<>

The people in the conversation.

muted*boolean

Bluesky: true when the account muted the conversation. Always false on Instagram and Facebook.

unreadCount*integer

Messages 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.

Example Request
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);
Example 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}