Authorization
API Token vs Agent Token — what each is for, where to get it, and how to pass it in requests.
How authentication works
Every request to the SeaLights Public API must include a Bearer token in the Authorization header:
Authorization: Bearer <your-token>There is no session management or cookie-based auth. Each request is authenticated independently.
Two token types
The API uses two distinct token types. Each endpoint in the API reference states which one it requires.
API Token
Used by the vast majority of endpoints — anything that reads or writes data in the SeaLights platform from an external system or script.
When to use: Querying builds, coverage data, reports, TIA recommendations, app settings, audit logs.
How to get one:
In the SeaLights UI, click the gear icon → Settings
Left sidebar: Integration → API Tokens
Click Create token, give it a descriptive name
Copy the token — it is shown only once
In requests:
Agent Token
Used by a small number of endpoints that are called directly by SeaLights agents running in your CI/CD pipeline — for example, opening a test session, registering an integration build, or retrieving exclude-tests lists.
When to use: Integration build endpoints, test session endpoints, getting the agent default version.
How to get one:
In the SeaLights UI, click the gear icon → Settings
Left sidebar: Cockpit & Onboarding → Agent Tokens
Click Create token, give it a descriptive name
Copy the token — it is shown only once
In requests:
Which token does each endpoint use?
The API reference marks each endpoint. As a general guide:
Apps, branches, builds, coverage, reports
API Token
Audit logs, live labs, settings, code domains
API Token
TIA recommendations (read)
API Token
Agent default version
Agent Token
Integration builds
Agent Token
Test sessions (open, close, exclude-tests)
Agent Token
Security recommendations
Use separate tokens for separate systems — one per CI pipeline, one per script, not one shared across everything
Rotate tokens periodically via Settings → Tokens
If a token is compromised, delete it immediately in the SeaLights UI and create a replacement
Last updated
Was this helpful?

