Developers

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

AuthBearer token (Authorization header)
Token formatamk_ followed by 43 base64url characters
StorageSHA-256 hash only; shown once
Live tokensUp to 20 per organisation
ExpiryOptional, 1 to 730 days
Who manages tokensOrganisation 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

PropertyWhat it means
Formatamk_ then 43 base64url characters (32 random bytes).
ShownOnly once, at creation or rotation. Copy it at that moment.
StoredOnly 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.
OrganisationEach token belongs to a single organisation. Sent with another organisation's id, it returns 401, just as an unknown token does.
ScopesSet when the token is created. To change them, create a new token and revoke the old one.
Live tokensAn organisation can hold up to 20 live tokens (neither revoked nor expired).
ExpiryOptional, from 1 to 730 days. Without an expiry, the token lasts until it is revoked.
Last usedThe Developers tab records when each token was last used.
WhoOwners and admins create, rotate and revoke tokens. Authmarks support cannot create or rotate a token, not even during a support session.
AuditEach 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

ScopeWhat it permitsPlan feature required
assignments_readGET /assignments (REST) and list_assignments (MCP).None
records_readGET /assignments/{id}/submissions and GET /records/{id} (REST); list_submissions and get_record (MCP).None
lms_readGET /lms-connections and GET /lms-connections/{id}/grade-returns (REST); list_lms_connections and list_grade_returns (MCP).LTI
scim_usersSCIM 2.0 Users plus the discovery endpoints. Creates, updates and deactivates members.SCIM
scim_groupsSCIM 2.0 Groups: moves people between the member, instructor and admin groups.SCIM
audit_streamGET /api/orgs/{orgId}/audit-stream, the NDJSON pull of the audit log for your SIEM.SIEM streaming

Points to note:

  • The three _read scopes, 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

JobScopes to grant
A VLE health check that raises an alert on failed grade returnslms_read
An overnight report of submissions not yet sealedassignments_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 IDscim_users, scim_groups
A SIEM collectoraudit_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 .env to .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.

  1. In Settings → Developers → API tokens, select Rotate beside the token.
  2. Copy the new token (it is shown only once).
  3. Update the secret in your secrets manager or CI.
  4. Restart or redeploy the service that relies on it.
  5. 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

  1. Revoke it straight away under Settings → Developers. Access ends at once.
  2. Issue a replacement with the same scopes or fewer, and update the service.
  3. Work out what it could reach: its scopes and its last-used time.
  4. Look through your admin audit log and, if you stream it, your SIEM for activity during the window.
  5. Remove the token from wherever it leaked (rewrite git history, delete the message, rotate any other secret kept alongside it).
  6. 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

StatusWhy it happens
401 unauthorizedNo Authorization header was sent, the token is unknown, revoked or expired, or the id belongs to another organisation.
403 forbiddenThe token does not hold the scope, or the plan does not include the feature the scope relies on.
429 rate_limitedMore 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

Change notes

  • 2026-11-26 — First published.

Spotted an error? Email sales@authmarks.com and we will correct the page and date the correction.