Skip to content
EmitKitDocs
Esc
↑↓navigate↵open⌘Jpreview

Cancel an event that waits

Stops a pending event from waiting when the answer is no longer needed; the answer page then shows it as no longer needed. Canceling an already canceled event returns it again, so retries are safe.

POST/v1/events/{id}/cancel
Authorization
AuthorizationBearer token (EmitKit API key) · headerrequired

EmitKit API key in the Authorization header as Bearer emitkit_…

or
X-API-KeyAPI key · headerrequired

EmitKit API key beginning with emitkit_.

Path parameters
idstringrequired

The event id from createEvent (data.id).

min length 1
Responses
200

The event, now canceled.

dataEventrequired

An event, as createEvent, getEvent and cancelEvent return it: the event with its fields, actions (both [] when none) and answer (null when it doesn't wait). Events are kept for 90 days; after that getEvent returns 404.

Show properties
actionsobject[]required

The event's buttons and links ([] when none).

max items 4
Show properties
Array of object
idstring

A button: what the answer reports, e.g. approve

matches ^[A-Za-z0-9_-]{1,64}$
labelstringrequired
min length 1 · max length 40
requiresstring[]

Field ids that must be filled in before this button can be pressed.

stylestring
Allowed:primarydestructive
urlstring

A link: the page it opens

max length 2000 · matches ^(?:https:\/\/|http:\/\/localhost[:/])\S+$
answerAnswer | anyrequired

null when the event doesn't wait for an answer.

Show properties
Any of:
Answer
actionstring | nullrequired

The id of the pressed button (submit when fields had no buttons).

atstring<date-time> | anyrequired

When it was answered.

Show properties
Any of:
string<date-time>
string<date-time>
any
any
byobject | anyrequired

Who answered (an organization member).

Show properties
Any of:
object
emailstringrequired
idstringrequired
namestringrequired
any
any
expiresAtstring<date-time>required

When a pending event stops waiting.

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|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
statusstringrequired
Allowed:pendingansweredexpiredcanceled
urlstring<uri>required

The answer page (needs a signed-in member). Pushes for this event open it.

valuesobject | anyrequired

Field values by field id: an option id (an array for multiple), text, a number or a boolean. Empty text fields are left out.

Show properties
Any of:
object
object
any
any
any
any
callbackobject | anyrequired

How delivery to callbackUrl went; null without one.

Show properties
Any of:
object
attemptsintegerrequired
deliveredAtstring<date-time> | anyrequired

When a 2xx was received.

Show properties
Any of:
string<date-time>
string<date-time>
any
any
lastStatusinteger | nullrequired

The receiver's last HTTP status; null when it couldn't be reached.

urlstringrequired
any
any
channelIdstringrequired
channelNamestringrequired
createdAtstring<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|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
descriptionstring | nullrequired
displayAsstringrequired
Allowed:messagenotification
fieldsobject[]required

The event's fields ([] when none).

max items 5
Show properties
Array of object
Any of:
object
defaultstring | string[]

An option id (an array of ids when multiple). A single choice without one starts on its first option.

Show properties
Any of:
string
string
string[]
Array of string
string
idstringrequired
matches ^[A-Za-z0-9_-]{1,64}$
labelstringrequired
min length 1 · max length 100
multipleboolean

Let the person pick several options (checkboxes).

optionsobject[]required
min items 2 · max items 10
Show properties
Array of object
idstringrequired

What the answer reports, e.g. partial

matches ^[A-Za-z0-9_-]{1,64}$
labelstringrequired

What the person sees

min length 1 · max length 100
typestringrequired
Allowed:choice
object
defaultstring
min length 0 · max length 2000
idstringrequired
matches ^[A-Za-z0-9_-]{1,64}$
labelstringrequired
min length 1 · max length 100
maxLengthinteger
min 1 · max 2000
multilineboolean
placeholderstring
min length 1 · max length 100
typestringrequired
Allowed:text
object
defaultnumber
idstringrequired
matches ^[A-Za-z0-9_-]{1,64}$
labelstringrequired
min length 1 · max length 100
maxnumber
minnumber
stepnumber
typestringrequired
Allowed:number
unitstring

Shown next to the value, e.g. $ or %

min length 1 · max length 8
object
defaultboolean
idstringrequired
matches ^[A-Za-z0-9_-]{1,64}$
labelstringrequired
min length 1 · max length 100
typestringrequired
Allowed:boolean
iconstring | nullrequired
idstringrequired
metadataobjectrequired
notifybooleanrequired
resumestring | nullrequired

The resume you sent, as is (null without one).

sourcestringrequired
tagsstring[]required
titlestringrequired
userIdstring | nullrequired
requestIdstring<uuid>required
matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
successbooleanrequired
401

Authentication credentials are missing or invalid.

codestringrequired

Stable: switch on this, not on error or message.

errorstringrequired
messagestringrequired
requestIdstring<uuid>required
matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
successbooleanrequired
403

The API key isn't bound to a Project.

codestringrequired

Stable: switch on this, not on error or message.

errorstringrequired
messagestringrequired
requestIdstring<uuid>required
matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
successbooleanrequired
404

No event with this id in the API key's Project.

codestringrequired
errorstringrequired
messagestringrequired
requestIdstring<uuid>required
matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
successbooleanrequired
409

not_pending: it was answered or expired. not_waiting: the event doesn't ask anything.

One of:
NotPendingError
codestringrequired
errorstringrequired
messagestringrequired

What happened to it: who answered it, or that it expired.

requestIdstring<uuid>required
matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
successbooleanrequired
NotWaitingError
codestringrequired
errorstringrequired
messagestringrequired

The event doesn't wait for an answer, so there is nothing to cancel.

requestIdstring<uuid>required
matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
successbooleanrequired
429

The authenticated principal exceeded its rate limit.

codestringrequired

Stable: switch on this, not on error or message.

errorstringrequired
messagestringrequired
requestIdstring<uuid>required
matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
successbooleanrequired
500

The event could not be canceled.

codestringrequired
errorstringrequired
requestIdstring<uuid>required
matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
successbooleanrequired
Try it
Server
Authorization
Parameters
Request
curl -X POST "https://api.emitkit.com/v1/events/string/cancel" \
  -H "Authorization: Bearer YOUR_TOKEN"
Response
{
  "success": true,
  "requestId": "5f0c6b1e-2d3a-4f5b-8c9d-0e1f2a3b4c5d",
  "data": {
    "id": "event_…",
    "channelId": "channel_…",
    "channelName": "refunds",
    "title": "Refund Jane Cooper for order #1042?",
    "description": "Arrived damaged: 2 of 3 items broken.",
    "icon": null,
    "createdAt": "2026-09-26T10:00:00.000Z",
    "displayAs": "message",
    "metadata": {},
    "notify": true,
    "source": "api",
    "tags": [],
    "userId": null,
    "fields": [
      {
        "id": "resolution",
        "type": "choice",
        "label": "Resolution",
        "options": [
          {
            "id": "full",
            "label": "Full refund ($240)"
          },
          {
            "id": "partial",
            "label": "Broken items only ($160)"
          }
        ],
        "default": "partial"
      },
      {
        "id": "note",
        "type": "text",
        "label": "Note to Jane",
        "multiline": true
      }
    ],
    "actions": [
      {
        "id": "approve",
        "label": "Refund",
        "style": "primary"
      },
      {
        "id": "deny",
        "label": "Don't refund",
        "style": "destructive",
        "requires": [
          "note"
        ]
      },
      {
        "label": "Open order",
        "url": "https://shop.example.com/admin/orders/1042"
      }
    ],
    "answer": {
      "action": "approve",
      "at": "2026-09-26T10:04:12.000Z",
      "by": {
        "email": "chris@example.com",
        "id": "user_…",
        "name": "Chris"
      },
      "expiresAt": "2026-09-26T10:30:00.000Z",
      "status": "answered",
      "url": "https://app.emitkit.com/a/event_…",
      "values": {
        "resolution": "partial"
      }
    },
    "callback": {
      "attempts": 1,
      "deliveredAt": "2026-09-26T10:04:13.000Z",
      "lastStatus": 200,
      "url": "https://shop.example.com/api/emitkit"
    },
    "resume": "refund-job-1042"
  }
}