API

SCIM schema reference

The exact SCIM 2.0 schemas ulex implements: ServiceProviderConfig, the core User and Group schemas with every sub-attribute and mutability rule, PatchOp, Bulk, ListResponse and Error, plus the filter grammar ulex accepts.

RFC 7643 and RFC 7644, as implemented. Where ulex deviates or constrains, it says so.

#Discovery

bash
curl -sS "$BASE/scim/v2/ServiceProviderConfig" -H "Authorization: Bearer $SCIM_TOKEN"
json
{
  "schemas": ["urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig"],
  "documentationUri": "https://docs.ulexid.com/scim/schema-reference",
  "patch": { "supported": true },
  "bulk": { "supported": true, "maxOperations": 100, "maxPayloadSize": 10485760 },
  "filter": {
    "supported": true,
    "maxResults": 200,
    "comparisonOperators": ["eq", "ne", "co", "sw", "ew", "gt", "lt", "ge", "le", "pr"],
    "caseExact": false,
    "complexAttributes": false
  },
  "changePassword": { "supported": false },
  "sort": { "supported": true },
  "etag": { "supported": true },
  "authenticationSchemes": [
    {
      "type": "oauthbearertoken",
      "name": "OAuth Bearer Token",
      "description": "Authentication with a directory-scoped bearer token",
      "specUri": "http://www.rfc-editor.org/info/rfc6750",
      "primary": true
    }
  ]
}
Capabilityulex
PATCHyes
Bulkyes, 100 operations, 10 MiB
Filteringeq ne co sw ew gt lt ge le pr, and or not, parentheses, attribute paths
Complex attribute filtersno — one attribute path per filter
Sortingyes, one attribute
ETagsyes, W/"vN.M"
changePasswordno. Passwords are not a SCIM-managed attribute in ulex
POST /Users with passwordrejected with 400 invalidValue
Mutual TLSnot used; bearer token only
Sub-attribute searchyes: emails[type eq "work"].value
bash
curl -sS "$BASE/scim/v2/ResourceTypes" -H "Authorization: Bearer $SCIM_TOKEN"
json
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:ListResponse"],
  "totalResults": 2,
  "itemsPerPage": 2,
  "startIndex": 1,
  "Resources": [
    { "id": "User", "endpoint": "/Users", "schema": "urn:ietf:params:scim:schemas:core:2.0:User", "meta": { "location": "/Users", "resourceType": "ResourceType" } },
    { "id": "Group", "endpoint": "/Groups", "schema": "urn:ietf:params:scim:schemas:core:2.0:Group", "meta": { "location": "/Groups", "resourceType": "ResourceType" } }
  ]
}
bash
curl -sS "$BASE/scim/v2/Schemas" -H "Authorization: Bearer $SCIM_TOKEN" | jq -r '.Resources[].id'
text
urn:ietf:params:scim:schemas:core:2.0:User
urn:ietf:params:scim:schemas:core:2.0:Group
urn:ietf:params:scim:api:messages:2.0:PatchOp
urn:ietf:params:scim:api:messages:2.0:BulkRequest
urn:ietf:params:scim:api:messages:2.0:BulkResponse
urn:ietf:params:scim:api:messages:2.0:ListResponse
urn:ietf:params:scim:api:messages:2.0:Error

The enterprise extension urn:ietf:params:scim:schemas:extension:enterprise:2.0:User is accepted and echoed on create and patch, and its sub-attributes are stored under user.metadata.enterprise. ulex does not index them, and it does not validate them beyond JSON typing — the schema is not returned by /Schemas.


#User

urn:ietf:params:scim:schemas:core:2.0:User

#Required

AttributeTypeCase exactMutabilityNotes
schemascomplex—readOnlymust contain the User schema URN
idstring—readOnlythe ulex usr_… id
userNamestringfalsereadWriteunique per directory; usually the email. Required on POST

#Optional, readWrite

