Skip to content
Documentation menuEvent schema and modes

Event schema. Your events are defined as data.

Every app defines its own event catalogue in the panel. Postlip Metrics has no fixed list of events: event names, their properties and their meaning are the app’s data, and every message is validated against this catalogue.

Event and property definitions

An event definition carries its name, description, business role, status and properties. Every property has:

  • a type (string, number, integer, boolean, datetime, currency, money, enum, object, array),
  • whether it is required, and its constraints (a list of values, a maximum length, a minimum/maximum),
  • a personal data class (none, pseudonymous, personal, sensitive) and an action (allow, hash, drop, reject).

Person and account traits

Person traits sent with identify and account traits sent with group are defined apart and validated with the same rules.

Statuses

StatusMeaning
DraftThe definition is being worked on; it does not take part in validation yet.
ActiveThe definition holds; events are validated against it.
DeprecatedEvents are still accepted but another event should replace it; marked @deprecated in generated types.
BlockedEvents are refused (event_blocked).

Validation modes

The mode is chosen per app and decides what happens to undefined events and properties. Defined ones are checked against their definition in every mode.

ModeUndefined eventWhen
strictRefused (event_unplanned, property_unplanned); the reason shows in the live stream.Apps in production with a settled schema.
lenientAccepted, marked “Unplanned” and placed in the Discovered inbox.The default.
discoverAccepted, and a draft definition opens by itself.The first days of a setup.

Discovered events and version history

  • Undefined events gather in the Discovered inbox; Add as definition turns one into a definition, or it is ignored.
  • Every change to the schema is a revision; the change history keeps who changed what and when, with the value before and after.

Export and CI

  • The JSON Schema document of an event: GET /v1/apps/{appId}/event-definitions/{eventId}/json-schema.
  • The whole schema in one bundle: GET /v1/apps/{appId}/schema.
  • metrics pull generates TypeScript types and a typed track from the schema; metrics validate checks sample events in CI.