Send a new message
Send a new message. View request and response details for this Samva email API endpoint.
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.
apiKeyx-api-key<token>id*string^mbx_[0-9a-hjkmnp-tv-z]{16,24}$idempotency-key?stringOptional key that makes a mailbox send idempotent for the calling key or member. Repeating the request with the same key and body returns the original action in its current state. Keep the key after a lost response. Reusing it with different content returns 409. Active actions retain their key; terminal receipts remain replayable for 24 hours.
^[\s\S]{1,255}$application/json- body
channel?|nullto*array<string>1 <= itemscc?array<string>|nullbcc?array<string>|nullreplyTo?array<string>|nullsubject*string1 <= lengthtext?string|nullhtml?string|nullattachments?array<>|nullMailboxSendReceipt
application/json- response
actionId*MailboxActionId^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$draftId*|nullmessageId*|nullthreadId*|nullstate*string"approvalRequired""queued""accepted""completed""notSent""uncertain"acceptedAt*string|nullwaitReason*|nullreviewExpectedAt*string|nullskippedRecipients*array<>executeUntil*string|nullretryAt*string|nullproblem*|nullretryEligible*booleandecision*|nullcreatedAt*stringupdatedAt*stringimport { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.mailboxes.sendMessage({ "id": "example", "to": [ "example" ], "subject": "example"});{ "actionId": "string", "draftId": "string", "messageId": "string", "threadId": "string", "state": "approvalRequired", "acceptedAt": "string", "waitReason": "rate", "reviewExpectedAt": "string", "skippedRecipients": [ { "address": "string", "reason": "bounce", "topicId": "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
Send a draft
Sends one of the caller's drafts: a reply draft in its thread, any other draft as a new conversation. A draft needs recipients, a subject, and a body.
Update a mailbox
Update a mailbox. Updates the fields you name and keeps the rest. `metadata` merges into the stored metadata by key, and a `null` value deletes that key.