開発者向け

Authmarks REST API quickstart: your first call in five minutes

Create an organisation API token, find your organisation id and make your first read-only Authmarks API call with curl, Node.js or Python, including pagination, errors and rate limits.

2026-11-26 公開 · 6 分で読めます

API versionv1
AuthBearer token (amk_ organisation API token)
Base URLhttps://www.authmarks.com/api/v1
AccessRead-only (GET and HEAD)
Rate limit600 requests a minute per token
OpenAPIhttps://www.authmarks.com/api/v1/openapi.json

What you get: a working, read-only connection to your organisation's Authmarks data in about five minutes. By the end of this page you will have an API token, your organisation id, a successful curl call, a pagination loop in bash, Node.js and Python, and a typed client generated from the OpenAPI document. The v1 API lists LMS connections, grade returns, assignments, submissions and sealed records. It never creates, changes or deletes anything.

For the full list of fields and errors, see the API reference. For token scopes and storage, see Authentication and scopes.

Step 1: create an API token

You need to be an owner or admin of the organisation.

  1. Sign in and open Settings → Developers (/dashboard/org?tab=developers).

  2. Under API tokens, choose Create token.

  3. Give it a label that says who uses it, for example nightly-report or lms-health-check.

  4. Choose only the scopes you need:

    ScopeLets the token read
    lms_readLMS connections and their grade-return log
    assignments_readAssignments
    records_readSubmissions per assignment and sealed records
  5. Optionally set an expiry (1 to 730 days). We recommend one.

  6. Copy the token. It starts with amk_ and is shown once. Authmarks stores only a SHA-256 hash of it, so it cannot be shown again. If you lose it, rotate or create a new one.

Put the token in an environment variable, never in code:

export AUTHMARKS_TOKEN="amk_paste_your_token_here"

Step 2: find your organisation id

The Developers tab shows your organisation id, a UUID such as 3f2a9c1e-8b7d-4e21-9a0f-5c6d7e8f9a01. Every v1 path starts with it:

export AUTHMARKS_ORG="3f2a9c1e-8b7d-4e21-9a0f-5c6d7e8f9a01"
export AUTHMARKS_API="https://www.authmarks.com/api/v1/orgs/$AUTHMARKS_ORG"

A token works only for its own organisation. Using it with another organisation's id answers 401, the same as an unknown token.

Step 3: make your first call

List your assignments (needs assignments_read):

curl -sS "$AUTHMARKS_API/assignments?limit=2" \
  -H "Authorization: Bearer $AUTHMARKS_TOKEN"
{
  "data": [
    {
      "id": "a7c1d2e3-4f56-4789-8abc-def012345678",
      "title": "Essay 2: Climate policy",
      "status": "active",
      "course_id": "c0ffee00-1111-4222-8333-444455556666",
      "module_id": "m0d01e00-aaaa-4bbb-8ccc-dddd00001111",
      "starts_at": "2026-11-02T08:00:00Z",
      "due_at": "2026-11-30T23:59:00Z",
      "created_at": "2026-10-28T14:12:09Z"
    },
    {
      "id": "b8d2e3f4-5a67-4890-9bcd-ef0123456789",
      "title": "Lab report 4",
      "status": "completed",
      "course_id": "c0ffee00-1111-4222-8333-444455556666",
      "module_id": null,
      "starts_at": null,
      "due_at": "2026-11-14T17:00:00Z",
      "created_at": "2026-10-20T09:30:00Z"
    }
  ],
  "next_cursor": "eyJvIjoyfQ"
}

Ids are opaque strings. Store them as text and never parse them.

Every endpoint with curl

All endpoints are GET, relative to https://www.authmarks.com/api/v1/orgs/{orgId}.

LMS connections (lms_read)

curl -sS "$AUTHMARKS_API/lms-connections" \
  -H "Authorization: Bearer $AUTHMARKS_TOKEN"
{
  "data": [
    {
      "id": "lc_6f1e2d3c",
      "label": "Canvas production",
      "issuer": "https://canvas.instructure.com",
      "client_id": "10000000000123",
      "product": "canvas",
      "status": "active",
      "source": "dynamic",
      "deployments": [{ "deployment_id": "42:8865aa05b4b79b64a91a86042e43af5ea8ae79eb", "status": "active" }],
      "created_at": "2026-09-01T10:00:00Z",
      "approved_at": "2026-09-01T10:05:12Z"
    },
    {
      "id": "lc_9a8b7c6d",
      "label": "Moodle staging",
      "issuer": "https://moodle.example.edu",
      "client_id": "ZqP3x0aBcD",
      "product": "moodle",
      "status": "pending",
      "source": "dynamic",
      "deployments": [],
      "created_at": "2026-11-24T16:40:00Z",
      "approved_at": null
    }
  ],
  "next_cursor": null
}

