Developers

Authmarks API authentication: organization tokens and scopes

How Authmarks organization API tokens work for Canadian campus IT teams: the amk_ format, scopes and the plan features behind them, expiry, rotation, revocation, safe storage and what to do when a token leaks.

Published 2026-11-26 · 5 min read

AuthBearer token (Authorization header)
Token formatamk_ followed by 43 base64url characters
StorageSHA-256 hash only; displayed once
Live tokensUp to 20 per organization
ExpiryOptional, 1 to 730 days
Who manages tokensOrganization owners and admins

What this page covers: how to issue, scope, store, rotate and revoke the tokens that call Authmarks. A single kind of credential, the organization API token, serves the REST API, the MCP server, and SCIM provisioning and the audit stream. Every token belongs to exactly one organization and carries only the scopes you pick for it.

How tokens work

PropertyDetail
Formatamk_ then 43 base64url characters (32 random bytes).
DisplayedOnce only, at creation or rotation. Copy it at that moment.
StoredOnly as a SHA-256 hash, plus the first 12 characters so that admins can tell one token from another. Authmarks has no way to display a token a second time.
OrganizationEach token belongs to a single organization. Sent with a different organization's id, it returns 401, the same as an unknown token.
ScopesSet when the token is created and fixed after that. To change them, create a new token and revoke the old one.
Live tokensAt most 20 live (neither revoked nor expired) tokens per organization.
ExpiryOptional, from 1 to 730 days. With no expiry, the token stays valid until someone revokes it.
Last usedThe Developers tab records the last time each token was used.
WhoOwners and admins create, rotate and revoke tokens. Authmarks support staff cannot create or rotate a token, not even during a support session.
AuditEach creation, rotation and revocation is written to the organization's admin audit log before it takes place. Neither the token nor its hash is ever logged.

Every request carries the token as a bearer token:

curl -sS "https://www.authmarks.com/api/v1/orgs/$AUTHMARKS_ORG/assignments" \
  -H "Authorization: Bearer $AUTHMARKS_TOKEN"

Keep tokens out of URL query strings. URLs get copied into server logs, browser history and referrer headers.

Scopes

ScopeWhat it grantsPlan 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 among 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 keep in mind:

  • The three _read scopes, like the whole of REST API v1, are read-only. The two SCIM scopes can change who belongs to the organization, which is why they stand apart.
  • A scope that depends on a plan feature can be added only when the organization's plan includes it.
  • Any valid token, regardless of its scopes, may 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 fix is a new token that holds the scope.

Least privilege: one job, one token, fewest scopes

JobScopes
LMS health check that raises an alert when a grade return failslms_read
Overnight report listing unsealed submissionsassignments_read, records_read
AI coding agent looking through your data (MCP)Only what the task calls for, often assignments_read alone
Provisioning from Okta or Microsoft Entra IDscim_users, scim_groups
SIEM collectoraudit_stream

Rules of thumb:

  • A separate token for each tool or person. Name it after 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 service.
  • Keep writing and reading apart. A reporting script should never hold the SCIM scopes.
  • Set an expiry every time unless the token serves a long-running service. Pick the shortest expiry the job allows; an agent working on one project needs less time than a standing script.

Store tokens safely

Do:

  • Hold 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 program runs.
  • Limit read access on the secret to the one service that uses it.

Don't:

  • Commit a token to any repository, private ones included. Put .env in .gitignore.
  • Ship tokens in client-side code (browser JavaScript, mobile apps, browser extensions), where anyone can read them.
  • Paste tokens into chat, help desk tickets, AI prompts or screenshots.

Loading 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 such as amk_[A-Za-z0-9_-]{43} in gitleaks or in your code host's scanner) so that any committed token is flagged straight away.

Rotate a token

Rotating issues a new token with the same label and scopes and revokes the old one in the same instant.

  1. Under Settings → Developers → API tokens, select Rotate beside the token.
  2. Copy the new token (it is displayed once).
  3. Replace 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 is using it.

The old token stops working the moment you rotate, so update the secret in the same change window. To rotate a busy service with no downtime, first create a second token with identical scopes, move the service onto it, confirm it under last used, and only then revoke the old one.

Rotate as often as your organization's security policy sets, whenever someone with access leaves, and any time you are not sure who has seen a token.

Revoke a token

Select Revoke beside the token. It takes effect at once: the very next request 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 immediately.
  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. Review your admin audit log, and your SIEM if you stream to one, for activity during that period.
  5. Clean up wherever it leaked (rewrite git history, delete the message, rotate any other secret stored alongside it).
  6. If you believe Authmarks data was exposed, follow your incident process and get in touch as described on the security page. At a Canadian institution, your privacy office will also know whether PIPEDA or a provincial law such as Ontario's FIPPA or Quebec's Law 25 calls for a breach report; that decision belongs to the institution.

See Security for integrations for more.

Errors you may see

StatusCause
401 unauthorizedNo Authorization header; a token that is unknown, revoked or expired; or a different organization's id.
403 forbiddenThe token does not hold the scope, or the plan does not include the feature the scope depends on.
429 rate_limitedMore than 600 requests a minute on the token, or more than 30 failed authentications a minute from your address. Wait for Retry-After seconds.

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.