Skip to main content
POST
Create an event definition

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

projectId
string
required

Project ID

Body

application/json
codeName
string
required

Stable identifier, unique per project. Immutable. Must start with a letter, then letters/digits/underscores, 2–100 chars.

Required string length: 2 - 100
Pattern: ^[a-zA-Z][a-zA-Z0-9_]*$
displayName
string
required

Human-readable name.

Minimum string length: 1
description
string

Optional description.

attributes
string[]

codeNames of EXISTING event-scoped attributes to attach to this event — the built-in / predefined ones, custom event properties auto-registered at ingestion when your app tracked an event with a properties payload, or ones pre-defined via the attribute definition first with scope eventDefinition. Unknown codeNames are rejected.

Response

Event definition created

id
string
required
object
enum<string>
required
Available options:
eventDefinition
createdAt
string<date-time>
required
description
string
required
displayName
string
required
codeName
string
required
predefined
boolean
required

true = a built-in Usertour lifecycle event (flow/launcher/checklist/survey/… started/ended/etc.) — NOT trackable: a tracker can only fire a CUSTOM event. false = a custom event you created.

attributes
string[]
required

codeNames of the event-scoped attributes attached to this event.