Authentication and keys

3x has four kinds of credentials. Each has a recognizable prefix, so secret scanners (GitHub, GitLab) can find leaked keys, and a checksum, so a mistyped key is rejected before any database lookup.

CredentialPrefixBelongs toWhere it is used
Publishable keypk_3x_one projectBrowser SDK (data-key, ?k=), POST /v1/e, POST /v1/cb, GET /v1/c/{pk} – public by design
Secret keysk_3x_an organization, optionally narrowed to projectsYour server, CI, Claude Code (Authorization: Bearer sk_3x_…)
Proxy keysk_3x_ with scope ingest:proxyone projectThe first-party proxy (x-3x-proxy-key)
Dashboard sessionx3s_a userThe dashboard; scripts that log in as a user

OAuth access tokens (x3oat_…) exist as well. Tokens of MCP clients such as Claude are only accepted on /mcp – see claude.ai connector. Tokens of the X3 App reach a fixed part of the REST API – see X3 App.

Publishable keys

A publishable key identifies the project of a tracking request. It can only send data, and only from the origins in the project's tracking config (Settings › Installation & status › Allowed origins). Requests from any other origin get 403 and are not stored. Because the key is public, every conversion that browser traffic can trigger is guarded (engaged session, once per session and definition, daily cap, optional server confirmation – see Server-side conversions).

# list and create publishable keys (project:admin)
curl -H "Authorization: Bearer $X3_SECRET_KEY" https://api.3x.example/v1/projects/my-site/publishable-keys
curl -X POST -H "Authorization: Bearer $X3_SECRET_KEY" -H "content-type: application/json" \
  -d '{"name":"staging"}' https://api.3x.example/v1/projects/my-site/publishable-keys

Rolling a publishable key (POST …/publishable-keys/{id}/roll) issues a new key and keeps the old one valid for an overlap period, so cached pages keep tracking while you deploy.

Secret keys

Secret keys belong to an organization and carry scopes. Create them in the dashboard (Organization → API keys) or with POST /v1/orgs/{org}/keys. The value is shown once; 3x stores only a SHA-256 hash.

curl -X POST https://api.3x.example/v1/orgs/acme/keys \
  -H "Authorization: Bearer $X3_SESSION" -H "content-type: application/json" \
  -d '{"name":"reporting job","scopes":["analytics:read"],"projectIds":["9b3c…"],"expiresAt":"2027-01-01T00:00:00Z"}'
FieldMeaning
scopesWhat the key may do – see Scopes and roles. Ask for the least you need.
projectIdsOptional narrowing to some projects. A narrowed key never holds org:admin.
expiresAtOptional expiry.
noteFree text for your colleagues (where the key is deployed).

Rules that keep keys from escalating privileges:

  • You can only grant scopes you hold yourself; a request for more is refused with **403 insufficient_scope** listing the scopes – nothing is silently dropped.
  • A key created by a narrowed key is narrowed the same way (or further).
  • Keys created through another key or through an OAuth grant are derived: they stop working as soon as their parent key or grant is revoked, and they cannot create keys themselves.
  • Creating, rolling and revoking keys from the dashboard needs a recent re-authentication ("sudo", 15 minutes).

Rolling (POST /v1/orgs/{org}/keys/{id}/roll) returns a new value with the same scopes and keeps the old value valid for expireOldInHours (default 168 = one week, 0 = immediately) – deploy the new value, then let the old one expire. Keys derived from the rolled key move to the new key (if they fit its scopes and projects), so a rotation does not break them. Revoking (DELETE /v1/orgs/{org}/keys/{id}) is immediate on the instance that handles the request; other API instances notice within 10 seconds (credential cache).

Keep secret keys in server-side environment variables (X3_SECRET_KEY), never in client bundles or NEXT_PUBLIC_* variables, and never in git.

Proxy keys

The first-party proxy forwards the visitor's IP and country to 3x. 3x only trusts those forwarded values when the request carries a valid proxy key in x-3x-proxy-key – a secret key with the single scope ingest:proxy, bound to one project. Create it under Settings → Tracking → Proxy or with POST /v1/projects/{project}/proxy-keys; store it as X3_PROXY_KEY on the server that runs the proxy.

