SCIM docs

SCIM provisioning for ShareOTP

ShareOTP exposes a workspace-scoped SCIM 2.0 surface for identity-provider-driven user provisioning and deprovisioning.

Authentication

Generate a SCIM bearer token in Admin - Settings - Security. Tokens are workspace-scoped, shown once when created, and independent from normal ShareOTP REST API keys.

Authorization header
curl https://your-domain.com/api/scim/v2/ServiceProviderConfig \
  -H "Authorization: Bearer scim_shareotp_..."

Supported endpoints

Method
Path
Description
GET
/api/scim/v2/ServiceProviderConfig
Discover supported SCIM features
GET
/api/scim/v2/Users
List users with pagination and supported filters
POST
/api/scim/v2/Users
Create or upsert a user by externalId or userName
GET
/api/scim/v2/Users/{id}
Fetch one user resource
PATCH
/api/scim/v2/Users/{id}
Update fields or set active=false
GET / POST
/api/scim/v2/Groups
List or create synced departments
GET / PUT / PATCH / DELETE
/api/scim/v2/Groups/{id}
Read, replace, modify or delete a department
GET
/api/scim/v2/ResourceTypes
Discover User and Group resources (also supports /{id})
GET
/api/scim/v2/Schemas
Discover supported schemas (also supports /{id})

Supported user fields

The SCIM implementation is intentionally focused on workforce sync for ShareOTP users.

Roles are ignored unless SCIM role sync is enabled in workspace settings. When enabled, only valid ADMIN and MEMBER values are accepted, and ShareOTP blocks changes that would leave the workspace without an active admin.

externalId
userName
displayName
name.formatted
emails
roles
active

Supported filters

Use filters for directory reconcile jobs and identity-provider lookups.

externalId eq "00u123"
externalId pr
userName eq "[email protected]"
id eq "user_123"
active eq true
active eq false

Examples

Create or upsert a user
curl https://your-domain.com/api/scim/v2/Users \
  -H "Authorization: Bearer scim_shareotp_..." \
  -H "Content-Type: application/scim+json" \
  -d '{
    "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
    "externalId": "00u123",
    "userName": "[email protected]",
    "displayName": "Alice Example",
    "active": true,
    "emails": [{ "value": "[email protected]", "primary": true }]
  }'
List SCIM-managed users
curl "https://your-domain.com/api/scim/v2/Users?filter=externalId%20pr&startIndex=1&count=100" \
  -H "Authorization: Bearer scim_shareotp_..."

Departments and nested Groups

Manage manual departments at Admin → Departments, or provision them through SCIM Groups. Manual departments are outside the SCIM Groups lane. An administrator must explicitly share an OTP account with a department before its members can access it.

Use the core Group schema with a stable externalId and displayName. Direct members of type User are employees; members of type Group are direct subdepartments. Each department has one parent; cycles and multiple parents are rejected. Members must reference existing ShareOTP resource IDs in the same workspace.

  1. Provision Users and establish every Group, retaining returned IDs.
  2. PUT each Group with its exact direct User members and child Groups. Omitted members means empty; repeat PUT does not duplicate memberships.
  3. To move a child, remove it from its old parent before adding it to the new one. PATCH supports add, replace and remove, including a members[value eq "id"] removal path.
  4. Move or delete children before DELETE on their parent. Department deletion preserves user accounts. A missing group in a failed source walk is not a deletion instruction.

POST creates a department; duplicate active externalId returns 409. Groups support id, externalId and displayName equality filters, externalId pr, and pagination with count=0. Token rotation preserves identities. Last group update indicates a successful write to that Group, not a completed directory sync.

Deprovisioning behavior

When SCIM sets active=false, ShareOTP soft-disables the user, revokes their API keys and org-level artifacts, deletes account permissions and login/session artifacts, removes manual and synced department memberships, and removes them from active seat usage. Reactivation does not automatically restore removed memberships.

Disable a user
curl https://your-domain.com/api/scim/v2/Users/user_123 \
  -X PATCH \
  -H "Authorization: Bearer scim_shareotp_..." \
  -H "Content-Type: application/scim+json" \
  -d '{
    "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
    "Operations": [
      { "op": "replace", "path": "active", "value": false }
    ]
  }'
Recommended full reconcile
  1. Upsert every active user with POST /Users.
  2. List managed users with GET /Users?filter=externalId pr.
  3. PATCH active=false for previously managed users that no longer exist in the source directory.