Skip to content

Event schemas

An event schema says what one kind of event, or one entity attached to events, may contain. The collector checks every self-describing event and every entity against the schema it cites, and keeps an event that fails as a bad row. Your schemas together are your organization’s schema registry, what other platforms call a tracking plan. One schema registry serves all your sites.

A schema is a JSON Schema in Snowplow’s Iglu format. Its self block names it:

{
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
"self": {
"vendor": "com.example",
"name": "article_read",
"format": "jsonschema",
"version": "1-0-0"
},
"type": "object",
"properties": {
"article_id": { "type": "string", "maxLength": 64 },
"read_seconds": { "type": "integer", "minimum": 0 }
},
"required": ["article_id"],
"additionalProperties": false
}

An event cites it by its Iglu URI, iglu:com.example/article_read/jsonschema/1-0-0. The version is SchemaVer, MODEL-REVISION-ADDITION, not semver.

Every schema registry already holds two sets of schemas, which nobody has to publish:

  • Snowplow’s: what Snowplow’s browser and mobile trackers send with no configuration, and what the @snowplow/browser-plugin-* packages send. The trackers’ standard entities validate from day one, and page views, page pings and structured events need no schema.
  • EdgeKit’s own: the entities the collector attaches, such as cloud.edgekit/request and cloud.edgekit/tenant, the events your MCP server sends: cloud.edgekit/mcp_search, mcp_fetch and mcp_connected, each with the mcp_client entity, the five cloud.edgekit/account_page_* events the account page sends, the four cloud.edgekit/checkout_page_* events a checkout page sends, and the four cloud.edgekit/experience_* events an experience sends.

The list in Analytics › Configuration › Schemas shows each schema’s owner: Yours, Snowplow or EdgeKit. A schema you need from Snowplow’s catalogue that is not there, EdgeKit imports for you.

  1. Open Analytics › Configuration › Schemas and select Publish a schema.
  2. Paste the schema into JSON Schema, up to 131,072 characters.
  3. Select Publish. The schema’s page opens, with its Identity and its Versions.
  4. Deploy. See Stage and deploy a change.

Publishing ships nothing by itself. A published version joins your draft, and events that cite it are schema_not_found bad rows until it is deployed.

The refusal names what to change. Publishing refuses a schema that:

  • writes in a reserved namespace: com.snowplowanalytics, cloud.edgekit, nl.basjes, org.ietf, or a namespace under one of them. Copy the schema into your own namespace, such as com.example, to change it;

  • is not draft-4, or uses $ref, allOf, not or dependencies, which no column can be derived from;

  • uses a keyword from a later draft, such as const or if. It is refused rather than ignored, because a draft-4 check would pass it silently;

  • declares the wrong version. The first version must be 1-0-0. After that, EdgeKit works out what changed against the newest version, and the version you declare must match:

    Change Bump
    An optional property added ADDITION
    A property made required, or a constraint tightened REVISION
    A property removed, or its type changed MODEL
  • repeats a version that exists, or is lower than the newest one;

  • is identical to the newest version.

A version is never edited and never deleted. A change is the next version, published beside the others. Every version keeps validating, because an app already installed may cite an old one forever.

A schema’s versions within one MODEL share a column in your event archive and your warehouse: an event’s data in unstruct_event_<vendor>_<name>_<model>, an entity’s in contexts_<vendor>_<name>_<model>, in lower case and with every character other than a letter or digit written as _. com.example/article_read at 1-0-0 and 1-2-1 both land in unstruct_event_com_example_article_read_1. A new MODEL adds new columns, and a column is never removed.

On the schema’s page, select Deprecate on a version of one of your own schemas. Deprecation is a flag for the people who instrument your pages: the version keeps validating. Undo deprecation removes the flag.

  • Every cited schema is matched by its exact version: the self-describing event’s schema, and the schema of each attached entity.
  • A schema it does not hold makes the whole event a schema_not_found bad row, even when only one entity is unknown.
  • Data that does not match makes the event a schema_violation bad row.
  • A structured event (trackStructEvent) has no schema, so nothing checks it.

The collector checks events against the schemas built into it when EdgeKit last deployed it for your organization. If events citing a version you have deployed are still schema_not_found, ask EdgeKit to deploy your collector again.

Your tools can read the deployed schema registry from your tenant host, with any of your API keys, as Authorization: Bearer <key> or x-api-key: <key>. The schema registry is the same for every site, so the key’s site does not matter.

Terminal window
curl https://<tenant>.edgekit.ai/v1/iglu/api/schemas \
-H 'Authorization: Bearer ek_your_key'
{ "schemas": ["iglu:com.example/article_read/jsonschema/1-0-0"] }
const response = await fetch(
'https://<tenant>.edgekit.ai/v1/iglu/api/schemas/com.example/article_read/jsonschema/1-0-0',
{ headers: { Authorization: 'Bearer ek_your_key' } },
);
const schema = await response.json(); // the schema, verbatim, in its Iglu envelope
  • GET /v1/iglu/api/schemas lists every deployed version’s URI, deprecated ones included.
  • GET /v1/iglu/api/schemas/{vendor}/{name}/{format}/{version} answers the schema as published.
  • A version that is published but not yet deployed answers 404, the same state in which the collector files its events as schema_not_found. A version that is not MODEL-REVISION-ADDITION answers 422, and a missing or unknown key 401.

See List every deployed schema URI and Resolve a schema.

Bring schemas from your existing Iglu registry

Section titled “Bring schemas from your existing Iglu registry”

If you already run an Iglu registry, EdgeKit imports its schemas for you. Imported versions keep their numbers, and the version check above is skipped for them, so events your apps already send keep validating. A version already in your schema registry is skipped. There is no import button in the console.

Every built-in role (Owner, Admin, Developer, Editor and Member) can publish a schema. Only Owner and Admin can deprecate a version. Deploying needs Owner or Admin.

edgekit.ai