Skip to Content

Return a scheduled send to Drafts

Return a scheduled send to Drafts. Changes the caller's private scheduled sends. The revision and idempotency key protect retries and concurrent changes.

DELETE
/v1/mailboxes/{id}/scheduled/{outboxId}

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.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

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

Request Body

application/json
  1. body
idempotencyKey*string
Match^[A-Za-z0-9_-]{8,128}$
base*string
Match^[A-Za-z0-9_-]{1,64}\.(0|[1-9]\d{0,15})\.[A-Za-z0-9_-]{1,64}$
expectedRevision*integer
Range1 <= value <= 9007199254740991

Response Body

MailCommandReceipt

application/json
  1. response
idempotencyKey*string
Match^[A-Za-z0-9_-]{8,128}$
type*string
Value in"thread.patch""thread.labels""draft.create""draft.update""draft.delete""send""outbox.reschedule""outbox.sendNow""outbox.review""outbox.cancel"
outcome*string
Value in"applied""conflict""held""queued""cancelled""failed"
position*|null
conflict*|null
draft*|null
outbox*|null
send*|null
Example Request
import { createClient } from "samva";

const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });

const result = await samva.mailboxes.unscheduleSend({
  "id": "example",
  "outboxId": "example",
  "idempotencyKey": "example",
  "base": "example",
  "expectedRevision": 1
});
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"
  }
}

Related documentation