Dashboard sessions

POST /v1/auth/login with e-mail and password (or a magic link) returns an x3s_… session token. Its scopes follow the member's role in each organization; personal-data scopes (leads:*) additionally need the member's PII flag. Sessions expire after inactivity; POST /v1/auth/logout ends them. Sensitive actions (keys, destinations, deleting projects) need POST /v1/auth/sudo within the last 15 minutes.

Public sign-in endpoints (rate-limited, see Rate limits):

EndpointPurpose
POST /v1/auth/logine-mail + password → session
POST /v1/auth/magic-linksends a sign-in link (same answer whether the account exists)
POST /v1/auth/magic-link/verifyexchanges the link's token for a session
POST /v1/auth/password-reset„Passwort vergessen?“: mails a link to set a new password (same answer whether the account exists; 10 per IP and 15 minutes, then 429)
POST /v1/auth/password-reset/confirmthe link's token and the new password → session; the token is single use and valid 15 minutes, every other session, OAuth connection and the API sign-in of the account end
POST /v1/auth/signupcreates a user – with an invitation token, or self-signup when X3_ALLOW_SIGNUP=1
GET /v1/invitations/{token}invitation details for the accept page; POST /v1/invitations/{token}/accept (signed in) joins the organization
POST /v1/auth/demoread-only viewer session for 2 hours, only when X3_DEMO_LOGIN=1 (Demo)

Password reset

The reset mail links to /reset-password/<token> on the dashboard (or the neutral account area for people without a Growth Intelligence project). Opening the page uses nothing; only its form (POST) sets the password, so mail scanners that fetch links do not burn the token. The sign-in page of the API host (X3 App, Sales Engine, Claude) offers „Passwort vergessen?“ too, and every failed password sign-in shows „Kein Passwort gesetzt oder vergessen?“ with the reset and the sign-in link, for unknown addresses alike.

When an address is confirmed in a different browser than the one of the registration, the password chosen at the registration is removed for security (someone else could have registered the address). X3 then mails „Dein X3-Passwort wurde aus Sicherheitsgründen entfernt“ with a reset link.

X3 App

The X3 App for iOS and Android signs in with OAuth (client x3-mobile, Authorization Code with PKCE in the system browser) and holds an x3oat_… access token per device. How the sign-in works:

  • Client: x3-mobile is built into the server (a public client without secret; it is not registered dynamically). Its redirect URIs come from X3_MOBILE_REDIRECTS and are compared as exact strings – no loopback ports, no other hosts. Production allows the https callback https://<dashboard>/oauth/mobile/callback (Android verified App Link) and exactly one app scheme, io.x3growth.app:/oauth/callback (iOS, a private-use URI scheme per RFC 8252 §7.1 named after the bundle id). The scheme needs no domain association; another app claiming it gains nothing, because the code is bound to the app's PKCE verifier, valid 60 seconds and single use. The dev and preview builds use their own app schemes against staging.
  • Audience: the app asks for resource=<issuer>/v1 (metadata at /.well-known/oauth-protected-resource/v1). Only built-in clients get this audience; every other client is answered invalid_target, and app tokens are not accepted on /mcp.
  • Consent: always one explicit tap („X3 App auf diesem Gerät anmelden“); prompt=none is answered consent_required. The person can release all or only some organizations and projects.
  • Device: the app sends device_name with the code exchange; it appears in GET /v1/auth/oauth-grants (deviceLabel) and under KI-Apps, where „Gerät abmelden“ revokes the grant at once.
  • Refresh: tokens rotate on every refresh. A refresh token presented again after its rotation normally ends the grant (reuse detection); for the app a lost answer is tolerated: as long as no token of that rotation was ever used, the request gets a fresh pair instead. An app grant ends after 90 days without use and one year after the sign-in at the latest. POST /oauth/revoke with the refresh token signs the device out.
  • Sign-in by e-mail: the sign-in mail of the OAuth page also carries a 6 digit code that can be typed into the page where the sign-in started (5 tries per code).

