Skip to content

Export schema

The export schema is your organization’s EdgeKit records as tables, one per record type, listed by product under Tables. Today the warehouse load delivers it into your warehouse as schema edgekit_v1, beside your events.

edgekit_v1 only grows: new tables, and new columns at the end of a table. A column is never renamed, removed, retyped or given a new meaning. A breaking change ships as edgekit_v2, beside edgekit_v1, which stays for at least 12 months after.

  • Current state, no history.
  • Fresh within minutes, some removals within a day. A record that is added, changes or is removed arrives with the next load, except a record removed from users, grants, gift_links, user_sites, user_lists, user_profiles, user_trait_values, editions or edition_sends, such as an erased user’s profile or a deleted edition. That leaves the copy at the nightly load, which copies every table whole. So does a user’s old trait value: when a value changes, the new row arrives with the next load and the old one stays beside it until the nightly load.
  • An id may name a row another table does not have yet. Use LEFT JOIN.
  • Types: ids, names and labels are text, flags booleans, times timestamps with time zone in UTC. deployments.version and event_schemas.model, revision and addition are integers, experiment_arms.weight is a number, user_profiles.data is JSON.
Product Tables
EdgeKit ID users, user_sites, user_orgs, user_org_members, user_org_domains, identity_providers, external_identities
Subscriptions grants, products, product_sites, gift_links
Profile user_traits, user_trait_items, user_trait_values, user_profiles
Decision engine features, outcomes, meters, segments, experiments, experiment_arms, deployments
Newsletters lists, user_lists
Email & Push Editions publications, editions, edition_sends, brands
Delivery sites
Analytics event_schemas

One row per user, erased users included.

Column Type Meaning
id text The user’s EdgeKit user id.
external_id text Your organization’s own key for the user, such as a legacy account id.
email text The user’s email address. Null once the user is erased.
email_verified boolean Whether the address is verified.
created_at timestamp When the user was created.
updated_at timestamp When the user’s record last changed.
is_deleted boolean True once the user is erased.

An erased user keeps their row, id and external_id; email is null. See Erased users.

One row per user per site they are attached to.

Column Type Meaning
user_id text The user, users.id.
site_id text The site, sites.id.
status text The user’s standing on the site: active or blocked.
source text How the user arrived: signup, import, api, invitation or newsletter.
joined_at timestamp When the user was attached to the site.
updated_at timestamp When the row last changed.

One row per user organization.

Column Type Meaning
id text The user organization’s id.
external_id text Your organization’s own key for it.
name text Its name.
created_at timestamp When it was created.

One row per seat: one user’s membership of one user organization.

Column Type Meaning
id text The membership’s id.
user_org_id text The user organization, user_orgs.id.
user_id text The member, users.id.
role text owner, admin or member.
created_at timestamp When the seat was filled.

One row per auto-join domain.

Column Type Meaning
id text The domain’s id.
user_org_id text The user organization it adds members to, user_orgs.id.
domain text The domain, in lower case, such as example.com.
auto_join boolean Whether a verified address at the domain makes the user a member.
status text active or suspended. A suspended domain adds nobody. A domain is suspended, never deleted.
created_at timestamp When it was added.

One row per identity provider: your own login, when EdgeKit reads it instead of signing users in itself. Sign-in providers such as Google, used through EdgeKit ID, have no row.

Column Type Meaning
id text The identity provider’s id. external_identities.identity_provider_id holds it.
name text Its name, as the console shows it.
mechanism text local_jwt (EdgeKit verifies a token your login signs) or remote_check (EdgeKit asks your login who is signed in).
vendor text The preset it was set up from, such as auth0 or custom. Nothing at runtime depends on it.
created_at timestamp When it was added.
updated_at timestamp When it last changed.

The connection’s settings, such as the issuer, the cookie names and the claim map, are not exported.

One row per link between a user and an account in your identity provider. A user can have more than one.

Column Type Meaning
id text The link’s id.
identity_provider_id text The identity provider, identity_providers.id.
user_id text The user, users.id.
subject text The user’s id in your identity provider: the sub its credential carries.
created_at timestamp When EdgeKit linked them.

See From credential to user for when EdgeKit makes or cuts a link.

One row per grant. Exactly one of user_id and user_org_id is set.

Column Type Meaning
id text The grant’s id.
user_id text The holder when it is a user, users.id.
user_org_id text The holder when it is a user organization, user_orgs.id.
product_id text The product it gives access to, products.id.
site_id text The site it is pinned to, sites.id. Null covers whatever the product covers.
status text active, suspended or revoked. An active grant past its expires_at has expired.
source text What created it, such as your billing provider’s name, import or api.
starts_at timestamp When access starts.
expires_at timestamp When access ends. Null is open-ended.
trial_ends_at timestamp Access before this time was a trial. Null when the grant had no trial.
created_at timestamp When the grant was created.
updated_at timestamp When it last changed.

See Grant states for how status and expiry combine.

One row per product.

