Skip to Content

Get a message

Returns a message by its ID: addresses, subject, status, and why it is waiting when it is. Per-recipient delivery state and the body are their own reads.

GET
/v1/messages/{id}

Returns a message by its ID: addresses, subject, status, and why it is waiting when it is. Per-recipient delivery state and the body are their own reads.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

id*string
Match^msg_[0-9a-hjkmnp-tv-z]{16,24}$

Response Body

Message

application/json
  1. response
id*MessageId
Match^msg_[0-9a-hjkmnp-tv-z]{16,24}$
campaign?|null
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"
from*|null
to*array<>
cc*array<>
bcc*array<>
replyTo*array<string>
subject*string|null
conversationId*|null
inReplyToMessageId*|null
tags*array<string>
metadata*|null
isTest*boolean
scheduledAt*string|null
submission*|null
waitReason*|null
reviewExpectedAt*string|null
skippedRecipients*array<>
createdAt*string
updatedAt*string
Example Request
import { createClient } from "samva";

const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });

const result = await samva.messages.get({
  "id": "example"
});
Example Response
{
  "id": "string",
  "campaign": {
    "campaignId": "string",
    "runId": "string"
  },
  "channel": "sms",
  "direction": "outbound",
  "status": "pending",
  "from": {
    "address": "string",
    "name": "string"
  },
  "to": [
    {
      "address": "string",
      "contactId": "string"
    }
  ],
  "cc": [
    {
      "address": "string",
      "contactId": "string"
    }
  ],
  "bcc": [
    {
      "address": "string",
      "contactId": "string"
    }
  ],
  "replyTo": [
    "string"
  ],
  "subject": "string",
  "conversationId": "string",
  "inReplyToMessageId": "string",
  "tags": [
    "string"
  ],
  "metadata": {
    "property1": "string",
    "property2": "string"
  },
  "isTest": true,
  "scheduledAt": "string",
  "submission": {
    "origin": "direct",
    "transport": "http",
    "credential": {
      "kind": "api_key",
      "apiKeyId": "string"
    },
    "userId": "string",
    "client": {
      "surface": "typescript-promise",
      "version": "string"
    }
  },
  "waitReason": "rate",
  "reviewExpectedAt": "string",
  "skippedRecipients": [
    {
      "address": "string",
      "reason": "bounce",
      "topicId": "string"
    }
  ],
  "createdAt": "string",
  "updatedAt": "string"
}

Related documentation