Serenities AI™
Back to API Overview

Site Events API

A site’s event log and catalog — emit events and inspect what a site can react to.

5 endpoints

Endpoints

POST
/api/v1/events/catalog

List the events a site can react to: built-in and custom, with counts

Parameters

projectIdstringrequired

Site (project) id

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/events/catalog \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "projectId": "example"
}'
POST
/api/v1/events/describe

Set or clear the description of an event in the catalog

Parameters

projectIdstringrequired
namestringrequired
descriptionstringrequired

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/events/describe \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "projectId": "example",
  "name": "example",
  "description": "example"
}'
POST
/api/v1/events/getSettings

Read which events a site records

Parameters

projectIdstringrequired

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/events/getSettings \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "projectId": "example"
}'
POST
/api/v1/events/updateSettings

Change which events a site records (merges with what is stored)

Parameters

projectIdstringrequired
settingsobjectrequired

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/events/updateSettings \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "projectId": "example",
  "settings": {}
}'
POST
/api/v1/events/emit

Emit a custom event for a site (owner or agent), e.g. cart_abandoned with properties

Parameters

projectIdstringrequired
namestringrequired
subjectIdstring
propertiesobject
idempotencyKeystring

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/events/emit \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "projectId": "example",
  "name": "example",
  "subjectId": "example"
}'