Column Type Meaning
id text The product’s id.
name text Its name.
slug text Its slug.
kind text content or capability.
status text active or archived.
created_at timestamp When it was created.
updated_at timestamp When it last changed.

One row per site a product covers. A product with no row covers no site. See Choose the sites.

Column Type Meaning
product_id text The product, products.id.
site_id text A site it covers, sites.id.

One row per gift link created.

Column Type Meaning
id text The link’s id.
site_id text The site it is bound to, sites.id.
user_id text The user who gave it, users.id. Null when source is internal.
content_key text The page it opens: the page’s value for your gift link key fact, such as the article’s id.
source text user for a link a user gave, internal for one your server created without naming a user.
expires_at timestamp When it stops working.
created_at timestamp When it was created.

One row per trait your organization declares.

Column Type Meaning
id text The trait’s id.
name text The trait’s name, as rules and the API spell it.
label text What forms show.
type text string, integer, number, boolean or list.
multiple boolean Whether a user can hold more than one value.
enabled boolean False while the trait is suppressed.
created_at timestamp When it was declared.
updated_at timestamp When it last changed.

One row per value a list trait offers.

Column Type Meaning
id text The value’s id. user_trait_values.trait_item_id holds it.
trait_id text The trait offering it, user_traits.id.
external_id text Your organization’s own key for the value.
label text What forms show.
enabled boolean False while the value is suppressed.
created_at timestamp When it was added.
updated_at timestamp When it last changed.

One row per distinct value a user holds for a declared trait. A trait that allows more than one value gives one row per value, and a user with no value for a trait has no row for it.

Column Type Meaning
user_id text The user, users.id.
trait_id text The trait, user_traits.id.
trait_item_id text For a list trait, the value picked, user_trait_items.id. Null for every other type.
value text For every other type, the value as text, such as true or 42: cast it by user_traits.type. Null for a list trait.
updated_at timestamp When the user’s record last changed, or when the trait was created if that is later.
value_key text Whichever of trait_item_id and value is set. With user_id and trait_id, it identifies the row.

A suppressed trait’s values are still exported. A deleted trait’s values are not, though they stay on users’ records. Erasing a user clears the values they wrote themselves and keeps the ones your staff wrote.

One row per user per site they have a profile on.

Column Type Meaning
user_id text The user, users.id.
site_id text The site, sites.id.
data JSON The user’s profile on that site, as an object.
updated_at timestamp When EdgeKit last rebuilt it.

The keys inside data come from your organization’s profile fields, so they change when your fields do. The schema’s promise covers the column, not the keys inside it. An erased user’s profiles are deleted, so they leave this table.

features, outcomes, meters, segments and experiments

Section titled “features, outcomes, meters, segments and experiments”

One row per feature, named outcome, meter, segment and experiment, as saved in the console, deployed or not. These are definitions, not usage: what a meter has counted is not exported. An outcome written straight onto a rule has no row.

The five tables share six columns:

Column Type Meaning
id text The record’s id. For an outcome, this is not the id decide returns.
name text Its name, as rules point at it.
enabled boolean True once the record is set to go into the next deploy: Include in deploy, or Next deploy at Included.
external_id text The id an external system gives a record synced from it. Null for one authored in EdgeKit.
created_at timestamp When it was created.
updated_at timestamp When it last changed.

outcomes and experiments add one column each, and meters two:

Table Column Type Meaning
outcomes type text The outcome’s type, such as allow or deny. Null for an outcome with no access axis.
meters unit text The meter’s Kind: count or seen-set.
meters subject text What it Counts: device, user or gift_link.
experiments unit text What gets an arm: device or user.

An experiment’s name is what an experiment_exposure event carries as experiment. Under schema 1-0-1 the event also carries unit_id: the device id or the user id the arm was assigned to, by the experiment’s unit. See Exposures.

One row per arm of each experiment in experiments.

Column Type Meaning
experiment_id text The experiment, experiments.id.
name text The arm’s name, such as control. An experiment_exposure event carries it as arm.
weight number How many of the experiment’s 1,000 buckets the arm takes, such as 500. Null when the saved weight is not a number.

A unit with no arm, such as one outside the targeting, has no row here and sends no experiment_exposure event. See How a unit gets its arm.

One row per entry in your organization’s deployment log: every deploy of your draft, and every EdgeKit release.

Column Type Meaning
version integer The entry’s number, counting up from 1 with no gaps. Each event’s contexts_cloud_edgekit_tenant_1 column carries, as deployment, the version that judged the event.
axis text config for a deploy of your draft (Configuration in the console), component for an EdgeKit release (Components).
status text pending, live or failed. A config entry is live from the start, and a component entry is pending until its release finishes.
deployed_at timestamp When the entry was added.

An entry stays live after a newer one replaces it, so live does not mean serving now. What an entry deployed, its list of changes and who deployed it are not exported.

One row per newsletter list, as saved in the console, deployed or not.

