Mailboxes
Create a draft
Saves a draft of a new message, or of a reply when `inReplyToMessageId` names a message in the mailbox, and returns it with status 201.
POST
Saves a draft of a new message, or of a reply when inReplyToMessageId names a message in the mailbox, and returns it with status 201. A phone channel's draft holds a recipient number and text. Send it with POST /v1/mailboxes/{id}/drafts/{draftId}/send.
apiKeyheader
x-api-key<token>id*stringMatch
^mbx_[0-9a-hjkmnp-tv-z]{16,24}$application/json- body
channel?|nullendpointId?|nullto?array<string>|nullcc?array<string>|nullbcc?array<string>|nullreplyTo?array<string>|nullsubject?string|nulltext?string|nullhtml?string|nullattachments?array<>|nullinReplyToMessageId?|nullSuccess
application/json- response
id*MailboxDraftIdMatch
^mdraft_[0-9a-hjkmnp-tv-z]{16,24}$channel*"email"Value in
"email"threadId*|nullinReplyToMessageId*|nullstate*MailboxDraftStateValue in
"saved""locked""sent"lockedByActionId*|nullto*array<string>subject*string|nullcreatedAt*stringupdatedAt*stringendpointId*|nullcc*array<string>bcc*array<string>replyTo*array<string>html*string|nulltext*string|nullattachments*array<>Items
items <= 10import { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.mailboxes.createDraft({ "id": "example"});Example Response
{ "id": "string", "channel": "email", "threadId": "string", "inReplyToMessageId": "string", "state": "saved", "lockedByActionId": "string", "to": [ "string" ], "subject": "string", "createdAt": "string", "updatedAt": "string", "endpointId": "string", "cc": [ "string" ], "bcc": [ "string" ], "replyTo": [ "string" ], "html": "string", "text": "string", "attachments": [ { "filename": "string", "content": "string", "mediaId": "string", "contentType": "string", "size": 1 } ]}