Skip to content

Cancel a scheduled email

POST
/emails/{id}/cancel
curl --request POST \
--url https://api.vaartix.com/emails/em_7hq2kv9xr4m1c8d3/cancel \
--header 'Authorization: Bearer <token>'

Cancels an email that is still scheduled. Its recipients are given back to today’s daily limit. Emails that are already being sent cannot be canceled.

id
required
string

Example

em_7hq2kv9xr4m1c8d3

The canceled email.

Media typeapplication/json
object
id
string
from
string
to
Array<string>
cc
Array<string>
bcc
Array<string>
replyTo
Array<string>
subject
string
status

See the status guide for what each one means.

string
Allowed values: queued scheduled sending sent delivered delivery_delayed bounced complained suppressed failed canceled
tags
Array<object>
object
name
required
string
/^[A-Za-z0-9_-]{1,256}$/
value
required
string
/^[A-Za-z0-9_-]{1,256}$/
attachments

Attachment details (the content is not kept after sending).

Array<object>
object
filename
string
contentType
string
size

Size in bytes.

integer
scheduledAt
string | null format: date-time
sentAt
string | null format: date-time
lastEventAt
string | null format: date-time
error

Why the email failed, if it did.

string | null
createdAt
string format: date-time

Example

{
"status": "queued",
"tags": [
{
"name": "category",
"value": "receipt"
}
]
}

unauthorized: the API key is missing, invalid or revoked.

Media typeapplication/json
object
error
required
object
type
required

Stable, machine-readable error type.

string
Allowed values: validation_error unauthorized forbidden not_found conflict rate_limited daily_quota_exceeded domain_not_verified invalid_from_address account_paused idempotency_conflict bad_request internal_error
message
required

Human-readable explanation, safe to show to developers.

string

Example

{
"error": {
"type": "validation_error"
}
}

forbidden: the key cannot do this, for example a send-only key on a management endpoint.

Media typeapplication/json
object
error
required
object
type
required

Stable, machine-readable error type.

string
Allowed values: validation_error unauthorized forbidden not_found conflict rate_limited daily_quota_exceeded domain_not_verified invalid_from_address account_paused idempotency_conflict bad_request internal_error
message
required

Human-readable explanation, safe to show to developers.

string

Example

{
"error": {
"type": "validation_error"
}
}

not_found: no such resource in your team.

Media typeapplication/json
object
error
required
object
type
required

Stable, machine-readable error type.

string
Allowed values: validation_error unauthorized forbidden not_found conflict rate_limited daily_quota_exceeded domain_not_verified invalid_from_address account_paused idempotency_conflict bad_request internal_error
message
required

Human-readable explanation, safe to show to developers.

string

Example

{
"error": {
"type": "validation_error"
}
}

conflict: only scheduled emails can be canceled.

Media typeapplication/json
object
error
required
object
type
required

Stable, machine-readable error type.

string
Allowed values: validation_error unauthorized forbidden not_found conflict rate_limited daily_quota_exceeded domain_not_verified invalid_from_address account_paused idempotency_conflict bad_request internal_error
message
required

Human-readable explanation, safe to show to developers.

string

Example

{
"error": {
"type": "validation_error"
}
}