WoyraDocs
Get an API key

Cancel a scheduled email

POST/v1/emails/{id}/cancel

Emails · Requires an API key

Withdraws an email sent with scheduled_at before it leaves. Its status becomes canceled, the money held for it is released, any free allowance it used is given back, and it no longer counts toward today's sending limit. An email already sent, or leaving at this moment, cannot be cancelled.

Parameters

NameInDescription
idrequiredpath

Example

curl -X POST https://api.woyra.io/v1/emails/email_01J.../cancel \
  -H "Authorization: Bearer $WOYRA_KEY"

Response

200 The cancelled email.

FieldTypeDescription
objectrequired"email"
idrequiredstring
statusrequiredstring
One of accepted, scheduled, queued, sent, delivered, undelivered, failed, suppressed, canceled.
torequiredstringThe one address this copy went to.
fromrequiredstring
subjectrequiredstring
created_atrequiredtimestamp
scheduled_attimestampWhen a scheduled email leaves. Absent once it has.
recipientsarray of objectOn the answer to a send with more than one recipient: one copy per person, each its own email with its own id, status and webhooks. The first is this email.
recipients.tostring
recipients.idstring
recipients.statusstring
eventsarray of EmailEventOn GET /v1/emails/{id}: every status the email has had, oldest first, so a support ticket can be answered from one request.
metadataobject
thread_idstringThe conversation this email belongs to, readable at /v1/emails/threads/{thread_id}.
in_reply_tostringThe email this one answers, when it was sent as a reply.
routeRouteDecisionWhich carrier carried this message, why it was chosen, and what it cost. No other provider shows this.
errorErrorSummaryThe canonical failure reason, normalised across every carrier.

Errors

StatusCodes
400invalid_request, unsupported_version
401authentication_required, invalid_api_key
403insufficient_scope, domain_not_verified, recipient_suppressed, sending_paused, mfa_required
404not_found, product_not_offered

Also in Emails