Skip to the page

Define event

Defines an event before it is sent, with the types its data has to carry. An event that is sent without being defined defines itself, with no types.

POST/v1/events
Needs the scopeevents:write

Body parameters

  • namestringRequired

    A name for the event, such as order.paid: letters, digits, dots, dashes, colons and underscores.

  • schemaRecord<string, string>

    The type of each value its data has to carry, by name: string, number, boolean or date. Without it the event takes any data.

Returns

  • object"event"

    Always event.

  • idstring

    The id of the event.

  • namestring

    The name of the event, such as order.paid.

  • schemaRecord<string, string> | null

    The type of each value its data has to carry: string, number, boolean or date. null takes any data.

  • receivedinteger

    How many times it has been sent.

  • lastReceivedAtstring | null

    When it was last sent, or null.

  • createdAtstring

    When the event was first defined or sent.