Column Type Meaning
id text The list’s id, the one the newsletter API takes.
site_id text The site it belongs to, sites.id.
slug text Its slug, such as morning_briefing. Unique on its site.
label text What your preference centre shows.
enabled boolean False once the list is disabled.
external_id text Its Vendor group id: the group behind the list at your messaging vendor.
created_at timestamp When it was created.
updated_at timestamp When it last changed.

One row per user per list they have a standing on.

Column Type Meaning
user_id text The user, users.id.
list_id text The list, lists.id.
status text subscribed, unsubscribed, or pending until the user confirms their address.
created_at timestamp When the user first got a standing on the list.
updated_at timestamp When the row last changed.

A row holds the user’s current standing only: earlier joins and departures are not exported. A user with no row has never joined or left the list, which the newsletter API answers as unknown. See Read a user’s standings.

One row per publication, archived or not.

Column Type Meaning
id text The publication’s id.
site_id text Its site, sites.id.
name text Its name.
slug text Its path in the public archive. Unique on its site.
list_id text The newsletter list its email goes to, lists.id. Null for a push-only publication.
brand_id text Its own brand, brands.id. Null uses its site’s brand.
locale text Its language tag, such as en-GB.
archived_at timestamp When it was archived. Null while it is not.
created_at timestamp When it was created.
updated_at timestamp When it last changed.

One row per edition. A deleted edition has no row.

Column Type Meaning
id text The edition’s id.
publication_id text Its publication, publications.id.
state text draft, scheduled, cancelled, sending, sent, partially_sent, failed or skipped. See Edition states.
subject text Its email subject.
send_at timestamp When it sends, or sent.
created_at timestamp When it was created.
updated_at timestamp When it last changed.

One row per send: one variant of an edition, on one channel. See How an edition is sent.

Column Type Meaning
id text The send’s id.
edition_id text The edition, editions.id.
channel text email, push, or web for the page kept in the public archive.
state text pending, sending, sent, failed or unknown. See At most once.
sent_at timestamp When it was sent. Null unless state is sent.
updated_at timestamp When the send last changed.

A row holds no body or headers, and does not say which variant it is for.

One row per brand.

Column Type Meaning
id text The brand’s id. sites.brand_id and publications.brand_id hold it.
name text Its name, unique in your organization.
created_at timestamp When it was created.
updated_at timestamp When it last changed.

The look itself is not exported: no logo, colours, font, postal address or social links.

One row per site, as saved in the console, deployed or not.

Column Type Meaning
id text The site’s id. Events carry it as their site_id.
name text Its name.
domain text Its domain.
created_at timestamp When it was created.
updated_at timestamp When it last changed.
brand_id text The brand picked for it, brands.id. Null when none is picked.

One row per version of each event schema your organization published or EdgeKit imported for it, deployed or not. The schemas that ship with EdgeKit have no row.

Column Type Meaning
id text The version’s key, such as com.example/article_read/jsonschema/1-0-0. An event cites it as iglu: followed by this key.
vendor text The schema’s vendor, such as com.example.
name text Its name, such as article_read.
format text jsonschema.
model integer The version’s MODEL. Every version with one MODEL shares a column in your events table; see Versions.
revision integer Its REVISION.
addition integer Its ADDITION.
deprecated boolean True once the version is deprecated. It still validates.
created_at timestamp When it was published or imported.
updated_at timestamp When it last changed.

The JSON Schema itself is not exported. Read it from your tenant host.

  • Billing data, ever: no prices, offers, checkouts, invoices, billing accounts or user subscriptions. A grant carries no price.
  • Why a grant was given, and why it was suspended or revoked.
  • History of any kind: a grant’s past changes, a user’s past standings on a list, and the audit log.
  • What a meter has counted, and what decide answered on each request.
  • Passwords and other credentials, sign-in sessions, sign-in codes and links, API keys, and your identity provider’s connection settings.
  • Pending invitations to a user organization, and a user’s past email addresses.
  • A user’s name and profile image.
  • EdgeKit’s copy of your CMS content, and what EdgeKit derives from it.
  • Your organization’s settings, and EdgeKit’s working records such as previews and streaming inputs.

Live grants per product. A grant is live when it is active and has not expired:

SELECT p.name AS product, COUNT(*) AS live_grants
FROM edgekit_v1.grants AS g
JOIN edgekit_v1.products AS p ON p.id = g.product_id
WHERE g.status = 'active'
AND (g.expires_at IS NULL OR g.expires_at > CURRENT_TIMESTAMP)
GROUP BY p.name
ORDER BY live_grants DESC;

Users per answer to a list trait named industry:

SELECT i.label, COUNT(DISTINCT v.user_id) AS users
FROM edgekit_v1.user_trait_values AS v
JOIN edgekit_v1.user_traits AS t ON t.id = v.trait_id
JOIN edgekit_v1.user_trait_items AS i ON i.id = v.trait_item_id
WHERE t.name = 'industry'
GROUP BY i.label
ORDER BY users DESC;

edgekit.ai