Skip to content
AI Inbx
Esc
navigateopen⌘Jpreview

Cancel a scheduled email

Cancels a scheduled email before it is composed and sent. Cancellation is terminal — a canceled message cannot be rescheduled back into flight.

POST/emails/{email_id}/cancel
Authorization
AuthorizationBearer token (API key) · headerrequired
Pass an AI Inbx API key as a Bearer token.
Path parameters
email_idstringrequired
The prefixed email ID.
matches ^[a-z]+_[0-9a-f]{32}$
Responses
200Success.
idstringrequired
matches ^[a-z]+_[0-9a-f]{32}$
thread_idstringrequired
matches ^[a-z]+_[0-9a-f]{32}$
space_idstring | anyrequired
Which space a resource is in. Null is the workspace itself — what every resource of a workspace that has no spaces says.
Show properties
Any of:
string
string
any
any
directionstringrequired
Allowed:inboundoutbound
statusstringrequired
Allowed:scheduledcanceledqueuedsendingsentdeliveredbouncedcomplainedfailedreceived
fromobjectrequired
Show properties
namestring | any
Show properties
Any of:
string
string
any
any
addressstring<email>required
matches ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
tostring<email>[]required
ccstring<email>[]
bccstring<email>[]
reply_tostring<email>[]
subjectstringrequired
snippetstringrequired
htmlstring | any
Show properties
Any of:
string
string
any
any
textstring | any
Show properties
Any of:
string
string
any
any
categorystring | anyrequired
Show properties
Any of:
string
string
any
any
suppression_keystring | anyrequired
Show properties
Any of:
string
string
any
any
message_idstringrequired
in_reply_tostring | anyrequired
Show properties
Any of:
string
string
any
any
idempotency_keystring | anyrequired
Show properties
Any of:
string
string
any
any
created_atstring<date-time>required
matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
scheduled_atstring<date-time> | anyrequired
Show properties
Any of:
string<date-time>
string<date-time>
any
any
sent_atstring<date-time> | anyrequired
Show properties
Any of:
string<date-time>
string<date-time>
any
any
attachmentsobject[]
Show properties
Array of object
idstringrequired
matches ^[a-z]+_[0-9a-f]{32}$
filenamestringrequired
content_typestringrequired
sizeintegerrequired
min 0 · max 9007199254740991
cidstring | anyrequired
Show properties
Any of:
string
string
any
any
download_urlstring<uri>required
preparationobject | anyrequired
Show properties
Any of:
object
statusstringrequired
Allowed:readypartialunsupportedfailed
formatstring | anyrequired
Show properties
Any of:
string
string
any
any
pagesinteger | anyrequired
Show properties
Any of:
integer
integer
any
any
warningsstring[]required
content_urlstring<uri> | anyrequired
Show properties
Any of:
string<uri>
string<uri>
any
any
textstring | any
Show properties
Any of:
string
string
any
any
any
any
400The request is invalid.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
401The API key is missing or invalid.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
403The API key does not have the required scope.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
404The requested resource does not exist.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
409The request conflicts with the resource's current state.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
413The request body or attachments are too large.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
415The request body is not JSON.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
422The request body failed validation.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
429The organisation's request budget is spent (`too_many_requests`), or an upstream mail provider is throttling (`rate_limited`).
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
500An internal error occurred.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
502An upstream mail provider failed.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
503The service is temporarily unavailable.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
Request
curl -X POST "https://api.aiinbx.com/api/v2/emails/string/cancel" \
  -H "Authorization: Bearer YOUR_TOKEN"
Response
{
  "id": "string",
  "thread_id": "string",
  "space_id": "string",
  "direction": "inbound",
  "status": "scheduled",
  "from": {
    "name": "string",
    "address": "user@example.com"
  },
  "to": [
    "user@example.com"
  ],
  "cc": [
    "user@example.com"
  ],
  "bcc": [
    "user@example.com"
  ],
  "reply_to": [
    "user@example.com"
  ],
  "subject": "string",
  "snippet": "string",
  "html": "string",
  "text": "string",
  "category": "human",
  "suppression_key": "string",
  "message_id": "string",
  "in_reply_to": "string",
  "idempotency_key": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "scheduled_at": "2019-08-24T14:15:22Z",
  "sent_at": "2019-08-24T14:15:22Z",
  "attachments": [
    {
      "id": "string",
      "filename": "string",
      "content_type": "string",
      "size": 9007199254740991,
      "cid": "string",
      "download_url": "http://example.com",
      "preparation": {
        "status": "ready",
        "format": "markdown",
        "pages": -9007199254740991,
        "warnings": [
          "string"
        ],
        "content_url": "http://example.com",
        "text": "string"
      }
    }
  ]
}