Dezvoltatori

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.

Publicat 2026-11-26 · 5 min de citit

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 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

PropertyDetail
Formatamk_ followed by 43 base64url characters (32 random bytes).
ShownOnce, when it is created or rotated. Copy it then.
StoredAs a SHA-256 hash only, plus the first 12 characters so admins can tell tokens apart. Authmarks cannot show you a token again.
OrganisationOne token belongs to one organisation. Used with another organisation's id, it answers 401 like an unknown token.
ScopesFixed at creation. To change scopes, create a new token and revoke the old one.
Live tokensUp to 20 live (not revoked, not expired) tokens per organisation.
ExpiryOptional, 1 to 730 days. Without one, the token lives until revoked.
Last usedThe Developers tab shows when each token was last used.
WhoOwners and admins create, rotate and revoke tokens. Authmarks support cannot make or rotate tokens, even during a support session.
AuditEvery 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

ScopeWhat it allowsPlan feature needed
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 and the discovery endpoints. Creates, changes 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 audit-log pull for your SIEM.SIEM streaming

Notes:

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

JobScopes
LMS health check that alerts on failed grade returnslms_read
Nightly report of unsealed submissionsassignments_read, records_read
AI coding agent exploring your data (MCP)Only what the task needs, often just assignments_read
Okta or Microsoft Entra ID provisioningscim_users, scim_groups
SIEM collectoraudit_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 .env to .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.

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

  1. Revoke it now in Settings → Developers. This ends access at once.
  2. Issue a replacement with the same or fewer scopes and update the service.
  3. Review what it could reach: its scopes, and its last-used time.
  4. Check your admin audit log and, if you stream it, your SIEM for activity in the window.
  5. Remove the token from where it leaked (rewrite git history, delete the message, rotate any other secret stored next to it).
  6. 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

StatusCause
401 unauthorizedNo Authorization header, an unknown, revoked or expired token, or another organisation's id.
403 forbiddenThe token lacks the scope, or the plan lacks the feature the scope needs.
429 rate_limitedOver 600 requests a minute for the token, or over 30 failed authentications a minute from your address. Wait Retry-After seconds.

Surse

Note de modificare

  • 2026-11-26 — First published.

Ați observat o greșeală? Scrieți la sales@authmarks.com și vom corecta pagina, menționând data corecturii.