AttributeTypeMax lengthMaps to
externalIdstring255user.external_id. The join key across syncs
name.givenNamestring80user.first_name
name.familyNamestring80user.last_name
name.formattedstring160user.display_name when displayName is absent
displayNamestring160user.display_name
nickNamestring64user.scim.nick_name
profileUrlreference2048user.scim.profile_url
titlestring120user.job_title
userTypestring255user.scim.user_type
preferredLanguagestring35user.scim.preferred_language
localestring35user.scim.locale
timezonestring64user.scim.timezone
activeboolean—true → status: active; false → status: suspended

#Optional, multi-valued

AttributeSub-attributesNotes
emailsvalue (required), type, primary, displaytype ∈ work | home | other. The primary: true value is the one stored as user.email
phoneNumbersvalue, type, primarynot stored. value is hashed into mfa_factor.target_hint if a factor is enrolled; otherwise discarded
imgsvalue, type, primarynot stored
photosvalue, type, primarynot stored
addressesformatted, streetAddress, locality, region, postalCode, country, typenot stored
rolesvalue, display, type, primarystored under user.metadata.roles; not used for authorization
groupsvalue, $ref, display, typereadOnly on a User. Set membership through /Groups, not through a User
entitlementsvalue, display, type, primarystored under user.metadata.entitlements; not used for authorization
Warning

phoneNumbers is not stored. That is PHI minimisation, not an omission bug: a phone number is personal data, ulex has no feature that needs it, and not storing it is the simplest way to not have to protect it. If your IdP sends one, it is accepted, ignored, and not echoed back in the stored resource.

#meta

json
"meta": {
  "resourceType": "User",
  "created": "2026-09-29T14:47:03.000Z",
  "lastModified": "2026-09-29T14:49:41.000Z",
  "version": "W/\"v1.1\"",
  "location": "https://ulexid.com/api/v1/scim/v2/Users/usr_01M3PSWBPGS08FWV4NV7P9VNFN"
}

version is an ETag. Increment it on every write. Send it in If-Match on PUT and PATCH; a stale value is 412 with scimType: "mutability". Use If-None-Match: * on POST to assert the user does not exist yet.

#Rejected

AttributeResult
password400 invalidValue. ulex does not accept passwords over SCIM
groups on POST/PUT/PATCH400 mutability. Read-only; use /Groups
emails with no primary: trueaccepted; the first value is used
emails with two primary: true400 invalidValue
id different from the URL on PUT400 mutability
schemas missing the User URN400 invalidValue

#Full example

json
{
  "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
  "id": "usr_01M3PSWBPGS08FWV4NV7P9VNFN",
  "externalId": "okta-00u9xK2mB7yLt4N",
  "userName": "pat@acme.example",
  "name": { "givenName": "Pat", "familyName": "Iyer", "formatted": "Pat Iyer" },
  "displayName": "Pat Iyer",
  "nickName": "pat",
  "title": "Support Engineer",
  "userType": "Employee",
  "preferredLanguage": "en-US",
  "locale": "en-US",
  "timezone": "America/New_York",
  "active": true,
  "emails": [{ "value": "pat@acme.example", "type": "work", "primary": true }],
  "roles": [{ "value": "support-agent", "display": "Support Agent", "type": "direct" }],
  "entitlements": [{ "value": "zendesk", "display": "Zendesk" }],
  "groups": [
    { "value": "grp_01M3PSVED0M9RJTYH5AC72C253", "$ref": "https://ulexid.com/api/v1/scim/v2/Groups/grp_01M3PSVED0M9RJTYH5AC72C253", "display": "Support", "type": "direct" }
  ],
  "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
    "employeeNumber": "E-4417",
    "costCenter": "CS-100",
    "organization": "Customer Success",
    "division": "Support",
    "department": "Customer Success",
    "manager": { "value": "usr_01M3PSV9GRT8GQGEG686AR1W9S", "$ref": "https://ulexid.com/api/v1/scim/v2/Users/usr_01M3PSV9GRT8GQGEG686AR1W9S", "displayName": "Dana Okafor" }
  },
  "meta": {
    "resourceType": "User",
    "created": "2026-09-29T14:47:03.000Z",
    "lastModified": "2026-09-29T14:47:03.000Z",
    "version": "W/\"v1.0\"",
    "location": "https://ulexid.com/api/v1/scim/v2/Users/usr_01M3PSWBPGS08FWV4NV7P9VNFN"
  }
}

