Schedule a mailbox draft
Schedule a mailbox draft. Changes the caller's private scheduled sends. The revision and idempotency key protect retries and concurrent changes.
POST
Changes the caller's private scheduled sends. The revision and idempotency key protect retries and concurrent changes. Sending uses the mailbox's current permissions and policies.
apiKeyheader
x-api-key<token>id*stringMatch
^mbx_[0-9a-hjkmnp-tv-z]{16,24}$draftId*stringMatch
^mdraft_[0-9a-hjkmnp-tv-z]{16,24}$application/json- body
idempotencyKey*stringMatch
^[A-Za-z0-9_-]{8,128}$base*stringMatch
^[A-Za-z0-9_-]{1,64}\.(0|[1-9]\d{0,15})\.[A-Za-z0-9_-]{1,64}$draftRevision*integerRange
1 <= value <= 9007199254740991sendAt*stringMailCommandReceipt
application/json- response
idempotencyKey*stringMatch
^[A-Za-z0-9_-]{8,128}$type*stringValue in
"thread.patch""thread.labels""draft.create""draft.update""draft.delete""send""outbox.reschedule""outbox.sendNow""outbox.review""outbox.cancel"outcome*stringValue in
"applied""conflict""held""queued""cancelled""failed"position*|nullconflict*|nulldraft*|nulloutbox*|nullsend*|nullimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.mailboxes.scheduleDraft({
"id": "example",
"draftId": "example",
"idempotencyKey": "example",
"base": "example",
"draftRevision": 1,
"sendAt": "example"
});Example Response
{
"idempotencyKey": "string",
"type": "thread.patch",
"outcome": "applied",
"position": {
"epoch": "string",
"seq": 0
},
"conflict": {
"code": "draftChanged",
"message": "string",
"currentRevision": 1
},
"draft": {
"id": "string",
"revision": 1
},
"outbox": {
"id": "string",
"mailboxId": "string",
"threadId": "string",
"draftId": "string",
"draftRevision": 1,
"draftSummary": {
"to": [
"string"
],
"subject": "string"
},
"status": "queued",
"scheduledFor": "string",
"holdReason": "threadChanged",
"revision": 1,
"baseSeq": 0,
"heldAtSeq": 0,
"actionId": "string",
"problem": {
"code": "string",
"message": "string"
},
"createdAt": "string",
"updatedAt": "string"
},
"send": {
"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": {
"id": "string",
"reviewRound": 1,
"requirement": "run",
"decider": "rule",
"outcome": "allow",
"reason": "string",
"scopes": [
{
"kind": "organization",
"id": "string"
}
],
"rule": {
"scope": {
"kind": "organization",
"id": "string"
},
"index": 0
},
"guard": "string",
"guardReason": "string",
"resolution": {
"by": "string",
"at": "string",
"as": "approved",
"diff": {
"text": {
"before": "string",
"after": "string"
},
"html": {
"before": "string",
"after": "string"
}
}
}
},
"createdAt": "string",
"updatedAt": "string"
}
}