Skip to content

SCIM API

Use the SCIM API when a system other than a standard identity provider must create, update, and deactivate Emakin users and groups. Emakin implements the subset of SCIM 2.0 that identity providers such as Microsoft Entra ID use for provisioning.

To connect Entra ID or another identity provider, follow Provision Users with SCIM instead; this page describes the protocol for custom clients.

Prerequisites

  • SAML is enabled for the application, and the domain has a SAML identity provider. Provisioned users sign in through that provider.
  • A domain administrator gives you the Tenant URL and Secret Token of the identity provider.

Base Address and Authentication

The tenant URL has this form, where {serviceName} is the identity provider name:

1
https://{domain-host}/scim/v2/{serviceName}

Send the secret token as a bearer token with every request, and use the SCIM media type for request bodies:

1
2
3
GET https://mydomain.emakin.com/scim/v2/entra/Users?filter=userName eq "a1b2c3d4-0000-0000-0000-000000000001"
Authorization: Bearer {secret-token}
Accept: application/scim+json

Requests with a missing or wrong token return 401. Requests return 404 when SAML is disabled or the identity provider does not exist. Treat the token like a password; replacing it in Edit Domain invalidates the old value.

Users

Method Path Behavior
GET /Users?filter=userName eq "{value}" Returns the user with the user name, or an empty list. A userName eq filter is required.
GET /Users/{id} Returns the user.
POST /Users Creates the user. Returns 409 when the user name is already used.
PUT /Users/{id} Replaces the user's attributes.
PATCH /Users/{id} Applies a PatchOp request with add, replace, or remove operations.
DELETE /Users/{id} Deactivates the user. Users are never deleted.

id is the Emakin user id returned in responses. Only users created or bound through the same identity provider are visible; other users return 404.

Supported attributes:

Attribute Use
userName Required. The user's identifier at the identity provider. It must be the same value that the identity provider sends as the user id at sign-in. It cannot be changed after creation.
active false deactivates the user and ends the user's sessions; true activates the user. The default is true.
displayName, name.formatted Display name
name.givenName, name.familyName First and last name
emails The primary address is used as the e-mail address, then the work address, then the first address.

Other attributes, including externalId, are accepted and ignored.

Example request:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
POST https://mydomain.emakin.com/scim/v2/entra/Users
Authorization: Bearer {secret-token}
Content-Type: application/scim+json

{
  "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
  "userName": "a1b2c3d4-0000-0000-0000-000000000001",
  "active": true,
  "displayName": "Ada Lovelace",
  "name": { "givenName": "Ada", "familyName": "Lovelace" },
  "emails": [{ "value": "[email protected]", "type": "work", "primary": true }]
}

When Link Existing Users is enabled for the identity provider, creating a user whose e-mail address belongs to exactly one existing Emakin user binds that user instead of creating a new one.

Groups

Method Path Behavior
GET /Groups?filter=displayName eq "{value}" Returns the group with the name, or an empty list. Add excludedAttributes=members to omit members.
GET /Groups/{id} Returns the group and its members.
POST /Groups Creates the group. Returns 409 when this identity provider already has a group with the name.
PUT /Groups/{id} Replaces the name and members.
PATCH /Groups/{id} Changes the name or adds and removes members. Returns 204.
DELETE /Groups/{id} Removes all members. The group is kept so that permissions and role references stay valid.

Members are referenced by Emakin user id in members[].value. Only users and groups managed by the same identity provider can be used. System group names cannot be used.

Errors

Errors use the SCIM error format:

1
2
3
4
5
6
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
  "status": "409",
  "scimType": "uniqueness",
  "detail": "A user with this userName already exists."
}
Status scimType Cause
400 invalidFilter Unsupported filter
400 mutability An attempt to change userName
400 invalidValue Missing or invalid attribute value
401 Missing or wrong bearer token
403 The licensed user limit would be exceeded
404 Unknown resource, a resource managed by another source, or SAML is disabled
409 uniqueness The user name or group name is already used

Retry a request after a 403 only when the license has more capacity. Requests are idempotent for PUT, PATCH, and DELETE; for POST, look up the user name first and update the existing user instead of creating it again.

Limitations

  • Listing all users or groups without a filter, sorting, paging, and bulk requests are not supported.
  • Discovery endpoints such as /ServiceProviderConfig, /Schemas, and /ResourceTypes are not provided.
  • Only one provisioning source should manage the users of an identity provider. Directory sync on the same login method deactivates users that SCIM creates.