Authmarks API authentication: organisation tokens and their scopes
How Authmarks organisation API tokens work: the amk_ format, scopes and the plan features behind them, expiry, rotation, revocation, storing tokens safely and what to do if one is leaked.
Published 2026-11-26 · 5 min read
| 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 this page gives you: all you need to issue, scope, store, rotate and revoke the tokens that call Authmarks. A single kind of credential, the organisation API token, serves the REST API, the MCP server, and SCIM provisioning and the audit stream. Every token belongs to one organisation and carries only the scopes you pick.
In a UK university, these tokens are usually held by central IT services or the team that runs the VLE. Treat them like any other privileged credential under your information security policy.
How tokens work
| Property | What it means |
|---|---|
| Format | amk_ then 43 base64url characters (32 random bytes). |
| Shown | Only once, at creation or rotation. Copy it at that moment. |
| Stored | Only as a SHA-256 hash, together with the first 12 characters so that admins can distinguish tokens. Authmarks has no way to show you a token again. |
| Organisation | Each token belongs to a single organisation. Sent with another organisation's id, it returns 401, just as an unknown token does. |
| Scopes | Set when the token is created. To change them, create a new token and revoke the old one. |
| Live tokens | An organisation can hold up to 20 live tokens (neither revoked nor expired). |
| Expiry | Optional, from 1 to 730 days. Without an expiry, the token lasts until it is revoked. |
| Last used | The Developers tab records when each token was last used. |
| Who | Owners and admins create, rotate and revoke tokens. Authmarks support cannot create or rotate a token, not even during a support session. |
| Audit | Each creation, rotation and revocation is written to the organisation's admin audit log before it takes effect. Neither the token nor its hash is ever logged. |
Send the token as a bearer token with every request:
curl -sS "https://www.authmarks.com/api/v1/orgs/$AUTHMARKS_ORG/assignments" \
-H "Authorization: Bearer $AUTHMARKS_TOKEN"
Never place a token in a URL query string. URLs find their way into logs, browser history and referrer headers.
Scopes
| Scope | What it permits | Plan feature required |
|---|---|---|
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 plus the discovery endpoints. Creates, updates 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 pull of the audit log for your SIEM. | SIEM streaming |
Points to note:
- The three
_readscopes, like the REST API v1 itself, are read-only. The two SCIM scopes can change membership, so they are kept apart. - A scope that relies on a plan feature can be added only if the organisation's plan includes that feature.
- Any valid token, whichever scopes it holds, can call the MCP tool
verify_hash, which performs the same check as the public verify-by-hash endpoint. - A missing scope returns
403 forbidden. The remedy is a new token holding that scope.
Least privilege: one job, one token, fewest scopes
| Job | Scopes to grant |
|---|---|
| A VLE health check that raises an alert on failed grade returns | lms_read |
| An overnight report of submissions not yet sealed | assignments_read, records_read |
| An AI coding agent exploring your data (MCP) | Just what the task needs, often only assignments_read |
| Provisioning from Okta or Microsoft Entra ID | scim_users, scim_groups |
| A SIEM collector | audit_stream |
Rules of thumb:
- A separate token for each tool or person. Label it with the tool and its owner (
siem-splunk-prod,agent-cursor-jlee). Revoking one never breaks the others, and the last-used time shows you which are still in use. - Keep write and read apart. A reporting script should never hold the SCIM scopes.
- Set an expiry on anything that is not a long-running service. Pick the shortest expiry the job allows; an agent working on a single project needs less than a standing script does.
Store tokens safely
Do:
- Keep tokens in a secrets manager (AWS Secrets Manager, Google Secret Manager, Azure Key Vault, HashiCorp Vault, 1Password, Doppler) or in your CI system's encrypted secrets.
- Load them into environment variables when the job runs.
- Limit read access to the secret to the service that uses it.
Don't:
- Commit tokens to a repository, private or not. Add
.envto.gitignore. - Embed tokens in client-side code (browser JavaScript, mobile apps, browser extensions), where anyone can read them.
- Paste tokens into chats, support 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 (a custom pattern amk_[A-Za-z0-9_-]{43} in gitleaks or in your code host's scanner, for instance), so that a committed token is flagged straight away.
Rotate a token
Rotating creates a new token with the same label and scopes and revokes the old one at that same instant.
- In Settings → Developers → API tokens, select Rotate beside the token.
- Copy the new token (it is shown only once).
- Update the secret in your secrets manager or CI.
- Restart or redeploy the service that relies on it.
- Look at the new token's last used time to confirm the service has picked it up.
Since the old token stops working at once, update the secret in the same change window. To rotate a busy service without any downtime, first create a second token with the same scopes, move the service onto it, confirm it under last used, and only then revoke the old one.
Rotate on whatever schedule your organisation's security policy sets, whenever someone with access leaves, and any time you are unsure who has seen a token.
Revoke a token
Select Revoke beside the token. Revocation is immediate: the next request made with that token returns 401. A revoked token cannot be brought back. Revoked tokens remain in the list (and in the audit log) for the record.
If a token leaks
- Revoke it straight away under Settings → Developers. Access ends at once.
- Issue a replacement with the same scopes or fewer, and update the service.
- Work out what it could reach: its scopes and its last-used time.
- Look through your admin audit log and, if you stream it, your SIEM for activity during the window.
- Remove the token from wherever it leaked (rewrite git history, delete the message, rotate any other secret kept alongside it).
- If you believe Authmarks data was exposed, follow your incident process (in the UK this may include your institution's own assessment of whether a personal data breach occurred under UK GDPR) and contact us as set out on the security page.
There is more in Security for integrations.
Errors you may see
| Status | Why it happens |
|---|---|
401 unauthorized | No Authorization header was sent, the token is unknown, revoked or expired, or the id belongs to another organisation. |
403 forbidden | The token does not hold the scope, or the plan does not include the feature the scope relies on. |
429 rate_limited | More than 600 requests a minute for the token, or more than 30 failed authentications a minute from your address. Wait the number of seconds in Retry-After. |
Sources
- RFC 6750, OAuth 2.0 Bearer Token Usage — as of 2026-11-26
Change notes
- 2026-11-26 — First published.
Spotted an error? Email sales@authmarks.com and we will correct the page and date the correction.