status is pending (waiting for an admin to approve it), active or disabled. Setting up a connection is covered in LTI 1.3 setup.

Grade returns for one connection (lms_read)

curl -sS "$AUTHMARKS_API/lms-connections/lc_6f1e2d3c/grade-returns?limit=50" \
  -H "Authorization: Bearer $AUTHMARKS_TOKEN"
{
  "data": [
    {
      "id": "gr_01HZX4",
      "resource_link_id": "f8b0c1d2-assignment-link",
      "lineitem": "https://canvas.example.edu/api/lti/courses/120/line_items/88",
      "activity_progress": "Submitted",
      "grading_progress": "PendingManual",
      "status": "sent",
      "created_at": "2026-11-25T21:14:03Z"
    },
    {
      "id": "gr_01HZX5",
      "resource_link_id": "f8b0c1d2-assignment-link",
      "lineitem": "https://canvas.example.edu/api/lti/courses/120/line_items/88",
      "activity_progress": "Submitted",
      "grading_progress": "PendingManual",
      "status": "failed",
      "created_at": "2026-11-25T21:15:40Z"
    }
  ],
  "next_cursor": "eyJvIjo1MH0"
}

Assignments (assignments_read)

curl -sS "$AUTHMARKS_API/assignments?limit=200" \
  -H "Authorization: Bearer $AUTHMARKS_TOKEN"

The response is shown in Step 3.

Submissions for one assignment (records_read)

curl -sS "$AUTHMARKS_API/assignments/a7c1d2e3-4f56-4789-8abc-def012345678/submissions" \
  -H "Authorization: Bearer $AUTHMARKS_TOKEN"
{
  "data": [
    {
      "student": { "id": "p_3b9c0d1e", "name": "Jordan Lee", "email": "jordan.lee@example.edu" },
      "document_id": "doc_7Hq2",
      "sealed": true,
      "record_id": "rec_k9x2_a1_4f8e2c1d9b7a6e5f",
      "sealed_at": "2026-11-25T18:02:44Z",
      "record_url": "https://www.authmarks.com/r/rec_k9x2_a1_4f8e2c1d9b7a6e5f"
    },
    {
      "student": { "id": "p_8e7f6a5b", "name": "Sam Ortiz", "email": "sam.ortiz@example.edu" },
      "document_id": "doc_9Lm4",
      "sealed": false,
      "record_id": null,
      "sealed_at": null,
      "record_url": null
    }
  ],
  "next_cursor": null
}

When a submission is not sealed, record_id, sealed_at and record_url are null. The API returns no scores, percentages or detector output.

One sealed record (records_read)

curl -sS "$AUTHMARKS_API/records/rec_k9x2_a1_4f8e2c1d9b7a6e5f" \
  -H "Authorization: Bearer $AUTHMARKS_TOKEN"
{
  "data": {
    "id": "rec_k9x2_a1_4f8e2c1d9b7a6e5f",
    "document_id": "doc_7Hq2",
    "sealed_at": "2026-11-25T18:02:44Z",
    "content_sha256": "9f2c4a1b0e8d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d9c8b7a6f5e4d3c2b",
    "record_url": "https://www.authmarks.com/r/rec_k9x2_a1_4f8e2c1d9b7a6e5f",
    "verify_url": "https://www.authmarks.com/api/records/rec_k9x2_a1_4f8e2c1d9b7a6e5f/public"
  }
}

A record that does not belong to your organisation's members or assignments answers 404.

Paginate through every result

Lists take limit (1 to 200, default 50) and cursor. Pass next_cursor from one page as cursor on the next. next_cursor is null on the last page. Cursors are opaque: do not build or edit them.

Bash (curl and jq)

#!/usr/bin/env bash
set -euo pipefail
: "${AUTHMARKS_TOKEN:?set AUTHMARKS_TOKEN}"
: "${AUTHMARKS_ORG:?set AUTHMARKS_ORG}"
API="https://www.authmarks.com/api/v1/orgs/$AUTHMARKS_ORG"

cursor=""
while :; do
  url="$API/assignments?limit=200"
  if [ -n "$cursor" ]; then
    url="$url&cursor=$(jq -rn --arg c "$cursor" '$c|@uri')"
  fi
  page=$(curl -sS --fail-with-body "$url" -H "Authorization: Bearer $AUTHMARKS_TOKEN")
  echo "$page" | jq -c '.data[]'
  cursor=$(echo "$page" | jq -r '.next_cursor // empty')
  [ -z "$cursor" ] && break
done

Node.js (18+, built-in fetch)

const BASE = `https://www.authmarks.com/api/v1/orgs/${process.env.AUTHMARKS_ORG}`;
const headers = { Authorization: `Bearer ${process.env.AUTHMARKS_TOKEN}` };

