Update an existing event definition

PUT /api/event_definitions/{id}

Allows you to update an existing event definition.

Path parameters

  • id string Required

    the ID of the event definition to retrieve

application/json

Body

The parameters to create an event definition

  • account_id string

    ID of the account the event definition belongs to.

  • booth_ids array[string] Required

    IDs of the booths for which to evaluate the event.

  • category string Required

    Category the event falls under.

  • description string Required

    Short description of the event.

  • enabled boolean

    Whether the event should be actively evaluated.

  • evaluation_period string Required

    Whether the event is evaluated daily or weekly.

    Values are daily or weekly.

  • event_type string Required

    Whether the event is a tag or aggregate type of event.

    Values are tag or aggregate.

  • min_duration integer

    Minimum duration to consider an ocurrence of the event.

  • name string Required

    Name of the event definition.

  • rules array[object]

    Rules that make up the event definition.

    Hide rules attributes Show rules attributes object
    • op string

      Operation to use when evaluating. '==', '!=', '<', '<=', '>', '>=', 'in', 'not_in', 'like'

    • tag string

      Name of the tag on which to evaluate a condition.

    • value

      Value to compare against

  • send_email boolean

    Whether to send an email notification (in-app is always true)

  • send_notification_at string(time)

    The UTC time at which to send the notification

  • user_ids array[string]

    IDs of users who should be notified when events occur

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • account_id string

      ID of the account the event definition belongs to.

    • booth_ids array[string]

      IDs of the booths for which to evaluate the event.

    • category string

      Category the event falls under.

    • created_at string

      ISO8601 encoded string of when the event definition was created.

    • created_by string

      ID of the user who created the event definition.

    • description string

      Short description of the event.

    • enabled boolean

      Whether the event should be actively evaluated.

    • evaluation_period string

      Whether the event is evaluated daily or weekly.

    • event_type string

      Whether the event is a tag or aggregate type of event.

    • id string

      ID of the event definition in the system.

    • last_edited_by string

      ID of the user who last modified the event definition.

    • min_duration integer

      Minimum duration to consider an ocurrence of the event.

    • name string

      Name of the event definition.

    • rules array[object]

      Rules that make up the event definition.

      Hide rules attributes Show rules attributes object
      • op string

        Operation to use when evaluating. '==', '!=', '<', '<=', '>', '>=', 'in', 'not_in', 'like'

      • tag string

        Name of the tag on which to evaluate a condition.

      • value

        Value to compare against

    • send_email boolean

      Whether to send an email notification (in-app is always true)

    • send_notification_at string(time)

      The UTC time at which to send the notification

    • updated_at string

      ISO8601 encoded string of when the event was last edited.

    • user_ids array[string]

      IDs of users who should be notified when events occur.

  • 400 application/json

    Bad request

    Hide response attribute Show response attribute object
    • error string

      Human readable version of the error status code

  • 401 application/json

    Unauthorized

    Hide response attribute Show response attribute object
    • error string

      Human readable version of the error status code

  • 404 application/json

    Not found

    Hide response attribute Show response attribute object
    • error string

      Human readable version of the error status code

PUT /api/event_definitions/{id}
curl \
 --request PUT 'http://localhost:4000/api/event_definitions/{id}' \
 --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"}'
Request examples
{
  "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"
}
Response examples (200)
{
  "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"
}
Response examples (200)
{
  "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"
}
Response examples (400)
{
  "error": "Error Reason"
}
Response examples (400)
{
  "error": "Error Reason"
}
Response examples (401)
{
  "error": "Error Reason"
}
Response examples (401)
{
  "error": "Error Reason"
}
Response examples (404)
{
  "error": "Error Reason"
}
Response examples (404)
{
  "error": "Error Reason"
}