Overview
Service tokens are long-lived API tokens scoped to a customer (organization) or a single seat (advertiser). Use them when the caller is not a human user — backend services, ETL jobs, agent runtimes, multi-tenant tools, partner integrations. They are distinct from personal API keys, which are bound to an individual user. Service tokens survive user offboarding, can be scoped down to a single seat with a specific role, and have explicit lifecycle controls (expiresInDays, archive).
| Personal API key | Service token |
|---|---|
| Tied to a user account | Tied to a customer or seat |
| Revoked when user leaves | Survives user changes |
| One token per user | Many per customer |
| Best for: dashboards, scripts you run as yourself | Best for: server-to-server, agents, multi-tenant tools |
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. accessClientIdis a stable, non-secret identifier — safe to log, surface in admin UIs, and reference in audit trails.accessClientSecretis the credential — only shown once, at creation.
Prerequisites
An admin or read-write API key
You need an existing credential with permission to manage tokens — a
user API key from
agentic.scope3.com/user-api-keys,
or another service token with
ADMIN role.Decide the scope
Pick
CUSTOMER (acts across every seat) or SEAT (limited to one
advertiser). For seat-scoped tokens, you also choose a role
(ADMIN, READ_WRITE, READ) and an expiry between 1 and 365 days.Service-token endpoints live under
/api/v2/service-tokens, not under
/api/buyer/... or /api/storefront/.... They are mounted on the v2
shared router because the same token-management surface works for buyer
and storefront customers 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
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | no | Human-readable label, max 255 chars |
description | string | no | Free-form, max 1000 chars |
expiresInDays | integer | conditional | 1–365. Required when scope: SEAT |
scope | enum | no | CUSTOMER (default) or SEAT |
seatName | string | conditional | Required when scope: SEAT |
seatType | enum | no | BUYER or ACTIVATION — disambiguates if multiple seats share a name |
role | enum | conditional | ADMIN, READ_WRITE, or READ. Required when scope: SEAT |
Step 2: List or fetch existing tokens
Use the list endpoint to see what tokens exist for your customer (or for a specific seat). The list view never includes the secret — onlyaccessClientId, scope, expiry, and audit metadata.
| Query param | Type | Default | Notes |
|---|---|---|---|
seatId | string | — | Filter by seat |
includeArchived | boolean | false | Include revoked tokens |
take | integer | 50 | Page size, max 100 |
skip | integer | 0 | Offset |
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.Create the new token
POST /service-tokens with the same scope and role as the old one.
Capture fullToken and id from the response.Deploy to consumers
Update your secret manager and roll the new token out to every service
that holds the old one.
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.
Step 4: Revoke a token
Revocation is a soft delete — the token stops authenticating immediately, but its audit row is preserved.204 No Content.
Best practices
- Use seat scope when possible. A
SEAT-scoped token withREADrole 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 seat. Create a
SEAT-scoped token per child seat with the minimum role each integration needs. Best when child accounts have different administrators or you want clean per-tenant audit trails. - One customer-scoped token. Use
scope: CUSTOMERand rely on per-request seat selection. Best when a single team owns automation across every child seat. - Either way, never share a single token across unrelated tenants — it conflates audit trails and forces a global revocation if any tenant is compromised.
- One token per managed seat. Create a
Endpoint reference
All paths are relative tohttps://api.agentic.scope3.com/api/v2.
| Method | Path | Purpose |
|---|---|---|
GET | /service-tokens | List service tokens |
POST | /service-tokens | Create a service token (returns fullToken once) |
GET | /service-tokens/:id | Get a single service token |
PUT | /service-tokens/:id | Update name, description, or extend expiry |
DELETE | /service-tokens/:id | Archive (revoke) a service token |
Related
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.