Skip to main content
WA-Campaigns
API reference

Inbox API

Threads, one per phone number, and replying into them. An agent can triage the whole inbox read-only; replying is the one call here that reaches a real phone, bills the org, and honours every gate a human composer hits — opt-out, allowance, and the WhatsApp 24-hour window.

GET/conversationsconversations:read

List threads

The org's conversation threads, one per phone number, newest activity first. Archived threads are hidden. Filter by free text, unread, unassigned, a named assignee, or the campaign a thread was messaged in.

Arguments

NameTypeInDescription
searchstringqueryMatch the number or the resolved display name.
unreadbooleanqueryOnly threads with unanswered arrivals (unreadCount > 0). Org-wide, not per-viewer: a key is not a person and has no read state.
unassignedbooleanqueryOnly threads nobody owns.
assignedTostringqueryOnly threads owned by this Clerk user id.
broadcastIdstringqueryOnly threads this campaign was sent to.
pagenumberquery—
pageSizenumberquery—

Request

curl -X GET "https://rcs-templates-api-dot-msg2ai-server.ue.r.appspot.com/api/agent/conversations" \
  -H "Authorization: Bearer $WA_AGENT_KEY"

Same call, as a tool

# MCP tool name
list_conversations

# No CLI command for this call yet —
# use the HTTP route or the MCP tool.
GET/conversations/:idconversations:read

Read one thread

One thread in a single call: its meta, the most recent messages oldest-first, the contact summary (marketing status, tags, audiences), and whether the WhatsApp 24-hour service window is still open. Internal team notes are deliberately excluded.

Arguments

NameTypeInDescription
idrequiredstringpath—
limitnumberqueryHow many of the most recent messages to include.default: 50

Request

curl -X GET "https://rcs-templates-api-dot-msg2ai-server.ue.r.appspot.com/api/agent/conversations/<id>" \
  -H "Authorization: Bearer $WA_AGENT_KEY"

Same call, as a tool

# MCP tool name
get_conversation

# No CLI command for this call yet —
# use the HTTP route or the MCP tool.
POST/conversations/:id/replyconversations:write

Reply into a thread

Send free text (optionally with an image) or an approved template into a thread. This reaches a real phone and bills your org. Every gate a human operator hits applies unchanged: an opted-out number is refused, the allowance is enforced, WhatsApp free text needs the 24-hour window open — an approved template otherwise — and an RCS send always carries its SMS fallback. Where the thread has an outbound language set, free text is translated into it first, exactly as the composer does.

Arguments

NameTypeInDescription
idrequiredstringpath—
kindrequiredstringbody—text | template
textstringbodykind=text: the body. May be empty when mediaUrl carries the message.
mediaUrlstringbodykind=text: a public https image URL to attach.
blueprintIdstringbodykind=template: the org template to send.
variablesobjectbodykind=template: values for the template's {{variables}}.

Request

curl -X POST "https://rcs-templates-api-dot-msg2ai-server.ue.r.appspot.com/api/agent/conversations/<id>/reply" \
  -H "Authorization: Bearer $WA_AGENT_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": <string>
  }'

Same call, as a tool

# MCP tool name
reply

# No CLI command for this call yet —
# use the HTTP route or the MCP tool.
POST/conversations/:id/assignconversations:write

Assign or release

Give a thread an owner, or release it back to the pool by passing a null user id. The assignee is a bare user id and is not checked against the org roster, so a stale id degrades visibly to “assigned to someone who left” rather than failing the write.

Arguments

NameTypeInDescription
idrequiredstringpath—
userIdrequiredstring | nullbodyClerk user id to hand the thread to; null releases it.

Request

curl -X POST "https://rcs-templates-api-dot-msg2ai-server.ue.r.appspot.com/api/agent/conversations/<id>/assign" \
  -H "Authorization: Bearer $WA_AGENT_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "userId": <string | null>
  }'

Same call, as a tool

# MCP tool name
assign_conversation

# No CLI command for this call yet —
# use the HTTP route or the MCP tool.