List messages
List messages. View request and response details for this Samva email API endpoint.
GET
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.
apiKeyheader
x-api-key<token>limit?|nullcursor?stringchannel?stringValue in
"sms""whatsapp""email"direction?stringValue in
"outbound""inbound"status?stringValue in
"pending""scheduled""queued""processing""sent""delivered""read""failed""bounced""complained"conversationId?stringMatch
^conv_[0-9a-hjkmnp-tv-z]{16,24}$contactId?stringMatch
^contact_[0-9a-hjkmnp-tv-z]{16,24}$from?stringnamespaceId?Only this namespace's messages. A key scoped to a namespace always lists its own.
after?stringbefore?stringMessagePage
application/json- response
items*array<>nextCursor*string|nullimport { 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"}