Authmarks API authentication: organisation tokens and scopes
How Authmarks organisation API tokens work: the amk_ format, scopes and the plan features they need, expiry, rotation, revocation, safe storage and what to do if a token leaks.
Veröffentlicht am 2026-11-26 · 5 Min. Lesezeit
| Auth | Bearer token (Authorization header) |
|---|---|
| Token format | amk_ followed by 43 base64url characters |
| Storage | SHA-256 hash only; shown once |
| Live tokens | Up to 20 per organisation |
| Expiry | Optional, 1 to 730 days |
| Who manages tokens | Organisation owners and admins |
What you get: everything you need to issue, scope, store, rotate and revoke the tokens that call Authmarks. One kind of credential, the organisation API token, is used by the REST API, the MCP server, SCIM provisioning and the audit stream. Each token belongs to one organisation and holds only the scopes you choose.
How tokens work
| Property | Detail |
|---|---|
| Format | amk_ followed by 43 base64url characters (32 random bytes). |
| Shown | Once, when it is created or rotated. Copy it then. |
| Stored | As a SHA-256 hash only, plus the first 12 characters so admins can tell tokens apart. Authmarks cannot show you a token again. |
| Organisation | One token belongs to one organisation. Used with another organisation's id, it answers 401 like an unknown token. |
| Scopes | Fixed at creation. To change scopes, create a new token and revoke the old one. |
| Live tokens | Up to 20 live (not revoked, not expired) tokens per organisation. |
| Expiry | Optional, 1 to 730 days. Without one, the token lives until revoked. |
| Last used | The Developers tab shows when each token was last used. |
| Who | Owners and admins create, rotate and revoke tokens. Authmarks support cannot make or rotate tokens, even during a support session. |
| Audit | Every create, rotate and revoke is written to the organisation's admin audit log before it happens. The token and its hash are never logged. |
Send the token as a bearer token on every request:
curl -sS "https://www.authmarks.com/api/v1/orgs/$AUTHMARKS_ORG/assignments" \
-H "Authorization: Bearer $AUTHMARKS_TOKEN"
Never put a token in a URL query string. URLs end up in logs, browser history and referrer headers.
Scopes
| Scope | What it allows | Plan feature needed |
|---|---|---|
assignments_read | GET /assignments (REST) and list_assignments (MCP). | None |
records_read | GET /assignments/{id}/submissions and GET /records/{id} (REST); list_submissions and get_record (MCP). | None |
lms_read | GET /lms-connections and GET /lms-connections/{id}/grade-returns (REST); list_lms_connections and list_grade_returns (MCP). | LTI |
scim_users | SCIM 2.0 Users and the discovery endpoints. Creates, changes and deactivates members. | SCIM |
scim_groups | SCIM 2.0 Groups: moves people between the member, instructor and admin groups. | SCIM |
audit_stream | GET /api/orgs/{orgId}/audit-stream, the NDJSON audit-log pull for your SIEM. | SIEM streaming |
Notes:
- The three
_readscopes and the REST API v1 are read-only. The two SCIM scopes can change membership, which is why they are kept separate. - A scope that needs a plan feature can only be added when the organisation's plan includes that feature.
- Any valid token, whatever its scopes, can call the MCP tool
verify_hash, which runs the same check as the public verify-by-hash endpoint. - A missing scope answers
403 forbidden. Fix it with a new token that holds the scope.
Least privilege: one job, one token, fewest scopes
| Job | Scopes |
|---|---|
| LMS health check that alerts on failed grade returns | lms_read |
| Nightly report of unsealed submissions | assignments_read, records_read |
| AI coding agent exploring your data (MCP) | Only what the task needs, often just assignments_read |
| Okta or Microsoft Entra ID provisioning | scim_users, scim_groups |
| SIEM collector | audit_stream |
Rules of thumb:
- One token per tool or person. Label it with the tool and owner (
siem-splunk-prod,agent-cursor-jlee). Revoking one never breaks another, and the last-used time tells you who is still active. - Never mix write and read. Do not give a reporting script the SCIM scopes.
- Always set an expiry for anything that is not a long-lived service. Choose the shortest expiry the job needs; an agent for a single project needs less than a standing script.
Store tokens safely
Do:
- Keep tokens in a secrets manager (AWS Secrets Manager, Google Secret Manager, Azure Key Vault, HashiCorp Vault, 1Password, Doppler) or your CI system's encrypted secrets.
- Load them into environment variables at run time.
- Restrict who can read the secret to the service that uses it.
Do not:
- Commit tokens to a repository, even a private one. Add
.envto.gitignore. - Put tokens in client-side code (browser JavaScript, mobile apps, browser extensions). Anyone can read them there.
- Paste tokens into chat, tickets, AI prompts or screenshots.
Reading a token from the environment:
# .env (never committed)
AUTHMARKS_TOKEN=amk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
AUTHMARKS_ORG=3f2a9c1e-8b7d-4e21-9a0f-5c6d7e8f9a01
const token = process.env.AUTHMARKS_TOKEN;
if (!token?.startsWith("amk_")) {
throw new Error("AUTHMARKS_TOKEN is not set");
}
import os
token = os.environ.get("AUTHMARKS_TOKEN", "")
if not token.startswith("amk_"):
raise SystemExit("AUTHMARKS_TOKEN is not set")
Add a secret-scanning rule for the amk_ prefix to your repository (for example a custom pattern amk_[A-Za-z0-9_-]{43} in gitleaks or your code host's scanner), so a committed token is flagged at once.
Rotate a token
Rotation creates a new token with the same label and scopes, and revokes the old one at the same moment.
- In Settings → Developers → API tokens, choose Rotate next to the token.
- Copy the new token (shown once).
- Update the secret in your secrets manager or CI.
- Restart or redeploy the service that uses it.
- Check the new token's last used time to confirm the service picked it up.
Because the old token stops working immediately, update the secret within the same change window. For zero-downtime rotation of a busy service, create a second token with the same scopes first, switch the service to it, confirm it in last used, then revoke the old one.
Rotate on the schedule your organisation's security policy sets, when someone with access leaves, and whenever you are unsure who has seen a token.
Revoke a token
Choose Revoke next to the token. Revocation takes effect immediately: the next request with that token answers 401. A revoked token cannot be restored. Revoked tokens stay in the list (and in the audit log) as a record.
If a token leaks
- Revoke it now in Settings → Developers. This ends access at once.
- Issue a replacement with the same or fewer scopes and update the service.
- Review what it could reach: its scopes, and its last-used time.
- Check your admin audit log and, if you stream it, your SIEM for activity in the window.
- Remove the token from where it leaked (rewrite git history, delete the message, rotate any other secret stored next to it).
- If you think Authmarks data was exposed, follow your incident process and contact us as described on the security page.
More in Security for integrations.
Errors you may see
| Status | Cause |
|---|---|
401 unauthorized | No Authorization header, an unknown, revoked or expired token, or another organisation's id. |
403 forbidden | The token lacks the scope, or the plan lacks the feature the scope needs. |
429 rate_limited | Over 600 requests a minute for the token, or over 30 failed authentications a minute from your address. Wait Retry-After seconds. |
Quellen
- RFC 6750, OAuth 2.0 Bearer Token Usage — Stand 2026-11-26
Änderungshinweise
- 2026-11-26 — First published.
Fehler entdeckt? Schreiben Sie an sales@authmarks.com, und wir korrigieren die Seite und datieren die Korrektur.