Mailboxes

Send a new message

Send a new message. View request and response details for this Samva email API endpoint.

POST
/v1/mailboxes/{id}/messages

Starts a new conversation from the mailbox's default endpoint on the channel the body names (email when omitted); a mailbox with no endpoint on that channel is refused (422). A message to a number joins the mailbox's thread with that number when it has one. Records a send action and returns 202 with its current receipt and a Location for action status. An installation, grant, or policy may require approval; otherwise the send is queued. Observe the same action through acceptance and mailbox completion. A policy refusal returns 403 with the recorded receipt.

x-api-key<token>

In: header

Path Parameters

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

Header Parameters

idempotency-key?|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

channel?|null
to*array<string>
Items1 <= items
cc?array<string>|null
bcc?array<string>|null
replyTo?array<string>|null
subject*string
Length1 <= length
text?string|null
html?string|null
attachments?array<>|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/mailboxes/string/messages" \  -H "Content-Type: application/json" \  -d '{    "to": [      "string"    ],    "subject": "string"  }'
{  "actionId": "string",  "draftId": "string",  "messageId": "string",  "threadId": "string",  "state": "approvalRequired",  "acceptedAt": "string",  "waitReason": "rate",  "reviewExpectedAt": "string",  "skippedRecipients": [    {      "address": "string",      "reason": "bounce",      "unsubscribeGroupId": "string"    }  ],  "executeUntil": "string",  "retryAt": "string",  "problem": {    "code": "string",    "message": "string",    "error": {      "_tag": "SenderNotReadyError",      "message": "string",      "sender": "string",      "retryAfterSeconds": 0    }  },  "retryEligible": true,  "decision": {    "outcome": "allow",    "reason": "string",    "policyId": "string",    "source": "grant",    "decidedAt": "string"  },  "createdAt": "string",  "updatedAt": "string"}

Related documentation