Forbróirí

Authmarks SCIM 2.0 provisioning and SIEM audit stream API

Provision and deprovision Authmarks members from Okta or Microsoft Entra ID with SCIM 2.0, and pull your organisation's hash-chained audit log into a SIEM as NDJSON.

Foilsithe 2026-11-26 · 7 nóim. léitheoireachta

SCIM base URLhttps://www.authmarks.com/api/scim/v2/{orgId}
SCIM scopesscim_users, scim_groups (plan feature SCIM)
Audit streamGET https://www.authmarks.com/api/orgs/{orgId}/audit-stream
Audit stream scopeaudit_stream (plan feature SIEM streaming)
Audit stream formatNDJSON, authmarks-audit-stream-1
AuthBearer token (amk_ organisation API token)

What you get: two enterprise integrations that keep Authmarks in step with your identity and security tools. SCIM 2.0 lets your directory (Okta, Microsoft Entra ID or any SCIM client) add people, set their role and remove their access automatically. The audit stream lets your SIEM pull every admin and evidence-access event for your organisation as hash-chained NDJSON, so you can show that no event is missing or changed. Both use an organisation API token with its own scope.

SCIM 2.0 provisioning

Before you start

  • Your plan includes the SCIM feature.
  • You are an owner or admin. Create a token in Settings → Developers with the scopes scim_users and scim_groups, and nothing else. Label it after the directory (scim-okta-prod).
  • Your organisation id is shown in the Developers tab.

Base URL: https://www.authmarks.com/api/scim/v2/{orgId}

Supported endpoints

EndpointScopeNotes
GET /ServiceProviderConfigscim_usersPATCH and filter supported; bulk, sort, ETag and password change not supported.
GET /ResourceTypes, GET /Schemasscim_usersDiscovery.
GET /Usersscim_usersfilter=userName eq "x" or externalId eq "x", startIndex (from 1), count (default 100, max 200).
POST /Usersscim_usersCreates a person and takes a seat. 409 uniqueness if the userName or externalId exists. 403 when no seat is free.
GET /Users/{id}scim_usersOne person.
PUT /Users/{id}scim_usersReplaces the kept attributes. active: false deactivates.
PATCH /Users/{id}scim_usersadd, replace, remove, with or without path. Okta and Entra ID forms both work, including "False" as a string.
DELETE /Users/{id}scim_usersDeactivates, then the resource answers 404.
GET /Groupsscim_groupsThe three fixed groups. filter=displayName eq "x", excludedAttributes=members.
GET /Groups/{id}scim_groupsA group and its active members.
PATCH /Groups/{id}scim_groupsAdd members (gives the group's role) or remove them (back to member).
PUT /Groups/{id}scim_groupsThe members list becomes the whole truth for the group.
POST /Groupsscim_groups409 for one of the three names (it exists), 400 for any other.
DELETE /Groups/{id}scim_groups400 mutability: the groups are fixed.

Responses use application/scim+json and Cache-Control: no-store. Request bodies may be up to 256 KB.

The three groups

Group idDisplay nameRole it gives
membersAuthmarks membersmember
instructorsAuthmarks instructorsinstructor
adminsAuthmarks adminsadmin

The organisation owner is never changed or deactivated through SCIM (400 mutability).

What Authmarks keeps

userName, the email the person signs in with (the primary or work email when sent, else userName), externalId, given and family name, display name, active and role. Anything else a directory sends (password, locale, phone, the enterprise extension) is ignored and not stored.

What happens when you provision and deprovision

  • Create: a person who already has an Authmarks account under that email gets a membership to accept; anyone else gets an email invitation. Both take a seat. With no free seat, the create is refused with a SCIM 403 that names the seat count, never dropped silently.
  • First sign-in: signing in through your organisation's single sign-on accepts the invitation and links the SCIM user to the account.
  • Deactivate (active: false by PATCH or PUT, or DELETE): the membership or invitation is removed and organisation access ends at once. SSO will not join them again. Everything the person wrote, including records, seals and holds, is kept.
  • Plan changes: if the organisation loses the SCIM feature, reading and deactivating keep working, so your directory can always remove access. Creating, reactivating and changing people need the feature.
  • Every SCIM write is in the admin audit log with the actor org-api-token:<token id>.

Examples

Find a user:

curl -sS -G "https://www.authmarks.com/api/scim/v2/$AUTHMARKS_ORG/Users" \
  --data-urlencode 'filter=userName eq "jordan.lee@example.edu"' \
  -H "Authorization: Bearer $AUTHMARKS_SCIM_TOKEN"
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:ListResponse"],
  "totalResults": 1,
  "startIndex": 1,
  "itemsPerPage": 1,
  "Resources": [
    {
      "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:User",
        "urn:authmarks:params:scim:schemas:extension:2.0:User"
      ],
      "id": "6a1f0c2e-9d3b-4e7a-8f21-0b5c4d3e2a19",
      "externalId": "00u1abcd2EFGH3ijk4l5",
      "userName": "jordan.lee@example.edu",
      "name": { "givenName": "Jordan", "familyName": "Lee" },
      "displayName": "Jordan Lee",
      "active": true,
      "emails": [{ "value": "jordan.lee@example.edu", "type": "work", "primary": true }],
      "groups": [{ "value": "instructors", "display": "Authmarks instructors" }],
      "urn:authmarks:params:scim:schemas:extension:2.0:User": { "role": "instructor", "status": "joined" },
      "meta": {
        "resourceType": "User",
        "created": "2026-11-02T09:14:00Z",
        "lastModified": "2026-11-20T11:02:31Z",
        "location": "https://www.authmarks.com/api/scim/v2/3f2a9c1e-8b7d-4e21-9a0f-5c6d7e8f9a01/Users/6a1f0c2e-9d3b-4e7a-8f21-0b5c4d3e2a19"
      }
    }
  ]
}

