List messages

List messages. View request and response details for this Samva email API endpoint.

GET
/v1/messages

Returns message summaries, newest first (oldest first when filtered by conversation), with optional filters for channel, direction, status, conversation, contact, sender address, and creation time. Pass nextCursor back as cursor for the next page; it is null on the last page.

Authorization

apiKey
headerx-api-key<token>

Query Parameters

limit?|null
cursor?string
channel?string
Value in"sms""whatsapp""email"
direction?string
Value in"outbound""inbound"
status?string
Value in"pending""scheduled""queued""processing""sent""delivered""read""failed""bounced""complained"
conversationId?string
Match^conv_[0-9a-hjkmnp-tv-z]{16,24}$
contactId?string
Match^contact_[0-9a-hjkmnp-tv-z]{16,24}$
from?string
namespaceId?

Only this namespace's messages. A key scoped to a namespace always lists its own.

after?string
before?string

Response Body

MessagePage

application/json
  1. response
items*array<>
nextCursor*string|null
Example Request
import { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.messages.list({});
Example Response
{  "items": [    {      "id": "string",      "campaign": {        "campaignId": "string",        "runId": "string"      },      "channel": "sms",      "direction": "outbound",      "status": "pending",      "from": "string",      "to": [        "string"      ],      "subject": "string",      "waitReason": "rate",      "createdAt": "string"    }  ],  "nextCursor": "string"}

Related documentation