Overview
API tokens authenticate your code against the Beeswax STP JSON API. They come in two flavours — test (for EVTE sandbox) and live (for production ATO) — and are managed from Settings → API Tokens.
This page covers the web UI for managing tokens. For how to actually use them in code, see:
- Authentication — the full auth model, scopes, security practices
- Getting started — zero to first ATO lodgement in 10 minutes
- API overview — what the API is and isn't
Creating a token
On the API Tokens page:
Choose the environment — Test or Live
- Test tokens (prefix
stp_test_...) talk to the ATO's EVTE sandbox via employers withenvironment: "evte". Safe for development, CI, staging. - Live tokens (prefix
stp_live_...) trigger real ATO lodgements via employers withenvironment: "production". Treat them like production passwords.
- Test tokens (prefix
Name the token — a label to identify what this token is used for, e.g. "Beeswax production", "Staging CI", "Aria's laptop".
Set an expiry date (optional) — the token will stop working after this date. Useful for short-lived integrations or mandatory rotation.
Choose scopes — the minimum set of capabilities this token needs. Granular scopes reduce blast radius if a token is leaked. See the Authentication guide for the full list.
Generate token — the full token value is shown once. Copy it immediately; we only keep a hash, so if you lose it you'll need to revoke and regenerate.
Environment isolation
This is the most important thing to understand about tokens:
A test token can never affect production data. A live token can never see test data.
This isolation is enforced at the database query layer, not just the UI. It's designed to be impossible to accidentally submit real pay events from a CI script that's meant to run against the sandbox.
Practical implications:
- Test and live employers are completely separate — data doesn't cross over
- If you create an employer with
environment: "evte"while holding a live token, the employer will be created but invisible to the API (use the UI to see both) - Webhooks are also environment-scoped — see Webhooks
Managing existing tokens
The token list is split into Test and Live tabs. Each token shows:
- The name
- A masked preview of the token (
stp_test_…abc4) - Last used timestamp
- Expiry (if set)
- Scopes
Revoking a token
Click Revoke next to any token. Revocation is immediate — the next request using the token returns 401 Unauthorized. Revoked tokens remain in the audit log but are hidden from the active view.
Rotating a token
To rotate a live token without downtime:
- Create a new token with the same scopes
- Deploy the new token to your servers
- Verify it's working (check
last_used_atin the UI) - Revoke the old token
The new token must match the environment of the old one — you can't rotate a test token to a live token mid-deployment.
Scopes
Tokens can be scoped to limit what they can do. See Authentication → Scopes for the full table.
Recommended patterns:
- Production integration: everything you need (typically all
:readand:writescopes exceptsubmissions:write) - CI / testing script: test environment, read-only scopes
- Reporting / dashboard:
employers:read,employees:read,pay_events:read,ytd:read - Webhook receiver: no API token needed — webhooks are server-to-you-only
Security best practices
- Treat tokens like passwords. Never commit them to git, even in test files. Use environment variables or a secrets manager.
- Scope tightly. A read-only report tool shouldn't have write access.
- Use test tokens for development. If a test token leaks, the blast radius is the sandbox — no real data affected.
- Rotate regularly. Annual rotation for production tokens is a reasonable baseline. Rotate immediately on suspected compromise.
- Monitor
last_used_at. Revoke dormant tokens. - Set expiry on temporary tokens. Contractors, migrations, debugging sessions — all good candidates.
- Never log tokens. Redact
Authorizationheaders in your application logs. - HTTPS only. We reject HTTP at the proxy layer.
Audit trail
Every token creation, revocation, and use is recorded in the Audit log. If a token is compromised, you can see exactly which requests it made and when — helpful for incident response.