Skip to content

SCIM 2.0 API

The identity package serves SCIM 2.0 (RFC 7643, RFC 7644) at https://<tenant-api-host>/api/scim/v2 for identity providers and for integrators who build their own client. It is part of the OpenAPI document (tag SCIM, operation ids scim.*) and the PHP SDK (SCIMApi); it is deliberately not a CLI command, because it is called by identity providers, not by people. Setup and operations: SCIM provisioning.

Authorization: Bearer ulams_pat_... with a SCIM token of one identity provider (POST /api/admin/identity/providers/{provider}/scim-tokens, permission identity_scim_manage). A SCIM token is a scoped token of kind scim (see scoped tokens) held by a passwordless service user of the provider, with the scope scim:write:

  • it is accepted only on /api/scim/*, and every other kind of token (login, cli, ci, agent, integration) is refused there with 403;
  • the token is bound to the provider: the client sees and changes only the users that provider provisioned; any other id answers 404;
  • tokens are per tenant (each tenant signs with its own Passport keys), shown once, valid for at most 365 days, two active at a time;
  • 600 requests per minute and token, then 429 with Retry-After.

Requests and responses are application/scim+json (application/json is accepted on input). Bodies are at most 1 MB.

Method and path
GET /ServiceProviderConfig Capabilities: patch yes, filter yes (max 200), etag yes, bulk, sort and changePassword no.
GET /ResourceTypes, /ResourceTypes/{id} User with the enterprise extension, and Group.
GET /Schemas, /Schemas/{urn} The supported attributes. Attributes that are not listed are ignored on input and never returned.
GET /Users List and filter; filter, startIndex, count, attributes, excludedAttributes.
POST /Users/.search The same with a SearchRequest body.
POST /Users Create. 201 with Location and ETag.
GET /Users/{id} One user. If-None-Match answers 304.
PUT /Users/{id} Replace. Omitted attributes are cleared, except active, which keeps its value.
PATCH /Users/{id} add, replace, remove; all operations apply or none do.
DELETE /Users/{id} Deprovision (deactivate and unlink; 204).
GET, POST /Groups, POST /Groups/.search, GET, PUT, PATCH, DELETE /Groups/{id} Groups and their members; the same filters, pagination, ETag and PATCH rules.

The id is the id of the account (or group) in the tenant and never changes.

displayName is required and unique among all groups of the tenant (case-insensitive; 409 uniqueness), members are users of this provider ({"value": "<user id>", "type": "User"}; anything else is 400 invalidValue), nested groups are not supported. A client sees, changes and deletes only the groups it created, and sees only the members it provisioned. PUT without members keeps the membership, with [] empties it. PATCH takes add, replace and remove on members (also members[value eq "id"], and remove with the members to drop as value, as Entra ID sends it) and replace on displayName. excludedAttributes=members leaves the member list out of a list or a read. DELETE removes the group and the access it gave; the people stay. A user’s read-only groups attribute lists the groups of this provider they belong to. At most 10 000 members per request. Role mapping from group names is set on the identity provider (scim.group_roles), see SCIM provisioning.

The grammar of RFC 7644 3.4.2.2: eq ne co sw ew gt ge lt le pr, and, or, not ( ... ), parentheses and value paths (emails[type eq "work" and value co "@acme.example"]). not binds tighter than and, which binds tighter than or. String comparisons are case-insensitive except externalId. Filterable attributes of users: id, userName, externalId, emails.value, emails[...], active, name.givenName, name.familyName, meta.lastModified, meta.created; of groups: id, displayName, externalId, members.value (eq, ne, pr; only members the provider provisioned count), meta.lastModified, meta.created. Anything else is 400 invalidFilter. Values reach the database as bound parameters only; the column comes from a fixed map.

Operations follow RFC 7644 3.5.2: op in any letter case; path with sub-attributes (name.givenName), value paths (emails[type eq "work"].value) and the enterprise URN prefix (urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:department); without a path the value is an object of attributes. remove needs a path. A value path that matches nothing is noTarget; changing id, meta or groups by path is mutability. The result is validated like a PUT body, so one bad operation changes nothing.

Every resource has meta.version, a weak ETag of the representation, and the ETag header. PUT, PATCH and DELETE honour If-Match (a list or *); a stale version is 412.

{ "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"], "status": "409", "scimType": "uniqueness", "detail": "The userName is already in use." }

scimType is one of invalidFilter, invalidSyntax, invalidPath, invalidValue, noTarget, mutability, uniqueness (409) and tooMany. Other statuses: 401 (no valid token, with WWW-Authenticate), 403 (wrong token kind, or an administrator), 404, 412, 413, 429.

Bulk, sorting (sortBy is ignored), password changes, /Me, nested groups, group externalId filters by value path, and attributes that are not in /Schemas. $ref values are never fetched: the server makes no outbound request while handling SCIM input.