#Group

urn:ietf:params:scim:schemas:core:2.0:Group

AttributeTypeMutabilityNotes
schemascomplexreadOnly
idstringreadOnlythe ulex grp_… id
externalIdstringreadWritebecomes group.scim_id
displayNamestringreadWriterequired on POST. 1–120 characters
memberscomplex, multi-valuedreadWritevalue (the user id), $ref, display, type

A ulex group always belongs to exactly one organization — the one the directory is bound to. POST /scim/v2/Groups creates the group there, with source: "scim". There is no way to move it, and no way to create a group in a different organization over SCIM.

The group slug is derived from displayName through connection.config.scim.group_name_template (default {name}), then slugified to ^[a-z0-9._:-]+$. Two groups in the same organization whose display names slugify identically collide on 409 uniqueness.

#Full example

json
{
  "schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"],
  "id": "grp_01M3PSVED0M9RJTYH5AC72C253",
  "externalId": "okta-g-9k2mB7yLt4N",
  "displayName": "Support",
  "members": [
    {
      "value": "usr_01M3PSWBPGS08FWV4NV7P9VNFN",
      "$ref": "https://ulexid.com/api/v1/scim/v2/Users/usr_01M3PSWBPGS08FWV4NV7P9VNFN",
      "display": "Pat Iyer",
      "type": "direct"
    },
    { "value": "usr_01M3PSWCNRG3H18C3A2AHBRYRZ", "display": "Sam Rivera", "type": "direct" }
  ],
  "meta": {
    "resourceType": "Group",
    "created": "2026-09-29T14:49:02.000Z",
    "lastModified": "2026-09-29T14:49:02.000Z",
    "version": "W/\"v1.0\"",
    "location": "https://ulexid.com/api/v1/scim/v2/Groups/grp_01M3PSVED0M9RJTYH5AC72C253"
  }
}

#PatchOp

urn:ietf:params:scim:api:messages:2.0:PatchOp

json
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
  "Operations": [
    { "op": "replace", "path": "name.givenName", "value": "Patricia" },
    { "op": "replace", "path": "department", "value": "Customer Experience" },
    { "op": "add", "path": "roles", "value": [{ "value": "admin", "display": "Admin" }] },
    { "op": "remove", "path": "nickName" },
    { "op": "replace", "value": { "active": false } }
  ]
}
oppath presentvalue presentEffect
addyesyessets the attribute, or appends to an array
addnoyesmerges the value object's keys, each as an add
replaceyesyesoverwrites; identical to add for single-valued attributes
replacenoyessame as add without a path
removeyesnoclears the attribute
removeyesyesremoves the matching array element
removenono400 noTarget
Path formSupported
departmentyes
name.givenNameyes, one level of nesting
emails[type eq "work"].valueyes, value selector
members[value eq "usr_…"]yes, on /Groups
urn:…:User:employeeNumberyes, extension attributes
emails.value (bare sub-attribute)no — 400 invalidPath. Use the selector form

Operations apply in order. A patch with five operations is not atomic across them: the first three may apply and the fourth may fail. Re-read meta.version before retrying.


#Bulk

urn:ietf:params:scim:api:messages:2.0:BulkRequest / …:BulkResponse

json
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:BulkRequest"],
  "failOnErrors": 1,
  "Operations": [
    { "method": "POST", "path": "/Users", "bulkId": "alex", "version": "W/\"v1.0\"", "data": { "…": "…" } },
    { "method": "PATCH", "path": "/Users/usr_01M3PSWBPGS08FWV4NV7P9VNFN", "bulkId": "u2", "data": { "…": "…" } },
    { "method": "POST", "path": "/Groups", "bulkId": "g1", "data": { "members": [{ "value": "alex" }] } }
  ]
}
RuleValue
Max operations100
Max payload10,485,760 bytes
methodPOST, PUT, PATCH, DELETE
path/Users, /Users/{id}, /Groups, /Groups/{id}
bulkIdrequired, unique in the request, 1–255 characters
versiononly on PUT/PATCH; an If-Match equivalent
failOnErrors0 = run everything; ≥1 = abort after the Nth failure
bulkId in members[].valueresolves to the created user. Must appear earlier in the request
Response statusalways 200 for the call; per-operation status is in Operations[]
json
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:BulkResponse"],
  "Operations": [
    { "method": "POST", "bulkId": "alex", "version": "W/\"v1.0\"", "location": "/Users/usr_01M3PSWCNRG3H18C3A2AHBRYRZ", "status": "201" },
    { "method": "POST", "bulkId": "g1", "version": "W/\"v1.0\"", "location": "/Groups/grp_01M3PSVED0M9RJTYH5AC72C253", "status": "201" },
    { "method": "POST", "bulkId": "robin", "status": "409", "response": { "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"], "status": "409", "scimType": "uniqueness", "detail": "A User with userName robin@acme.example already exists." } }
  ]
}