const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));

async function getPage(path, params) {
  const url = new URL(`${BASE}${path}`);
  for (const [key, value] of Object.entries(params)) {
    if (value != null) url.searchParams.set(key, value);
  }
  for (;;) {
    const response = await fetch(url, { headers });
    if (response.status === 429) {
      const wait = Number(response.headers.get("Retry-After") ?? "60");
      await sleep(wait * 1000);
      continue;
    }
    const body = await response.json();
    if (!response.ok) {
      throw new Error(`${response.status} ${body.error?.code}: ${body.error?.message}`);
    }
    return body;
  }
}

async function* listAll(path, limit = 200) {
  let cursor = null;
  do {
    const page = await getPage(path, { limit, cursor });
    yield* page.data;
    cursor = page.next_cursor;
  } while (cursor);
}

for await (const assignment of listAll("/assignments")) {
  console.log(assignment.id, assignment.title, assignment.due_at);
}

Python (requests)

import os
import time
import requests

BASE = f"https://www.authmarks.com/api/v1/orgs/{os.environ['AUTHMARKS_ORG']}"
session = requests.Session()
session.headers["Authorization"] = f"Bearer {os.environ['AUTHMARKS_TOKEN']}"


def get_page(path, **params):
    while True:
        response = session.get(f"{BASE}{path}", params=params, timeout=30)
        if response.status_code == 429:
            time.sleep(int(response.headers.get("Retry-After", "60")))
            continue
        if not response.ok:
            error = response.json().get("error", {})
            raise RuntimeError(f"{response.status_code} {error.get('code')}: {error.get('message')}")
        return response.json()


def list_all(path, limit=200):
    cursor = None
    while True:
        page = get_page(path, limit=limit, cursor=cursor)
        yield from page["data"]
        cursor = page["next_cursor"]
        if not cursor:
            return


for assignment in list_all("/assignments"):
    print(assignment["id"], assignment["title"], assignment["due_at"])

requests leaves out parameters whose value is None, so the first page is sent without a cursor.

Handle errors

Every error has the same shape:

{ "error": { "code": "forbidden", "message": "This token does not hold the records_read scope." } }
StatuscodeWhat to do
400invalid_requestFix the query, for example a limit outside 1 to 200 or an edited cursor.
401unauthorizedThe token is missing, wrong, revoked, expired or belongs to another organisation. Do not retry.
403forbiddenThe token lacks the scope for this endpoint, or the plan lacks the feature (lms_read needs LTI). Add the scope with a new token.
404not_foundThe id does not exist in your organisation.
405method_not_allowedOnly GET and HEAD are accepted.
429rate_limitedWait for the number of seconds in Retry-After, then retry.
503unavailableRetry with backoff (for example 2, 4, 8 seconds).

Retry only 429 and 503. Retrying a 401 or 403 will not succeed, and repeated failed sign-ins from one address are limited (30 a minute).

Rate limits

  • 600 requests a minute per token. Over the limit, the API answers 429 with a Retry-After header in seconds.
  • 30 failed authentications a minute per client address. After that, every attempt from the address is refused for the rest of the minute.

Use limit=200 for bulk reads to keep request counts low, and give each tool its own token so one busy job does not slow down another.

Generate a typed client from OpenAPI

The public OpenAPI 3.1 document describes every v1 endpoint, the public verification endpoints and the MCP endpoint:

curl -sS https://www.authmarks.com/api/v1/openapi.json -o authmarks-openapi.json

The security scheme is named orgToken (HTTP bearer, format amk_ token).

TypeScript with openapi-typescript and openapi-fetch

npx openapi-typescript https://www.authmarks.com/api/v1/openapi.json -o src/authmarks.d.ts
npm install openapi-fetch
import createClient from "openapi-fetch";
import type { paths } from "./authmarks";

const client = createClient<paths>({
  baseUrl: "https://www.authmarks.com",
  headers: { Authorization: `Bearer ${process.env.AUTHMARKS_TOKEN}` },
});

const { data, error } = await client.GET("/api/v1/orgs/{orgId}/assignments", {
  params: { path: { orgId: process.env.AUTHMARKS_ORG! }, query: { limit: 50 } },
});
if (error) console.error(error);
else console.log(data.data.map((a) => a.title));

Any language with OpenAPI Generator

npx @openapitools/openapi-generator-cli generate \
  -i https://www.authmarks.com/api/v1/openapi.json \
  -g python \
  -o ./authmarks-client

Swap -g python for java, go, csharp, ruby or another generator.

Next steps

出典

変更履歴

  • 2026-11-26 — First published.

誤りを見つけた場合は、sales@authmarks.com までメールでお知らせください。ページを訂正し、訂正日を記載します。