The Authmarks extension's status is invited, joined or deactivated.

Create a user:

curl -sS -X POST "https://www.authmarks.com/api/scim/v2/$AUTHMARKS_ORG/Users" \
  -H "Authorization: Bearer $AUTHMARKS_SCIM_TOKEN" \
  -H "Content-Type: application/scim+json" \
  -d '{
    "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
    "userName": "sam.ortiz@example.edu",
    "externalId": "00u9zyxw8VUTS7rqp6o5",
    "name": { "givenName": "Sam", "familyName": "Ortiz" },
    "emails": [{ "value": "sam.ortiz@example.edu", "type": "work", "primary": true }],
    "active": true
  }'

Deactivate a user:

curl -sS -X PATCH "https://www.authmarks.com/api/scim/v2/$AUTHMARKS_ORG/Users/6a1f0c2e-9d3b-4e7a-8f21-0b5c4d3e2a19" \
  -H "Authorization: Bearer $AUTHMARKS_SCIM_TOKEN" \
  -H "Content-Type: application/scim+json" \
  -d '{
    "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
    "Operations": [{ "op": "replace", "path": "active", "value": false }]
  }'

Make someone an instructor:

curl -sS -X PATCH "https://www.authmarks.com/api/scim/v2/$AUTHMARKS_ORG/Groups/instructors" \
  -H "Authorization: Bearer $AUTHMARKS_SCIM_TOKEN" \
  -H "Content-Type: application/scim+json" \
  -d '{
    "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
    "Operations": [{ "op": "add", "path": "members", "value": [{ "value": "6a1f0c2e-9d3b-4e7a-8f21-0b5c4d3e2a19" }] }]
  }'

Okta setup

  1. In Okta, create an app integration from the SCIM 2.0 Test App (Header Auth) template.
  2. Base URL: https://www.authmarks.com/api/scim/v2/<your org id>.
  3. API token: the amk_ token with scim_users and scim_groups. Okta sends it as a bearer token.
  4. Enable Create Users, Update User Attributes and Deactivate Users.
  5. Map userName to the person's email.
  6. Under Push Groups, link your directory groups to Authmarks members, Authmarks instructors and Authmarks admins.

Microsoft Entra ID setup

  1. In Entra ID, add a non-gallery application (Enterprise applications → New application → Create your own application).
  2. Under Provisioning, set the mode to Automatic.
  3. Tenant URL: https://www.authmarks.com/api/scim/v2/<your org id>.
  4. Secret token: the amk_ token with scim_users and scim_groups. Choose Test Connection.
  5. Entra sends the userPrincipalName as userName. Either map userName to the email, or keep the UPN and make sure a work email is sent, because the email is what people sign in with.
  6. Assign groups and link them to the three Authmarks groups.

SCIM errors

Errors use the SCIM error schema (urn:ietf:params:scim:api:messages:2.0:Error) with status, detail and, where it applies, scimType.

StatusWhen
400Bad body or filter (invalidFilter), or a change the groups do not allow (mutability).
401Missing, wrong, revoked or expired token, or another organisation's id.
403The token lacks the scope, the plan lacks SCIM, or no seat is free.
404No such user or group.
409uniqueness: the userName or externalId already exists.
413Body over 256 KB.
429Over 600 requests a minute for the token. Retry-After: 60.
503Temporarily unavailable. The directory retries.

SIEM audit stream

When an owner or admin turns on audit-log streaming in organisation settings, Authmarks appends every relevant event for your organisation to its own hash-chained stream. Your SIEM can pull it.

Before you start

  • Your plan includes SIEM streaming.
  • Streaming is turned on in organisation settings.
  • Create a token with only the audit_stream scope (siem-splunk-prod).

Pull API

