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

Create Event

Creates an Event in a named Channel, creating the Channel when necessary. When notify is true (the default), Organization members who turned on notifications for the Channel receive a web push notification. Events are retained for 90 days.

POST/v1/events
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_.

Header parameters
Idempotency-Keystring

A caller-generated command identifier, scoped to the API key and kept for 24 hours. Reusing it with the same request replays the first response; reusing it with a different request, or while the first request is still running, returns 409.

min length 1 · max length 255
Request body
requiredapplication/json
channelNamestringrequired

Channel name. The Channel is created automatically when it does not exist.

min length 1 · max length 255
descriptionstring
displayAsstring
Allowed:messagenotification
iconstring
metadataobject
notifyboolean

Send a web push notification to devices subscribed to the Channel.

default: true
sourcestring
min length 1 · max length 255 · default: "api"
tagsstring[]
titlestringrequired
min length 1 · max length 1000
userIdstring | null
Responses
201

The Event was created or an earlier response was replayed.

dataobjectrequired
Show properties
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)))$
idstringrequired
titlestringrequired
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
400

The request does not match the operation contract.

detailsobject[]required
Show properties
Array of object
codestring
min length 1
messagestringrequired
min length 1
pathstring | integer[]required
Show properties
Array of string | integer
Any of:
string
string
integer
integer
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
401

Authentication credentials are missing or invalid.

errorstringrequired
messagestringrequired
403

The API key's Project has been deleted.

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

The Idempotency-Key belongs to a different event request.

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
413

The request body exceeds 1 MiB, or the stored Event would exceed the 16 KB limit (all of its stored fields, including metadata, combined).

errorstringrequired
messagestringrequired
Allowed:Request body exceeds the 1 MiB limitEvent exceeds the 16 KB storage limit
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.

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 created.

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
Bodyapplication/json
Request
curl -X POST "https://api.emitkit.com/v1/events" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "channelName": "string",
  "description": "string",
  "displayAs": "message",
  "icon": "string",
  "metadata": {
    "property1": "string",
    "property2": "string"
  },
  "notify": true,
  "source": "api",
  "tags": [
    "string"
  ],
  "title": "string",
  "userId": "string"
}'
Response
{
  "data": {
    "channelId": "string",
    "channelName": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "id": "string",
    "title": "string"
  },
  "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
  "success": true
}