Skip to main content
Documentation

Comms

comms.list_messages

List messages in one thread, or across the shop, newest first
Read-onlyRead budget

REST

Shipping
POST /api/v1/comms/list_messages

MCP tool

Live
comms.list_messages

Exposed on: REST API · Shop MCP server · Claude connector · Dash (in-app copilot) · Zapier. Part of the Comms domain.

Operating contract

TWO MODES, and picking the right one is most of the value here. Pass conversation for DEPTH — one thread, in full, the way a person reads it. Omit it for BREADTH — the shop's whole message log, newest first, which is what a daily summary is built from. customer_id narrows either mode to one person.

Every message carries its direction (inbound is the customer, outbound is the shop), its channel (sms or email) and its delivery status. STATUS IS NOT A DECORATION: sent means handed to the carrier, delivered means it arrived, and failed means the customer never saw it. Telling a shop 'we texted them' about a failed row is the single most misleading thing this capability can be used to do — say it failed.

This returns TYPED messages. A phone call is not a message row: it does not appear here whatever happened on it, and comms.list_calls plus comms.get_call_transcript are how the spoken half of a customer's history is read. A summary built from this alone will confidently omit every call.

Each result's id is the message id comms.get_message and tasks.create's message_id take. conversation is the thread, for comms.update_conversation and comms.schedule_message.

TRUNCATION: total is the exact number of matching messages and omitted how many are NOT in this response. Because this is newest-first, a non-zero omitted means you are missing the OLDEST part of the history — which is where the thread started and where anything was first promised. Call again with offset set to next_offset before answering a question about how something began.

Who may call it

Permission
inbox.accessThe caller must hold Inbox at the ACT level. A read-only dashboard grant on the same section is refused.
Plan
Every planNo plan gate. Available on every Service VIN plan.
Retries
naturalNaturally idempotent — running it twice leaves the same world as running it once. A retrying integration needs no key.
Rate class
readCounted against the read budget — the widest of the four.

Partial answers

omitted is how many matching records are not in the response, and 0 is a real answer meaning you have all of them. Continue with next_offset.

Do not summarise from a truncated response

When `omitted` is not 0 you are missing the OLDER half of this history — results are newest-first. Call again with `offset` set to `next_offset`.

Input

FieldTypeDescription
conversationstringuuid

One thread, as returned by comms.list_conversations. Omit for the whole shop.

customer_idstringuuid

Only this customer's messages, as returned by customers.list or comms.resolve_contact.

channelstring

Only messages on this channel.

One of: sms, email
directionstring

`inbound` is what the customer sent; `outbound` is what the shop sent.

One of: inbound, outbound
sincestringmax 40 chars

ISO instant. Only messages at or after it — a daily summary passes midnight.

limitinteger1–100

How many messages to return, 1-100. Defaults to 25.

Default: 25
offsetintegermin 0

How many to skip. Pass the previous response's next_offset to continue.

Default: 0

Output

FieldTypeDescription
itemsobject[]

items[].idstring

items[].conversationstring

items[].customer_idstring | null

items[].channelstring

items[].directionstring

items[].bodystring | null

items[].fromstring | null

items[].tostring | null

items[].statusstring

items[].created_atstring

totalnumber

omittednumber

next_offsetnumber | null

Examples

Built from this capability's own schema — required fields and the ones carrying a default, and nothing invented. Paste one and it validates.

curl
export SERVICEVIN_API_KEY=svk_live_…

curl -X POST https://www.servicevin.com/api/v1/comms/list_messages \
  -H "Authorization: Bearer $SERVICEVIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":25,"offset":0}'

TypeScript (fetch)
const res = await fetch("https://www.servicevin.com/api/v1/comms/list_messages", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.SERVICEVIN_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "limit": 25,
    "offset": 0
  }),
});

// Success and failure are both envelopes. Switch on error.code, never
// on error.message — the codes are stable, the messages are for people.
const payload = await res.json();
if (!res.ok) throw new Error(payload.error.code);
const data = payload.data;

Python (requests)
import os, requests

res = requests.post(
    "https://www.servicevin.com/api/v1/comms/list_messages",
    headers={"Authorization": f"Bearer {os.environ['SERVICEVIN_API_KEY']}"},
    json={
    "limit": 25,
    "offset": 0
},
    timeout=30,
)
payload = res.json()
if not res.ok:
    raise RuntimeError(payload["error"]["code"])
data = payload["data"]

MCP tools/call — https://www.servicevin.com/api/mcp
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "comms.list_messages",
    "arguments": {
      "limit": 25,
      "offset": 0
    }
  }
}

Refusals

The four gates run in this order on every surface, and the order is not arbitrary — see Authentication.

StatusCodeWhen
404not_foundThe id is unknown, or the feature is not enabled for this account. Deliberately the same answer for both.
403forbiddenThis login does not hold inbox.access.
422validation_errorAn argument was wrong. The message names the field.
429rate_limitedToo many read calls. Back off and retry.
500internal_errorSomething failed on our side. Nothing was changed.