SCIM 2.0 Provisioning

RFC 7644 SCIM endpoints for automated user and group sync from your IdP.

Overview

BrainstormRouter implements SCIM 2.0 (RFC 7644) for automated user and group provisioning. Connect your IdP (Okta, Azure AD, OneLogin) to push user lifecycle events directly into your tenant.

All SCIM routes are mounted at /scim/v2/* with dedicated bearer token auth (separate from API keys). Tokens are stored in the scim_tokens table and scoped per-tenant.

Authentication

Authorization: Bearer scim_token_...

SCIM bearer tokens are stored in the scim_tokens database table and are independent of BrainstormRouter API keys. Token provisioning is currently managed via direct database operations. A self-service token management API and dashboard UI are planned but not yet shipped.

Discovery endpoints

MethodPathDescription
GET/scim/v2/ServiceProviderConfigSupported capabilities
GET/scim/v2/SchemasUser and Group schemas
GET/scim/v2/ResourceTypesAvailable resource types

Capabilities: patch supported, filter supported (max 200 results), bulk / sort / etag / changePassword not supported.

User endpoints

MethodPathDescription
POST/scim/v2/UsersCreate or upsert user
GET/scim/v2/UsersList users (filtered)
GET/scim/v2/Users/:idGet user by ID
PUT/scim/v2/Users/:idReplace user
PATCH/scim/v2/Users/:idPatch user attributes
DELETE/scim/v2/Users/:idDeactivate user

Create user

curl -X POST https://api.brainstormrouter.com/scim/v2/Users \
  -H "Authorization: Bearer scim_token_..." \
  -H "Content-Type: application/scim+json" \
  -d '{
    "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
    "userName": "alice@corp.com",
    "displayName": "Alice",
    "active": true,
    "emails": [{ "value": "alice@corp.com", "primary": true }]
  }'

Users are upserted on (tenantId, email) -- re-posting an existing email updates the record rather than creating a duplicate.

Filter support

GET /scim/v2/Users?filter=userName eq "alice@corp.com"

Supports eq and co operators on userName, displayName, and externalId.

Group endpoints

MethodPathDescription
POST/scim/v2/GroupsCreate group
GET/scim/v2/GroupsList groups
GET/scim/v2/Groups/:idGet group by ID
PUT/scim/v2/Groups/:idReplace group
PATCH/scim/v2/Groups/:idPatch group membership
DELETE/scim/v2/Groups/:idDelete group

Groups map to RBAC policy mappings via the group_policy_mappings table.