Messages
List Messages
Lists the messages of a conversation, newest first. Supported on Bluesky, Instagram and Facebook.
GET
Bearerheader
AuthorizationBearer <op_>Workspace API key, sent as Authorization: Bearer op_... Keys are created in the dashboard.
id*stringLength
1 <= lengthconversationId*stringA conversation id from List Conversations, Create Conversation or an inbox webhook. It only works in the workspace that received it.
Length
1 <= length <= 512limit?integerItems per page. Defaults to 50. Maximum 100.
Range
1 <= value <= 100Default
50cursor?stringThe nextCursor of the previous page. Omit it for the first page.
Length
1 <= lengthMessages
application/json- response
data*array<>nextCursor*|Cursor for the next page, or null on the last page.
hasMore*booleanTrue when another page follows this one.
Example Request
import { Configuration, InboxApi } from "@onepostly/sdk";const inboxApi = new InboxApi( new Configuration({ accessToken: process.env.ONEPOSTLY_API_KEY }));const response = await inboxApi.listMessages({ id: "acc_YOUR_INSTAGRAM_ACCOUNT_ID", conversationId: "cnv_YOUR_CONVERSATION_ID",});console.log(response);Example Response
{ "data": [ { "id": "aWdfZAG1faXRlbToxOklHTWVzc2FnZAUlEOjE3ODQxNDAxMjM0NTY3ODk6MzQwMjgyMzY2ODQxNzEwMzAwOTQ5MTI4MTM2NDEyOTg3NjU0MzIxMDk4NzY1NDMy", "conversationId": "cnv_YOUR_CONVERSATION_ID", "text": "Do you ship to Canada?", "senderId": "6873452198765432", "sentAt": "2027-03-15T11:42:08.000Z", "attachments": [] }, { "id": "aWdfZAG1faXRlbToxOklHTWVzc2FnZAUlEOjE3ODQxNDAxMjM0NTY3ODk6MzQwMjgyMzY2ODQxNzEwMzAwOTQ5MTI4MTM2NDEyOTg3NjU0MzIxMDk4NzY1NDE5", "conversationId": "cnv_YOUR_CONVERSATION_ID", "text": "Yes, it is in stock in every size.", "senderId": "17841401234567890", "sentAt": "2027-03-15T11:40:02.000Z", "attachments": [] }, { "id": "aWdfZAG1faXRlbToxOklHTWVzc2FnZAUlEOjE3ODQxNDAxMjM0NTY3ODk6MzQwMjgyMzY2ODQxNzEwMzAwOTQ5MTI4MTM2NDEyOTg3NjU0MzIxMDk4NzY1NDA3", "conversationId": "cnv_YOUR_CONVERSATION_ID", "text": "Hi! Is this jacket still available?", "senderId": "6873452198765432", "sentAt": "2027-03-15T11:38:40.000Z", "attachments": [] }, { "id": "aWdfZAG1faXRlbToxOklHTWVzc2FnZAUlEOjE3ODQxNDAxMjM0NTY3ODk6MzQwMjgyMzY2ODQxNzEwMzAwOTQ5MTI4MTM2NDEyOTg3NjU0MzIxMDk4NzY1Mzk1", "conversationId": "cnv_YOUR_CONVERSATION_ID", "text": null, "senderId": "6873452198765432", "sentAt": "2027-03-15T11:38:15.000Z", "attachments": [ { "type": "image", "url": "https://lookaside.fbsbx.com/ig_messaging_cdn/?asset_id=18043219876543210&signature=AbxQ3kLm9pRtYv2WcZ8sN1" } ] } ], "nextCursor": null, "hasMore": false}