Skip to main content

Overview

Service tokens are long-lived API tokens scoped to an account (all of its advertisers) or a single advertiser. Use them when the caller is not a human user — backend services, ETL jobs, agent runtimes, multi-tenant tools, partner integrations. Each customer-owned service token also establishes a workload identity for the software using that credential. workloadUid identifies the workload; credentialVersion identifies the exact credential; and adcpCallerUri is the stable caller identity used for AdCP governance delegation. Internal Scope3 system tokens do not receive buyer workload identities. They are distinct from personal API keys, which belong to an individual user. Service tokens survive user offboarding, can be scoped down to a single advertiser with a specific role, and have explicit lifecycle controls (expiresInDays, archive). Both are bearer credentials — every request sends Authorization: Bearer scope3_<token>.

Token format

A service token is a single opaque string with three parts joined by underscores:
  • The scope3_ prefix lets us recognize the token at the edge.
  • accessClientId is a non-secret identifier for this credential version — safe to log, surface in admin UIs, and reference in audit trails.
  • accessClientSecret is the credential — only shown once, at creation.
The full token (fullToken field on the create response) is shown exactly once, on the response to POST /service-tokens. We store only a hash; we cannot show it to you again. If you lose it, revoke the token and create a new one.

Prerequisites

1

An admin or read-write API key

You need an existing credential with permission to manage tokens — a user API key from interchange.io/user-api-keys, or another service token with ADMIN role.
2

Decide the scope

Pick CUSTOMER (acts across every advertiser) or ADVERTISER (limited to one advertiser). For advertiser-scoped tokens, you also choose a role (ADMIN, READ_WRITE, READ) and an expiry between 1 and 365 days.
3

A secret manager

Plan where you’ll store fullToken. Service tokens act on your organization’s behalf — keep them in Google Secret Manager, AWS Secrets Manager, HashiCorp Vault, or equivalent. Never commit them to git.
All examples below use:
Service-token endpoints live under /api/v2/service-tokens, not under /api/v2/buyer/... or /api/v2/storefront/.... They are mounted on the v2 shared router because the same token-management surface works for buyer and storefront accounts alike. Most other v2 endpoints sit under a buyer/storefront mount — service tokens are the exception.

Step 1: Create a service token

POST /service-tokens returns the new token, including the one-time-only fullToken field. Capture it before doing anything else.
Response
Capture fullToken and store it in your secret manager immediately. After this response, only accessClientId is retrievable.

Request body

Selecting an advertiser per request

Account-scoped (CUSTOMER) tokens and user API keys select the advertiser to act on by sending the x-scope3-seat-id request header with the numeric advertiser ID:
The header name intentionally keeps its legacy seat spelling — it is a stable wire contract that predates the seat→advertiser rename. The value it carries is the advertiser ID. Advertiser-scoped tokens don’t need it: they are scoped to one advertiser at creation, and a header naming a different advertiser is rejected with 403.

Step 2: List or fetch existing tokens

Use the list endpoint to see what tokens exist for your account (or for a specific advertiser). The list view never includes the secret — only accessClientId, workload and credential identity, scope, expiry, and audit metadata.
To inspect a single token (for example, before extending its expiry):
You can also rename a token or extend its expiry through the update endpoint. You cannot shorten the expiry through this endpoint — to invalidate a token sooner, archive it (Step 4).

Step 3: Rotate a token

Treat service tokens like any other long-lived credential and rotate on a schedule. The pattern is “create new, deploy, revoke old” — never edit the existing token in place. Today, POST /service-tokens creates a new workload identity. Until the lineage-preserving replacement flow is available for your account, the manual rotation below therefore starts a new workloadUid; retain the old and new ids in your deployment record so their activity can be audited separately.
1

Create the new token

POST /service-tokens with the same scope and role as the old one. Capture fullToken and id from the response.
2

Deploy to consumers

Update your secret manager and roll the new token out to every service that holds the old one.
3

Confirm rollout completed

Wait until you’ve confirmed all consumers have switched — for example, by checking deploy status, draining staging traffic, or watching error rates after a forced restart. Don’t revoke the old token until you’re sure nothing still depends on it.
4

Revoke the old token

DELETE /service-tokens/<old_id>. Any service still using the old token will start receiving 401 Unauthorized, which is your final signal that rollout missed somewhere.
Set expiresInDays to a value shorter than your rotation window so an unrotated token expires on its own — defense-in-depth for the case where a token is forgotten.

Step 4: Revoke a token

Revocation is a soft delete — the token stops authenticating immediately, but its audit row is preserved.
Returns 204 No Content.
Rotate on suspected leak. If a token might have been exposed (CI log, shared screen, leaked dependency), revoke it via DELETE /service-tokens/:id immediately, then issue a replacement. Do not wait for confirmation.

Best practices

  • Use advertiser scope when possible. An ADVERTISER-scoped token with READ role cannot move spend, even if exfiltrated. Default to least-privilege: pick the narrowest scope and lowest role that lets the integration do its job.
  • One token per workload. If two services have different lifecycles or different blast radii, give them separate tokens. That way a leak or rotation only affects one workload at a time.
  • Treat as a credential. Never commit tokens to git, never paste them into chat or email, never hard-code them in client-side bundles.
  • Multi-tenant tools have two patterns.
    • One token per managed advertiser. Create an ADVERTISER-scoped token per managed advertiser with the minimum role each integration needs. Best when the advertisers have different administrators or you want clean per-tenant audit trails.
    • One account-scoped token. Use scope: CUSTOMER and rely on per-request advertiser selection. Best when a single team owns automation across every managed advertiser.
    • Either way, never share a single token across unrelated tenants — it conflates audit trails and forces a global revocation if any tenant is compromised.

Endpoint reference

All paths are relative to https://api.interchange.io/api/v2.

Authentication

Bearer token format, header conventions, and how personal API keys differ from service tokens.

Errors

Status codes and JSON error shapes returned by the service token endpoints — including auth and validation failures.