Call it
curl https://api.peume.com/v1/call/list-messages \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"limit": 100,
"sortOrder": "asc",
"conversationId": "your conversationId"
}
}'const res = await fetch("https://api.peume.com/v1/call/list-messages", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"limit": 100,
"sortOrder": "asc",
"conversationId": "your conversationId"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/list-messages",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"limit": 100,
"sortOrder": "asc",
"conversationId": "your conversationId"
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: list-messages.
Parameters
accountIdstringAccount ID. Optional: the account is taken from the conversation. Pass it when the conversation id is an Instagram thread id, or when the call answers 400 `missing_required_field` because the id matches conversations on more than one of your accounts.
limitintegerNumber of messages to return per page. Default 100, max 100.
Example: 100
cursorstringOpaque pagination cursor. Pass `pagination.nextCursor` from a prior response verbatim: a cursor we cannot parse returns 400 rather than silently restarting from the first page.
sortOrderstringOrder of returned messages. Default `asc` (oldest first, chat style). X, Instagram, Telegram, WhatsApp and Reddit honor this order across cursor pages. For Facebook and Bluesky, only intra-page ordering is affected. Pages always walk newest→oldest. See `sortOrderApplied` in the response.
asc · desc
Example: asc
conversationIdRequiredstringOpaque conversation identifier, accepted verbatim from the list endpoint or from the conversationId on inbox webhooks. Format not to be assumed.