GET https://www.authmarks.com/api/orgs/{orgId}/audit-stream?cursor=<seq>&limit=<n>

ParameterDefaultNotes
cursor0Returns every event with seq greater than this, oldest first. 0 starts from the beginning.
limit5001 to 1000.
Response headerMeaning
Content-Typeapplication/x-ndjson; charset=utf-8, one envelope per line.
X-Authmarks-Next-CursorPass it as cursor on the next pull.
X-Authmarks-Head-SeqThe newest seq right now. You are caught up when the next cursor equals it.
X-Authmarks-Stream-Enabledtrue or false.

Errors: 400 invalid_query (bad cursor or limit), 401, 403 (scope or plan feature), 429, 503. Pulls are not written to the audit log (each one would itself be an event); the token's last-used time is updated.

The envelope

{"format":"authmarks-audit-stream-1","org_id":"3f2a9c1e-8b7d-4e21-9a0f-5c6d7e8f9a01","seq":1042,"occurred_at":"2026-11-25T21:14:03.120Z","source":"admin_audit","event":{"category":"membership","action":"update","table":"org_members","actor_ref":"p_5c1d9a0e7b3f4a2c8d6e1f0a9b8c7d6e"},"canonical":"{\"v\":1,\"org_id\":\"3f2a9c1e-…\",\"seq\":1042,…}","prev_hash":"8c1e…","event_hash":"4fa2…"}
FieldNotes
formatauthmarks-audit-stream-1.
seqGap-free per organisation, from 1. De-duplicate on (org_id, seq).
occurred_atISO 8601 UTC.
sourceadmin_audit (settings, membership, roles, SCIM, API tokens, holds, exports, support sessions), evidence_access (who opened which evidence), sso_sign_in (owner, admin and instructor sign-ins through your SSO) or stream (streaming turned on, changed or off).
eventcanonical, parsed, for convenience.
canonicalThe exact text that was hashed. Verify on this, not on event.
prev_hashevent_hash of seq - 1 (64 zeros for seq 1).
event_hashsha256(prev_hash + "\n" + canonical), hex.
actor_idOnly when the organisation chose to include Authmarks account ids. Outside the hashed body.

Events contain no document content, names, emails or free-text reasons. People appear as pseudonyms (p_ + 32 hex), stable per person and not reversible without a per-organisation key.

Pull and verify the chain (bash)

#!/usr/bin/env bash
set -euo pipefail
URL="https://www.authmarks.com/api/orgs/$AUTHMARKS_ORG/audit-stream"
cursor=$(cat .authmarks-cursor 2>/dev/null || echo 0)

while :; do
  curl -sS --fail-with-body -D headers.txt -o batch.ndjson \
    "$URL?cursor=$cursor&limit=1000" \
    -H "Authorization: Bearer $AUTHMARKS_AUDIT_TOKEN"
  cat batch.ndjson >> authmarks-audit.ndjson
  next=$(grep -i '^x-authmarks-next-cursor:' headers.txt | tr -d '\r' | awk '{print $2}')
  head=$(grep -i '^x-authmarks-head-seq:' headers.txt | tr -d '\r' | awk '{print $2}')
  echo "$next" > .authmarks-cursor
  [ "$next" = "$cursor" ] || [ "$next" -ge "$head" ] && break
  cursor=$next
done

Run it every minute from cron or your SIEM's script input. The cursor file keeps your place, so a restart never skips or repeats more than one batch.

Verify the chain (Python)

import hashlib
import json

GENESIS = "0" * 64


def verify(path, after_seq=0, after_hash=GENESIS):
    seq, prev = after_seq, after_hash
    with open(path, encoding="utf-8") as f:
        for line in f:
            e = json.loads(line)
            if e["seq"] != seq + 1:
                raise ValueError(f"gap before seq {e['seq']}")
            if e["prev_hash"] != prev:
                raise ValueError(f"broken link at seq {e['seq']}")
            digest = hashlib.sha256(f"{prev}\n{e['canonical']}".encode("utf-8")).hexdigest()
            if digest != e["event_hash"]:
                raise ValueError(f"hash mismatch at seq {e['seq']}")
            seq, prev = e["seq"], e["event_hash"]
    return seq


print("verified through seq", verify("authmarks-audit.ndjson"))

Push delivery

Besides pulling, owners and admins can add delivery destinations in organisation settings (Audit-log streaming to your SIEM): an HTTPS endpoint that receives signed NDJSON batches, or syslog over TLS (RFC 5425). Delivery is at least once with a durable cursor per destination, so de-duplicate on (org_id, seq).

Nótaí athruithe

  • 2026-11-26 — First published.

An bhfaca tú earráid? Seol ríomhphost chuig sales@authmarks.com agus ceartóimid an leathanach agus cuirfimid dáta leis an gceartúchán.