status is a string in the response, per RFC 7644. An Operation with a non-2xx status and no response means ulex rejected it before a body could be built; treat it as a 500.


#ListResponse

urn:ietf:params:scim:api:messages:2.0:ListResponse

json
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:ListResponse"],
  "totalResults": 412,
  "itemsPerPage": 50,
  "startIndex": 51,
  "Resources": []
}
ParameterDefaultBounds
startIndex11-based
count201–200, clamped not errored
filter—see below
sortBy—one attribute
sortOrderascendingascending or descending

Resources: [] with itemsPerPage: 0 means the end. totalResults counts everything matching the filter, not the page.


#Filter grammar

text
filter      = orExp
orExp       = andExp { "or" andExp }
andExp      = notExp { "and" notExp }
notExp      = "not" "(" filter ")" | "(" filter ")" | attrExp
attrExp     = attrPath "pr" | attrPath compareOp compValue
attrPath    = attrName { subAttr }
attrName    = ALPHA *( ALPHA / DIGIT / "_" / "-" / "." )
compValue   = false / null / true / number / string

#Operators

OperatorMeaningExample
eqequalsuserName eq "pat@acme.example"
nenot equalsdepartment ne "Contractors"
cocontainsuserName co "acme"
swstarts withuserName sw "ext-"
ewends withuserName ew "@globex.example"
gt ge lt leorderingmeta.created gt "2026-09-01T00:00:00Z"
prpresenttitle pr

#Value selectors

text
emails[type eq "work"].value eq "pat@acme.example"
emails.value ew "@acme.example"
members[value eq "usr_01M3PSWBPGS08FWV4NV7P9VNFN"]

#Constraints

ConstraintLimitOn breach
Attribute paths per filter1400 invalidFilter
Boolean operators4400 invalidFilter
Parenthesis depth4400 invalidFilter
startIndex≥ 1400 invalidValue
Non-unique eq on a unique attribute—400 tooMany
String comparisoncase-insensitivematches the RFC

#Error

urn:ietf:params:scim:api:messages:2.0:Error

json
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
  "status": "409",
  "scimType": "uniqueness",
  "detail": "A User with userName pat@acme.example already exists.",
  "request_id": "req_01M3PSW9R0175NAW62NYR403R8"
}
statusscimTypeCauseulex code
400invalidFilterthe filter is not valid SCIM filteringscim_invalid_filter
400tooManya unique attribute matched more than oncescim_invalid_filter
400invalidSyntaxthe body is not valid SCIM JSONscim_invalid_syntax
400invalidPaththe PATCH path does not existscim_invalid_syntax
400invalidValuea value failed its schemavalidation_failed
400noTargeta PATCH remove with no path and no valuevalidation_failed
400—password was sentvalidation_failed
409uniquenessuserName, externalId or displayName collisionscim_conflict
409mutabilityan immutable attribute changedscim_conflict
404—no such user or groupscim_user_not_found, scim_group_not_found
412mutabilitystale If-Matchscim_conflict
413—over 100 bulk operations, or over 10 MiBscim_bulk_exceeded
429—over 3,000 requests/minuterate_limit_error
500—our faultinternal_error
503—deploying or drainingservice_unavailable

scimType is omitted rather than guessed when the failure does not map cleanly. Do not branch on its presence; branch on status and read detail.

request_id is in the body and in the x-ulex-request-id response header, and it is on the audit event for the request.

#Reference