Cancel a letter that has not yet been dispatched
Cancels a letter and returns it with status: "canceled".
Cancels a letter and returns it with status: "canceled". A letter is cancelable while it is draft, queued, processing, printable, or submitted; once it is in_transit or in a terminal state the call responds 409 with code letter_not_cancelable, and an unknown id is a 404. Cancellation is a status transition, so it emits a letter.status_changed webhook event.
Scope: letters:send. Send the API key as a bearer token; Scopes lists what each one reaches.
Request
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The letter's ID. |
Response
200 Success. Body: application/json, Letter.
| Field | Type | Required | Description |
|---|---|---|---|
object | "letter" | yes | |
id | string | yes | |
status | LetterStatus | yes | |
fileName | string or null | no | |
pageCount | integer or null | no | |
to | PostalAddress | no | |
from | PostalAddress or null | no | |
print | LetterPrintOptions | no | |
delivery | LetterDelivery | no | |
paperTypes | array of LetterPaperType | no | |
autoSend | boolean | no | |
price | LetterMoney or null | no | |
metadata | object | no | |
lastEventType | string or null | no | The type of the newest event on the letter's timeline (e.g. processing, canceled); null until the letter has an event. |
lastEventAt | string (date-time) or null | no | When the newest timeline event occurred; null until the letter has an event. |
submittedAt | string (date-time) or null | no | |
canceledAt | string (date-time) or null | no | |
error | string or null | no | |
createdAt | string (date-time) or null | no | |
updatedAt | string (date-time) or null | no | |
events | array of LetterEvent | no | |
paymentSlip | "qr", "sepaDe", "sepaAt", null | no | The chosen payment-slip overlay, or null for a normal letter. |
dryRun | boolean | no | True for a validate/price-only letter that is never mailed or charged. |
providerMode | "test", "live" | no | test: the letter is validated and priced but never printed, mailed, or charged (a dry run, or the account's provider mode is test). live: it will be printed and posted. |
notifications | boolean | no | Owner milestone-email preference for this letter. |
payment | LetterPayment or null | no | The structured payment object the slip was generated from (owner records), or null. |
batchId | string or null | no | The owning batch id for a batch-member letter; null for a single send. Pairs with the ?batchId= list filter. |
Errors
Every error has the same body, {"error": {"type", "code", "message", "param"}}; branch on code. Errors lists every code.
| Status | Meaning |
|---|---|
400 | The request is malformed or a value is invalid (invalid_request, invalid_domain, idempotency_key_mismatch). |
401 | The API key is missing or invalid. |
403 | The key lacks the scope this endpoint needs (scope_missing) or may not do this (not_permitted). |
404 | No such resource in this account (resource_not_found). |
422 | The request is well-formed but a field failed validation (validation_failed). |
429 | Rate limit, plan limit, budget or spend cap reached (rate_limited, plan_limit_reached, budget_exceeded, spend_cap_reached). |
500 | An unexpected error; retry with backoff, then contact support (internal_error). |
Get one letter with its delivery-event timeline
Returns the full letter, including the complete to/from addresses (list items carry only city and country), the price, and an inline events timeline holding the 100 most recent events, newest first.
List a letter's delivery events
Returns the letter's delivery timeline as letter_event objects, newest first, capped at the 100 most recent.