Authmarks SCIM 2.0 provisioning and SIEM audit stream API (India)
For identity and security teams at Indian universities: provision and deprovision Authmarks members from Okta or Microsoft Entra ID through SCIM 2.0, and pull your organisation's hash-chained audit log into a SIEM as NDJSON.
Published 2026-11-26 · 8 min read
| SCIM base URL | https://www.authmarks.com/api/scim/v2/{orgId} |
|---|---|
| SCIM scopes | scim_users, scim_groups (plan feature SCIM) |
| Audit stream | GET https://www.authmarks.com/api/orgs/{orgId}/audit-stream |
| Audit stream scope | audit_stream (plan feature SIEM streaming) |
| Audit stream format | NDJSON, authmarks-audit-stream-1 |
| Auth | Bearer token (amk_ organisation API token) |
What you get: two enterprise integrations that keep Authmarks aligned with the identity and security tools your university IT cell already runs. SCIM 2.0 allows your directory (Okta, Microsoft Entra ID or any SCIM client) to add people, assign their role and withdraw their access automatically, for example as faculty join or leave at the start of a semester. The audit stream allows your SIEM to pull every admin and evidence-access event for your organisation as hash-chained NDJSON, so that you can demonstrate that no event has been removed or altered. Each uses an organisation API token with a scope of its own.
SCIM 2.0 provisioning
Before you start
- Your plan includes the SCIM feature.
- You are an owner or admin. Create a token under Settings → Developers carrying the scopes
scim_usersandscim_groupsand nothing more. Name it after the directory (scim-okta-prod). - Your organisation id is displayed in the Developers tab.
Base URL: https://www.authmarks.com/api/scim/v2/{orgId}
Supported endpoints
| Endpoint | Scope | Notes |
|---|---|---|
GET /ServiceProviderConfig | scim_users | PATCH and filter are supported; bulk, sort, ETag and password change are not. |
GET /ResourceTypes, GET /Schemas | scim_users | Discovery endpoints. |
GET /Users | scim_users | filter=userName eq "x" or externalId eq "x", startIndex (starting at 1), count (default 100, maximum 200). |
POST /Users | scim_users | Creates a person, who occupies a seat. Returns 409 uniqueness if the userName or externalId already exists, and 403 when no seat is available. |
GET /Users/{id} | scim_users | A single person. |
PUT /Users/{id} | scim_users | Replaces the attributes Authmarks keeps. active: false deactivates the person. |
PATCH /Users/{id} | scim_users | add, replace, remove, with or without path. Both the Okta and the Entra ID forms work, including "False" sent as a string. |
DELETE /Users/{id} | scim_users | Deactivates the person, after which the resource returns 404. |
GET /Groups | scim_groups | The three fixed groups. filter=displayName eq "x", excludedAttributes=members. |
GET /Groups/{id} | scim_groups | One group with its active members. |
PATCH /Groups/{id} | scim_groups | Adds members (granting the group's role) or removes them (returning them to member). |
PUT /Groups/{id} | scim_groups | The members list becomes the complete membership of the group. |
POST /Groups | scim_groups | 409 for one of the three names (it already exists), 400 for any other name. |
DELETE /Groups/{id} | scim_groups | 400 mutability, since the groups are fixed. |
Responses are sent as application/scim+json with Cache-Control: no-store. Request bodies can be up to 256 KB.
The three groups
| Group id | Display name | Role granted |
|---|---|---|
members | Authmarks members | member |
instructors | Authmarks instructors | instructor |
admins | Authmarks admins | admin |
The organisation owner can never be changed or deactivated through SCIM (400 mutability).
What Authmarks keeps
userName, the email address the person signs in with (the primary or work email when one is sent, otherwise 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 never stored. This narrow set can help your institution when it considers its duties under the Digital Personal Data Protection Act, 2023; how the Act applies is for your institution's advisers to decide.
What happens when you provision and deprovision
- Create: someone who already holds an Authmarks account under that email receives a membership to accept; anyone else receives an email invitation. Either way a seat is used. When no seat is free, the create is refused with a SCIM
403stating the seat count; it is never dropped silently. - First sign-in: signing in through your organisation's single sign-on accepts the invitation and links the SCIM user with the account.
- Deactivate (
active: falsethrough PATCH or PUT, or DELETE): the membership or invitation is removed and access to the organisation ends immediately. SSO will not add the person back. Everything they wrote, including records, seals and holds, is retained. - Plan changes: should the organisation lose the SCIM feature, reading and deactivating continue to work, so your directory can always withdraw access. Creating, reactivating and changing people require the feature.
- Every SCIM write is entered in the admin audit log with the actor
org-api-token:<token id>.
Examples
Look up 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 status in the Authmarks extension 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 }]
}'
Give someone the instructor role:
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
- In Okta, create an app integration based on the SCIM 2.0 Test App (Header Auth) template.
- Base URL:
https://www.authmarks.com/api/scim/v2/<your org id>. - API token: the
amk_token carryingscim_usersandscim_groups. Okta sends it as a bearer token. - Switch on Create Users, Update User Attributes and Deactivate Users.
- Map
userNameto the person's email address. - Under Push Groups, link your directory groups to
Authmarks members,Authmarks instructorsandAuthmarks admins.
Microsoft Entra ID setup
If your university already issues staff and student accounts through Microsoft 365, Entra ID is usually the directory to connect.
- In Entra ID, add a non-gallery application (Enterprise applications → New application → Create your own application).
- Under Provisioning, set the mode to Automatic.
- Tenant URL:
https://www.authmarks.com/api/scim/v2/<your org id>. - Secret token: the
amk_token carryingscim_usersandscim_groups. Select Test Connection. - Entra sends the userPrincipalName as
userName. Either mapuserNameto the email address, or keep the UPN and ensure that a work email is also sent, because the email is what people sign in with. - Assign groups and link them to the three Authmarks groups.
SCIM errors
Errors follow the SCIM error schema (urn:ietf:params:scim:api:messages:2.0:Error), with status, detail and, where relevant, scimType.
| Status | When it occurs |
|---|---|
| 400 | A malformed body or filter (invalidFilter), or a change the groups do not permit (mutability). |
| 401 | The token is missing, wrong, revoked or expired, or the id belongs to another organisation. |
| 403 | The token does not carry the scope, the plan does not include SCIM, or no seat is free. |
| 404 | The user or group does not exist. |
| 409 | uniqueness: the userName or externalId is already in use. |
| 413 | The body is larger than 256 KB. |
| 429 | More than 600 requests a minute for the token. Retry-After: 60. |
| 503 | Temporarily unavailable; the directory will retry. |
SIEM audit stream
Once an owner or admin switches on audit-log streaming in organisation settings, Authmarks appends every relevant event for your organisation to a hash-chained stream of its own, which your SIEM can pull.
Before you start
- Your plan includes SIEM streaming.
- Streaming has been switched on in organisation settings.
- Create a token carrying only the
audit_streamscope (siem-splunk-prod).
Pull API
GET https://www.authmarks.com/api/orgs/{orgId}/audit-stream?cursor=<seq>&limit=<n>
| Parameter | Default | Notes |
|---|---|---|
cursor | 0 | Returns every event whose seq is greater than this value, oldest first. 0 begins at the start. |
limit | 500 | Between 1 and 1000. |
| Response header | What it means |
|---|---|
Content-Type | application/x-ndjson; charset=utf-8, with one envelope on each line. |
X-Authmarks-Next-Cursor | Send this as cursor on your next pull. |
X-Authmarks-Head-Seq | The latest seq at this moment. You are up to date when the next cursor equals it. |
X-Authmarks-Stream-Enabled | true or false. |
Errors: 400 invalid_query (an invalid cursor or limit), 401, 403 (scope or plan feature), 429, 503. Pulls are not entered in the audit log (otherwise each pull would itself become 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…"}
| Field | Notes |
|---|---|
format | authmarks-audit-stream-1. |
seq | Gap-free within each organisation, starting at 1. De-duplicate on (org_id, seq). |
occurred_at | ISO 8601, in UTC. |
source | admin_audit (settings, membership, roles, SCIM, API tokens, holds, exports, support sessions), evidence_access (who opened which evidence), sso_sign_in (sign-ins by owners, admins and instructors through your SSO) or stream (streaming switched on, changed or switched off). |
event | canonical in parsed form, for convenience. |
canonical | The exact text that was hashed. Verify against this, not against event. |
prev_hash | The event_hash of seq - 1 (64 zeros when seq is 1). |
event_hash | sha256(prev_hash + "\n" + canonical), in hex. |
actor_id | Present only when the organisation has chosen to include Authmarks account ids. It sits outside the hashed body. |
Events carry no document content, names, email addresses or free-text reasons. People appear as pseudonyms (p_ followed by 32 hex characters), which stay the same for each person and cannot be reversed without a key held per organisation.
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 once a minute from cron or from your SIEM's script input. The cursor file remembers your position, so a restart never skips or repeats more than a single 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
In addition to pulling, owners and admins can add delivery destinations in organisation settings (Audit-log streaming to your SIEM): either an HTTPS endpoint that receives signed NDJSON batches, or syslog over TLS (RFC 5425). Delivery is at least once, with a durable cursor for each destination, so de-duplicate on (org_id, seq).
Related pages
Sources
- RFC 7643, SCIM Core Schema — as of 2026-11-26
- RFC 7644, SCIM Protocol — as of 2026-11-26
- Okta, Add SCIM provisioning to app integrations — as of 2026-11-26
- Microsoft Entra ID, Tutorial to develop and plan provisioning for a SCIM endpoint — as of 2026-11-26
- NDJSON specification — as of 2026-11-26
Change notes
- 2026-11-26 — First published.
Spotted an error? Email sales@authmarks.com and we will correct the page and date the correction.