Get email message details

Returns email delivery details for a message, optionally including signed URLs for its raw MIME, HTML, and text content.

GET
/v1/messages/{id}/email

Returns email delivery details for a message, optionally including signed URLs for its raw MIME, HTML, and text content.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

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

Query Parameters

includeDownloadUrls?boolean|null
urlExpiresIn?|null

Response Body

Success

application/json
  1. response
deliveries*array<>
id*MessageId
Match^msg_[0-9a-hjkmnp-tv-z]{16,24}$
organizationId*string
conversationId*|null
status*string
Value in"pending""scheduled""queued""processing""sent""delivered""read""failed""bounced""complained"
channel*string
Value in"sms""whatsapp""email"
direction*string
Value in"outbound""inbound"
subject*string|null
fromEmail*string
fromName*string|null
toEmails*array<>
ccEmails*array<>|null
bccEmails*array<>|null
replyToEmails*array<string>|null
messageIdHeader*string
inReplyTo*string|null
references*array<string>|null
threadPosition*|null
newContent*string|null
quotedContent*string|null
hasQuotedContent*boolean
dkimVerdict*|null
spfVerdict*|null
dmarcVerdict*|null
isAutoReply*boolean
autoReplyReason*|null
listUnsubscribeUrl*string|null
listUnsubscribeEmail*string|null
priority*|null
parsingErrors*array<string>|null
parsingDuration*|null
hasAttachments*boolean
attachmentCount*integer
Range0 <= value <= 9007199254740991
attachments*array<>
downloadUrls*|null
createdAt*string
receivedAt*|

When Samva's receiving server accepted the email; null for outbound email. The sender's Date header plays no part and stays in the raw MIME.

processedAt*string|null
Example Request
import { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.messages.getEmail({  "id": "example"});
Example Response
{  "deliveries": [    {      "scheduling": {        "dueAt": "string",        "expiresAt": "string",        "waitReason": "rate",        "reviewExpectedAt": "string"      },      "id": "string",      "messageId": "string",      "recipientId": "string",      "channel": "sms",      "status": "pending",      "attemptCount": 0,      "maxAttempts": 0,      "queuedAt": "string",      "claimedAt": "string",      "lastAttemptAt": "string",      "nextRetryAt": "string",      "sentAt": "string",      "deliveredAt": "string",      "readAt": "string",      "failedAt": "string",      "terminalAt": "string",      "errorCode": "string",      "errorMessage": "string",      "errorDetails": {        "code": "string",        "name": "string",        "message": "string",        "details": {          "property1": "string",          "property2": "string"        },        "retryable": true      },      "cost": "string",      "currency": "string",      "idempotencyKey": "string",      "createdAt": "string",      "updatedAt": "string"    }  ],  "id": "string",  "organizationId": "string",  "conversationId": "string",  "status": "pending",  "channel": "sms",  "direction": "outbound",  "subject": "string",  "fromEmail": "string",  "fromName": "string",  "toEmails": [    {      "email": "string",      "name": "string"    }  ],  "ccEmails": [    {      "email": "string",      "name": "string"    }  ],  "bccEmails": [    {      "email": "string",      "name": "string"    }  ],  "replyToEmails": [    "string"  ],  "messageIdHeader": "string",  "inReplyTo": "string",  "references": [    "string"  ],  "threadPosition": 0,  "newContent": "string",  "quotedContent": "string",  "hasQuotedContent": true,  "dkimVerdict": "pass",  "spfVerdict": "pass",  "dmarcVerdict": "pass",  "isAutoReply": true,  "autoReplyReason": "out-of-office",  "listUnsubscribeUrl": "string",  "listUnsubscribeEmail": "string",  "priority": "high",  "parsingErrors": [    "string"  ],  "parsingDuration": 0,  "hasAttachments": true,  "attachmentCount": 0,  "attachments": [    {      "id": "string",      "filename": "string",      "contentType": "string",      "size": 0,      "isInline": true,      "contentId": "string"    }  ],  "downloadUrls": {    "rawMime": "string",    "html": "string",    "text": "string",    "expiresAt": "string"  },  "createdAt": "string",  "receivedAt": "string",  "processedAt": "string"}

Related documentation