Create a new event definition
Allows you to create a new event definition with rules and a list of booth ids to apply it to.
Body
The parameters to create an event definition
-
ID of the account the event definition belongs to.
-
IDs of the booths for which to evaluate the event.
-
Category the event falls under.
-
Short description of the event.
-
Whether the event should be actively evaluated.
-
Whether the event is evaluated daily or weekly.
Values are
daily
orweekly
. -
Whether the event is a tag or aggregate type of event.
Values are
tag
oraggregate
. -
Minimum duration to consider an ocurrence of the event.
-
Name of the event definition.
-
Rules that make up the event definition.
-
Whether to send an email notification (in-app is always true)
-
The UTC time at which to send the notification
-
IDs of users who should be notified when events occur
curl \
--request POST 'http://localhost:4000/api/event_definitions' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"name":"Doors open during bake mode","rules":[{"op":"like","tag":"BoothMode","value":"Bake%"},{"op":"==","tag":"I_xDoorClosed","value":false}],"enabled":true,"category":"Safety \u0026 Regulatory","user_ids":["a920bc22-de00-1983-bbca-90201849fbac","29302931-fabe-aaac-910a-119301b8ac91"],"booth_ids":["a920bc22-de00-1983-bbca-90201849fbac","29302931-fabe-aaac-910a-119301b8ac91"],"event_type":"tag","send_email":false,"description":"Event definition to check if doors were opened while the booth was in bake mode","min_duration":2,"evaluation_period":"daily","send_notification_at":"09:00:00"}'
{
"name": "Doors open during bake mode",
"rules": [
{
"op": "like",
"tag": "BoothMode",
"value": "Bake%"
},
{
"op": "==",
"tag": "I_xDoorClosed",
"value": false
}
],
"enabled": true,
"category": "Safety & Regulatory",
"user_ids": [
"a920bc22-de00-1983-bbca-90201849fbac",
"29302931-fabe-aaac-910a-119301b8ac91"
],
"booth_ids": [
"a920bc22-de00-1983-bbca-90201849fbac",
"29302931-fabe-aaac-910a-119301b8ac91"
],
"event_type": "tag",
"send_email": false,
"description": "Event definition to check if doors were opened while the booth was in bake mode",
"min_duration": 2,
"evaluation_period": "daily",
"send_notification_at": "09:00:00"
}
{
"id": "f260f115-f2e6-4dde-bcab-98b10fdb8cf6",
"name": "Doors open during bake mode",
"rules": [
{
"op": "like",
"tag": "BoothMode",
"value": "Bake%"
},
{
"op": "==",
"tag": "I_xDoorClosed",
"value": false
}
],
"enabled": true,
"category": "Safety & Regulatory",
"user_ids": [
"a920bc22-de00-1983-bbca-90201849fbac",
"29302931-fabe-aaac-910a-119301b8ac91"
],
"booth_ids": [
"a920bc22-de00-1983-bbca-90201849fbac",
"29302931-fabe-aaac-910a-119301b8ac91"
],
"account_id": "a9299bca-acc2-4dde-1111-83a08ca12128",
"created_at": "2025-07-30 13:00:00Z",
"created_by": "371a9242-02da-433d-a25a-b5031d5f3b46",
"event_type": "tag",
"send_email": false,
"updated_at": "2025-07-30 13:00:00Z",
"description": "Event definition to check if doors were opened while the booth was in bake mode",
"min_duration": 2,
"last_edited_by": "371a9242-02da-433d-a25a-b5031d5f3b46",
"evaluation_period": "daily",
"send_notification_at": "09:00:00"
}
{
"id": "f260f115-f2e6-4dde-bcab-98b10fdb8cf6",
"name": "Doors open during bake mode",
"rules": [
{
"op": "like",
"tag": "BoothMode",
"value": "Bake%"
},
{
"op": "==",
"tag": "I_xDoorClosed",
"value": false
}
],
"enabled": true,
"category": "Safety & Regulatory",
"user_ids": [
"a920bc22-de00-1983-bbca-90201849fbac",
"29302931-fabe-aaac-910a-119301b8ac91"
],
"booth_ids": [
"a920bc22-de00-1983-bbca-90201849fbac",
"29302931-fabe-aaac-910a-119301b8ac91"
],
"account_id": "a9299bca-acc2-4dde-1111-83a08ca12128",
"created_at": "2025-07-30 13:00:00Z",
"created_by": "371a9242-02da-433d-a25a-b5031d5f3b46",
"event_type": "tag",
"send_email": false,
"updated_at": "2025-07-30 13:00:00Z",
"description": "Event definition to check if doors were opened while the booth was in bake mode",
"min_duration": 2,
"last_edited_by": "371a9242-02da-433d-a25a-b5031d5f3b46",
"evaluation_period": "daily",
"send_notification_at": "09:00:00"
}
{
"error": "Error Reason"
}
{
"error": "Error Reason"
}
{
"error": "Error Reason"
}
{
"error": "Error Reason"
}