KaireonAI implements the SCIM 2.0 protocol (RFC 7644) for automated user provisioning from enterprise identity providers like Okta, Azure AD, and OneLogin. SCIM endpoints require bearer-token authentication configured in your IdP — the bearer token is a KaireonDocumentation Index
Fetch the complete documentation index at: https://docs.kaireonai.com/llms.txt
Use this file to discover all available pages before exploring further.
krn_ API key.
Authentication
Every SCIM request goes throughrequireSCIMAuth at src/lib/scim-auth.ts:23. The handler accepts two modes:
- Bearer token (production IdP integration). Send
Authorization: Bearer krn_<your_api_key>. The token is verified against theApiKeytable and the boundtenantIdis used for scoping. Failed verification returns a SCIM-formatted 401 error withschemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]. - Session fallback (admin UI testing only). When no
Authorization: Bearerheader is present, the route falls back to the standardrequireRole("admin") + requireTenantchain. This path is for debugging from a logged-in admin browser session and is not used by IdPs.
GET /api/v1/scim/v2/Users
List users in SCIM ListResponse format.Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
startIndex | number | No | 1-based pagination index (default: 1) |
count | number | No | Page size (default: 100, max: 200) |
startIndex is clamped to >= 1 and count to [1, 200] (src/app/api/v1/scim/v2/Users/route.ts:48-49).
Response
name.givenName is the first whitespace-delimited token of the user’s stored name; familyName is everything after the first space (src/app/api/v1/scim/v2/Users/route.ts:18-19). active is false only when the user has a lockedUntil timestamp in the future, otherwise true.
POST /api/v1/scim/v2/Users
Create a user from a SCIM resource. New users are provisioned with rolemember.
Request Body
userName first, then falls back to emails[0].value (src/app/api/v1/scim/v2/Users/route.ts:92). displayName is taken verbatim, otherwise composed from name.givenName + name.familyName, otherwise the email.
Response (201)
Returns the created SCIM User resource with the persistedid and meta.location.
Error — Missing userName/email (400)
Error — User Exists (409)
The duplicate check is tenant-scoped, so the same email can exist in two different tenants without conflict.GET /api/v1/scim/v2/Users/
Get a single user by ID. Tenant-scoped — returns404 with a SCIM error envelope when the id does not belong to the bearer token’s tenant (src/app/api/v1/scim/v2/Users/[id]/route.ts:47-52).
PUT /api/v1/scim/v2/Users/
Replace a user resource. Supports updatingdisplayName, userName, name, emails, and active status.
active value | Effect |
|---|---|
false | Sets lockedUntil = 2099-12-31 (effectively permanent until reactivated) |
true | Clears lockedUntil if it was set, otherwise no-op |
| omitted | Treated as true (src/app/api/v1/scim/v2/Users/[id]/route.ts:94) |
src/app/api/v1/scim/v2/Users/[id]/route.ts:108-117).
DELETE /api/v1/scim/v2/Users/
Soft-deactivate a user by settinglockedUntil = 2099-12-31. The user record is not deleted — it is locked to preserve audit history and downstream foreign-key references (decision authorship, audit logs, etc.).
Response
204 No Content on success. 404 with SCIM error envelope when the id is not in the caller’s tenant.
Related
- Authentication — TOTP MFA, API keys, SSO
- OAuth 2.0 — machine-to-machine token grants