Skip to main content
POST
/
api
/
public
/
v1
/
chat
/
events
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({name: 'widget_open', props: {page: '/pricing'}})
};

fetch('{protocol}://{host}/api/public/v1/chat/events', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));

Authorizations

Authorization
string
header
required

Token issued by POST /api/public/v1/chat/sessions. Lifetime 1h.

Body

application/json
name
string
required

snake_case event name. Goals match on this value.

Pattern: ^[a-z][a-z0-9_]{0,63}$
Example:

"widget_open"

props
object

Free-form payload, ≤ 4 KB JSON. For commerce/goal events use value (number) + currency (ISO-4217).

occurred_at
string<date-time>

Optional client timestamp (ISO-8601). Defaults to server receive time; a future value is clamped to now.

id
string

Optional client-generated id. A repeated id for the same widget key is deduplicated (recorded once).

Maximum string length: 128

Response

Event recorded