What the token may do:

  • Scopes: at most analytics:read, ads:read, ads:write, conversions:read, conversions:write, leads:summary, leads:read, leads:status, leads:write, recordings:read, crm:read and config:write – never project:admin, org:admin, crm:write, events:write, ingest:proxy or project:create. In each organization the token holds no more than the person's own membership allows today.
  • Reads: every GET endpoint with secret-key or session auth, except exports, endpoints that return credentials, billing and admin endpoints.
  • Changes: only the endpoints marked X3 App in the API reference (lead status, notes and contact reveal, marking sessions seen, alerts, tasks and notices, pausing or stopping experiments, ad sync and a few more). Everything else answers **403 not_available_in_app**; endpoints that need a re-authentication (sudo) are never reachable with an app token.
  • Admin: /v1/admin/* answers 404, and platformAdmin is always false for an app token.

GET /v1/app/me returns the start data of the app for the signed-in person: the organizations and projects the token covers (with the membership role per project and whether the person administers it), the scopes in effect per organization, which features are locked and the dates of the Free pageview lock – no plan names, no prices. grantNarrowed is true when the person released only some organizations or projects to the app. The endpoint works with a dashboard session too.

Push notifications

The app registers its push token with PUT /v1/me/notifications/devices. A device is bound to the app's sign-in on it: signing out, „überall abmelden“, a password change or deleting the account ends that sign-in and the device gets no more pushes. Before every push the API checks again what that sign-in reaches today, so a person who left an organization or lost a permission gets nothing more from it. Which pushes a person gets (new leads, daily and weekly summary, unusually many interested visitors, quieter than usual, problems, tracking, budget, experiments, good news, account, news from X3), quiet hours and what the lock screen shows are set under /v1/me/notifications/settings and /v1/me/notifications/rules – the same settings as the web page Konto › Mitteilungen.

Pushes carry ids only (lead, task, project) plus a text without visitor data: the project name, counts and a channel such as „Google Ads“. With „Mit Details“ on the lock screen they add the lead's fit, country, page path and campaign name, never names, contact data, messages or answers. „1 Tag stumm“ on a push calls POST /v1/notifications/actions/mute with the signed token of that push; it needs no sign-in and can do nothing but mute that project's category for 24 hours.

Widgets

The app's home and lock screen widgets run outside the app and never see its sign-in. The app asks POST /v1/app/widgets/token for a widget token (x3w_…, 30 days, renewed whenever the app starts or goes to the background) and keeps it in the device's protected storage shared with its widgets. The widgets send it as Authorization: Bearer x3w_… to GET /v1/widgets/summary (visitors, leads, ad spend and cost per lead today, yesterday and the last 7 days per project) and GET /v1/widgets/projects (the projects to choose from). The token can do nothing else, reads exactly what the app's sign-in reaches at that moment and stops working when that sign-in ends (sign-out, „überall abmelden“, password change); then the routes answer 401 invalid_token.

Other X3 products

The Sales Engine and X3 Konto are products of their own with their own APIs (https://api.crm.x3growth.io, https://identity.x3growth.io). Their tokens are issued for their own audiences; a token of their clients is no token of this API (401). Requests to their old paths on this host are forwarded to them during a transition period.

Sending credentials

GET /v1/projects/my-site/analytics/overview?from=2026-10-01&to=2026-10-14 HTTP/1.1
Host: api.3x.example
Authorization: Bearer sk_3x_…
  • Projects can be addressed by id or slug (my-site); slugs are unique per organization, and org-slug/project-slug is always unambiguous. In a URL path, encode the slash: /v1/projects/acme%2Fmy-site/…. A bare slug that exists in several of your organizations answers 404 – use the org-slug/project-slug form or the id. Credential-less feed URLs (Google Ads CSV) always use the project id.
  • No access to a project at all → 404 (3x does not reveal that it exists). Access without the required scope → **403 insufficient_scope** with required.
  • A missing or malformed header → 401 with WWW-Authenticate: Bearer.

All error shapes: Errors.