SutraID|Developer Docs
QuickstartAPI ReferenceDashboard

Directory (SCIM & LDAP)

Provision and de-provision users and groups via SCIM 2.0, manage SCIM bearer tokens, and configure outbound LDAP directory sync.

POST/directory/scim/:orgId/tokenGenerate SCIM tokenBearer Token

Creates a new SCIM bearer token for the organization. The token is returned once in plain text and stored as a SHA-256 hash. Requires SUPER_ADMIN, ORG_ADMIN, or API_ACCESS_MANAGEMENT_ADMIN role.

Parameters

NameTypeRequiredDescription
orgIdstring (UUID)RequiredUnique identifier of the organization.e.g. b3e1f7a2-4c5d-6e8f-9a0b-1c2d3e4f5a6b

Response Fields

NameTypeRequiredDescription
tokenstringOptionalThe plain-text SCIM bearer token. Store it securely -- it cannot be retrieved again.

Response Example

{
  "token": "st_live_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6"
}

Code Examples

curl -X POST "https://api.sutraid.com/directory/scim/b3e1f7a2-4c5d-6e8f-9a0b-1c2d3e4f5a6b/token" \
  -H "Authorization: Bearer <your_token>"
GET/directory/ldap/:orgId/configGet LDAP configurationBearer Token

Returns the current LDAP directory configuration for the organization, including connection details and sync filters. Returns null if no LDAP config exists.

Parameters

NameTypeRequiredDescription
orgIdstring (UUID)RequiredUnique identifier of the organization.e.g. b3e1f7a2-4c5d-6e8f-9a0b-1c2d3e4f5a6b

Response Fields

NameTypeRequiredDescription
enabledbooleanOptionalWhether LDAP sync is currently enabled.
urlstringOptionalLDAP server URL (e.g. ldaps://ldap.example.com:636).
baseDnstringOptionalBase distinguished name for directory searches.
bindDnstringOptionalBind distinguished name used for authentication.
bindPasswordstringOptionalPassword for the bind DN (masked in responses).
userFilterstringOptionalLDAP filter for user entries.
groupFilterstringOptionalLDAP filter for group entries.
lastSyncAtstring | nullOptionalISO 8601 timestamp of the last successful sync, or null if never synced.

Response Example

{
  "enabled": true,
  "url": "ldaps://ldap.example.com:636",
  "baseDn": "dc=example,dc=com",
  "bindDn": "cn=admin,dc=example,dc=com",
  "bindPassword": "********",
  "userFilter": "(objectClass=user)",
  "groupFilter": "(objectClass=group)",
  "lastSyncAt": "2024-06-15T14:30:00Z"
}

Code Examples

curl -X GET "https://api.sutraid.com/directory/ldap/b3e1f7a2-4c5d-6e8f-9a0b-1c2d3e4f5a6b/config" \
  -H "Authorization: Bearer <your_token>"
POST/directory/ldap/:orgId/configCreate or update LDAP configurationBearer Token

Creates or updates the LDAP directory configuration for the organization. Requires SUPER_ADMIN or ORG_ADMIN role. Uses an upsert strategy -- existing configs are merged.

Parameters

NameTypeRequiredDescription
orgIdstring (UUID)RequiredUnique identifier of the organization.e.g. b3e1f7a2-4c5d-6e8f-9a0b-1c2d3e4f5a6b

Request Body

NameTypeRequiredDescription
enabledbooleanOptionalWhether LDAP sync should be enabled. Defaults to true.e.g. true
ldapUrlstringRequiredLDAP server URL (e.g. ldaps://ldap.example.com:636). Also accepts "url" alias.e.g. ldaps://ldap.example.com:636
ldapBaseDnstringRequiredBase DN for directory searches. Also accepts "baseDn" alias.e.g. dc=example,dc=com
ldapBindDnstringRequiredBind DN for LDAP authentication. Also accepts "bindDn" alias.e.g. cn=admin,dc=example,dc=com
ldapBindPasswordstringRequiredPassword for the bind DN. Also accepts "bindPassword" alias.e.g. supersecret
ldapUserFilterstringOptionalLDAP search filter for user entries. Defaults to (objectClass=user). Also accepts "userFilter" alias.e.g. (objectClass=user)
ldapGroupFilterstringOptionalLDAP search filter for group entries. Defaults to (objectClass=group). Also accepts "groupFilter" alias.e.g. (objectClass=group)

Response Fields

NameTypeRequiredDescription
idstringOptionalUnique identifier of the directory config record.
organizationIdstringOptionalOrganization the config belongs to.
typestringOptionalDirectory type. Always "LDAP" for this endpoint.
enabledbooleanOptionalWhether LDAP sync is enabled.
ldapUrlstringOptionalLDAP server URL.
ldapBaseDnstringOptionalBase DN for searches.
ldapBindDnstringOptionalBind DN for authentication.
ldapUserFilterstringOptionalUser search filter.
ldapGroupFilterstringOptionalGroup search filter.
lastSyncAtstring | nullOptionalISO 8601 timestamp of last sync.

Response Example

{
  "id": "dc_01hx9z1q2w3e4r5t6y7u",
  "organizationId": "b3e1f7a2-4c5d-6e8f-9a0b-1c2d3e4f5a6b",
  "type": "LDAP",
  "enabled": true,
  "ldapUrl": "ldaps://ldap.example.com:636",
  "ldapBaseDn": "dc=example,dc=com",
  "ldapBindDn": "cn=admin,dc=example,dc=com",
  "ldapUserFilter": "(objectClass=user)",
  "ldapGroupFilter": "(objectClass=group)",
  "lastSyncAt": null
}

Code Examples

curl -X POST "https://api.sutraid.com/directory/ldap/b3e1f7a2-4c5d-6e8f-9a0b-1c2d3e4f5a6b/config" \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "ldapUrl": "ldaps://ldap.example.com:636",
    "ldapBaseDn": "dc=example,dc=com",
    "ldapBindDn": "cn=admin,dc=example,dc=com",
    "ldapBindPassword": "supersecret",
    "ldapUserFilter": "(objectClass=user)",
    "ldapGroupFilter": "(objectClass=group)"
  }'
POST/directory/ldap/:orgId/syncTrigger LDAP syncBearer Token

Initiates an outbound LDAP sync for the organization. Connects to the configured LDAP server, imports users and groups, and updates the lastSyncAt timestamp. Requires SUPER_ADMIN or ORG_ADMIN role.

Parameters

NameTypeRequiredDescription
orgIdstring (UUID)RequiredUnique identifier of the organization.e.g. b3e1f7a2-4c5d-6e8f-9a0b-1c2d3e4f5a6b

Response Fields

NameTypeRequiredDescription
statusstringOptionalConfirmation message indicating the sync has been initiated.

Response Example

{
  "status": "Sync initiated"
}

Code Examples

curl -X POST "https://api.sutraid.com/directory/ldap/b3e1f7a2-4c5d-6e8f-9a0b-1c2d3e4f5a6b/sync" \
  -H "Authorization: Bearer <your_token>"
GET/scim/v2/:orgRef/ServiceProviderConfigGet SCIM service provider configurationSCIM Token

Returns the SCIM 2.0 service provider configuration describing supported features such as patch, filter, sort, and authentication schemes.

Parameters

NameTypeRequiredDescription
orgRefstringRequiredOrganization identifier -- a UUID, slug, or legacy org_ prefixed reference.e.g. my-org

Response Fields

NameTypeRequiredDescription
schemasstring[]OptionalSCIM schema URN for ServiceProviderConfig.
patch.supportedbooleanOptionalWhether PATCH operations are supported.
bulk.supportedbooleanOptionalWhether bulk operations are supported.
filter.supportedbooleanOptionalWhether filtering is supported.
filter.maxResultsnumberOptionalMaximum results returned by a filter query.
changePassword.supportedbooleanOptionalWhether password changes are supported.
sort.supportedbooleanOptionalWhether sorting is supported.
etag.supportedbooleanOptionalWhether ETags are supported.
authenticationSchemesobject[]OptionalList of supported authentication schemes.

Response Example

{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig"
  ],
  "patch": {
    "supported": true
  },
  "bulk": {
    "supported": false,
    "maxOperations": 0,
    "maxPayloadSize": 0
  },
  "filter": {
    "supported": true,
    "maxResults": 200
  },
  "changePassword": {
    "supported": false
  },
  "sort": {
    "supported": true
  },
  "etag": {
    "supported": false
  },
  "authenticationSchemes": [
    {
      "type": "oauthbearertoken",
      "name": "Bearer Token",
      "description": "Use SCIM bearer token in Authorization header",
      "specUri": "https://datatracker.ietf.org/doc/html/rfc6750",
      "primary": true
    }
  ]
}

Code Examples

curl -X GET "https://api.sutraid.com/scim/v2/my-org/ServiceProviderConfig" \
  -H "Authorization: Bearer <scim_token>"
GET/scim/v2/:orgRef/SchemasGet SCIM schemasSCIM Token

Returns the list of SCIM resource schemas supported by this service provider (User and Group).

Parameters

NameTypeRequiredDescription
orgRefstringRequiredOrganization identifier -- a UUID, slug, or legacy org_ prefixed reference.e.g. my-org

Response Fields

NameTypeRequiredDescription
schemasstring[]OptionalSCIM ListResponse schema URN.
totalResultsnumberOptionalTotal number of schema resources returned.
Resourcesobject[]OptionalArray of schema definitions (User, Group).
Resources[].idstringOptionalSchema URN identifier.
Resources[].namestringOptionalHuman-readable schema name.
Resources[].descriptionstringOptionalDescription of the schema.

Response Example

{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:ListResponse"
  ],
  "totalResults": 2,
  "Resources": [
    {
      "id": "urn:ietf:params:scim:schemas:core:2.0:User",
      "name": "User",
      "description": "User Account"
    },
    {
      "id": "urn:ietf:params:scim:schemas:core:2.0:Group",
      "name": "Group",
      "description": "Group"
    }
  ]
}

Code Examples

curl -X GET "https://api.sutraid.com/scim/v2/my-org/Schemas" \
  -H "Authorization: Bearer <scim_token>"
GET/scim/v2/:orgRef/ResourceTypesGet SCIM resource typesSCIM Token

Returns the list of SCIM resource types supported by this service provider, including their endpoints and schema URNs.

Parameters

NameTypeRequiredDescription
orgRefstringRequiredOrganization identifier -- a UUID, slug, or legacy org_ prefixed reference.e.g. my-org

Response Fields

NameTypeRequiredDescription
schemasstring[]OptionalSCIM ListResponse schema URN.
totalResultsnumberOptionalTotal number of resource types returned.
Resourcesobject[]OptionalArray of resource type definitions.
Resources[].idstringOptionalResource type identifier (User or Group).
Resources[].namestringOptionalHuman-readable resource type name.
Resources[].endpointstringOptionalRelative endpoint path for this resource type.
Resources[].schemastringOptionalSchema URN for this resource type.

Response Example

{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:ListResponse"
  ],
  "totalResults": 2,
  "Resources": [
    {
      "id": "User",
      "name": "User",
      "endpoint": "/Users",
      "schema": "urn:ietf:params:scim:schemas:core:2.0:User"
    },
    {
      "id": "Group",
      "name": "Group",
      "endpoint": "/Groups",
      "schema": "urn:ietf:params:scim:schemas:core:2.0:Group"
    }
  ]
}

Code Examples

curl -X GET "https://api.sutraid.com/scim/v2/my-org/ResourceTypes" \
  -H "Authorization: Bearer <scim_token>"
GET/scim/v2/:orgRef/UsersList SCIM usersSCIM Token

Returns a paginated SCIM 2.0 ListResponse of user resources for the organization. Supports filtering by userName, externalId, or id.

Parameters

NameTypeRequiredDescription
orgRefstringRequiredOrganization identifier -- a UUID, slug, or legacy org_ prefixed reference.e.g. my-org
filterstringOptionalSCIM filter expression. Supports userName eq, externalId eq, and id eq.e.g. userName eq "jane@example.com"
startIndexnumberOptional1-based index of the first result. Defaults to 1.e.g. 1
countnumberOptionalMaximum number of results per page. Defaults to 100, maximum 200.e.g. 100

Response Fields

NameTypeRequiredDescription
schemasstring[]OptionalSCIM ListResponse schema URN.
totalResultsnumberOptionalTotal number of user resources matching the query.
startIndexnumberOptionalThe 1-based index of the first result in the current set.
itemsPerPagenumberOptionalNumber of resources returned in this response.
ResourcesUser[]OptionalArray of SCIM User resources.
Resources[].schemasstring[]OptionalSCIM User schema URN.
Resources[].idstringOptionalSutraID user identifier.
Resources[].userNamestringOptionalEmail address of the user.
Resources[].externalIdstringOptionalExternal identifier from the identity provider.
Resources[].nameobjectOptionalName object with givenName and familyName.
Resources[].emailsobject[]OptionalArray of email objects.
Resources[].activebooleanOptionalWhether the user account is active.

Response Example

{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:ListResponse"
  ],
  "totalResults": 2,
  "startIndex": 1,
  "itemsPerPage": 2,
  "Resources": [
    {
      "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:User"
      ],
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "userName": "jane@example.com",
      "externalId": "ext-001",
      "name": {
        "givenName": "Jane",
        "familyName": "Doe"
      },
      "emails": [
        {
          "value": "jane@example.com",
          "primary": true,
          "type": "work"
        }
      ],
      "active": true
    }
  ]
}

Code Examples

curl -X GET "https://api.sutraid.com/scim/v2/my-org/Users?startIndex=1&count=100" \
  -H "Authorization: Bearer <scim_token>"
GET/scim/v2/:orgRef/Users/:userIdGet SCIM user by IDSCIM Token

Returns a single SCIM 2.0 User resource by its SutraID user identifier. The user must be a member of the specified organization.

Parameters

NameTypeRequiredDescription
orgRefstringRequiredOrganization identifier -- a UUID, slug, or legacy org_ prefixed reference.e.g. my-org
userIdstring (UUID)RequiredSutraID user identifier.e.g. a1b2c3d4-e5f6-7890-abcd-ef1234567890

Response Fields

NameTypeRequiredDescription
schemasstring[]OptionalSCIM User schema URN.
idstringOptionalSutraID user identifier.
userNamestringOptionalEmail address of the user.
externalIdstringOptionalExternal identifier from the identity provider.
nameobjectOptionalName object with givenName and familyName.
emailsobject[]OptionalArray of email objects.
activebooleanOptionalWhether the user account is active.

Response Example

{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User"
  ],
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "userName": "jane@example.com",
  "externalId": "ext-001",
  "name": {
    "givenName": "Jane",
    "familyName": "Doe"
  },
  "emails": [
    {
      "value": "jane@example.com",
      "primary": true,
      "type": "work"
    }
  ],
  "active": true
}

Code Examples

curl -X GET "https://api.sutraid.com/scim/v2/my-org/Users/a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
  -H "Authorization: Bearer <scim_token>"
POST/scim/v2/:orgRef/UsersCreate SCIM userSCIM Token

Provisions a new user via SCIM 2.0. If a user with the same email already exists, their profile is updated and they are added to the organization. Returns 201 on success.

Parameters

NameTypeRequiredDescription
orgRefstringRequiredOrganization identifier -- a UUID, slug, or legacy org_ prefixed reference.e.g. my-org

Request Body

NameTypeRequiredDescription
userNamestringRequiredEmail address of the user. Can also be provided as emails[0].value.e.g. jane@example.com
externalIdstringOptionalExternal identifier from the upstream identity provider.e.g. ext-001
nameobjectOptionalName object containing givenName and familyName.e.g. { "givenName": "Jane", "familyName": "Doe" }
emailsobject[]OptionalArray of email objects. The first entry with a value is used if userName is not set.e.g. [{ "value": "jane@example.com", "primary": true, "type": "work" }]
activebooleanOptionalWhether the user should be active. Defaults to true.e.g. true

Response Fields

NameTypeRequiredDescription
schemasstring[]OptionalSCIM User schema URN.
idstringOptionalSutraID user identifier.
userNamestringOptionalEmail address of the user.
externalIdstringOptionalExternal identifier.
nameobjectOptionalName object with givenName and familyName.
emailsobject[]OptionalArray of email objects.
activebooleanOptionalWhether the user account is active.

Response Example

{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User"
  ],
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "userName": "jane@example.com",
  "externalId": "ext-001",
  "name": {
    "givenName": "Jane",
    "familyName": "Doe"
  },
  "emails": [
    {
      "value": "jane@example.com",
      "primary": true,
      "type": "work"
    }
  ],
  "active": true
}

Code Examples

curl -X POST "https://api.sutraid.com/scim/v2/my-org/Users" \
  -H "Authorization: Bearer <scim_token>" \
  -H "Content-Type: application/scim+json" \
  -d '{
    "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
    "userName": "jane@example.com",
    "externalId": "ext-001",
    "name": { "givenName": "Jane", "familyName": "Doe" },
    "emails": [{ "value": "jane@example.com", "primary": true, "type": "work" }],
    "active": true
  }'
PATCH/scim/v2/:orgRef/Users/:userIdPatch SCIM userSCIM Token

Partially updates a SCIM user resource using RFC 7644 PATCH operations. Supports add, replace, and remove operations on userName, name, externalId, active, and enterprise extension attributes.

Parameters

NameTypeRequiredDescription
orgRefstringRequiredOrganization identifier -- a UUID, slug, or legacy org_ prefixed reference.e.g. my-org
userIdstring (UUID)RequiredSutraID user identifier.e.g. a1b2c3d4-e5f6-7890-abcd-ef1234567890

Request Body

NameTypeRequiredDescription
schemasstring[]RequiredMust include urn:ietf:params:scim:api:messages:2.0:PatchOp.e.g. ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]
Operationsobject[]RequiredArray of SCIM PATCH operations. Each operation has op (add/replace/remove), optional path, and optional value.e.g. [{ "op": "replace", "path": "active", "value": false }]

Response Fields

NameTypeRequiredDescription
schemasstring[]OptionalSCIM User schema URN.
idstringOptionalSutraID user identifier.
userNamestringOptionalEmail address of the user.
externalIdstringOptionalExternal identifier.
nameobjectOptionalName object with givenName and familyName.
emailsobject[]OptionalArray of email objects.
activebooleanOptionalWhether the user account is active.

Response Example

{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User"
  ],
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "userName": "jane@example.com",
  "externalId": "ext-001",
  "name": {
    "givenName": "Jane",
    "familyName": "Doe"
  },
  "emails": [
    {
      "value": "jane@example.com",
      "primary": true,
      "type": "work"
    }
  ],
  "active": false
}

Code Examples

curl -X PATCH "https://api.sutraid.com/scim/v2/my-org/Users/a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
  -H "Authorization: Bearer <scim_token>" \
  -H "Content-Type: application/scim+json" \
  -d '{
    "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
    "Operations": [
      { "op": "replace", "path": "active", "value": false }
    ]
  }'
DELETE/scim/v2/:orgRef/Users/:userIdDelete SCIM userSCIM Token

De-provisions a user via SCIM 2.0. The user is soft-deleted by setting their status to SUSPENDED in both the user record and their organization membership. Returns 204 No Content on success.

Parameters

NameTypeRequiredDescription
orgRefstringRequiredOrganization identifier -- a UUID, slug, or legacy org_ prefixed reference.e.g. my-org
userIdstring (UUID)RequiredSutraID user identifier.e.g. a1b2c3d4-e5f6-7890-abcd-ef1234567890

Response Example

{}

Code Examples

curl -X DELETE "https://api.sutraid.com/scim/v2/my-org/Users/a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
  -H "Authorization: Bearer <scim_token>"
GET/scim/v2/:orgRef/GroupsList SCIM groupsSCIM Token

Returns a paginated SCIM 2.0 ListResponse of group resources for the organization. Supports filtering by displayName, externalId, or id.

Parameters

NameTypeRequiredDescription
orgRefstringRequiredOrganization identifier -- a UUID, slug, or legacy org_ prefixed reference.e.g. my-org
filterstringOptionalSCIM filter expression. Supports displayName eq, externalId eq, and id eq.e.g. displayName eq "Engineering"
startIndexnumberOptional1-based index of the first result. Defaults to 1.e.g. 1
countnumberOptionalMaximum number of results per page. Defaults to 100, maximum 200.e.g. 100

Response Fields

NameTypeRequiredDescription
schemasstring[]OptionalSCIM ListResponse schema URN.
totalResultsnumberOptionalTotal number of group resources matching the query.
startIndexnumberOptionalThe 1-based index of the first result in the current set.
itemsPerPagenumberOptionalNumber of resources returned in this response.
ResourcesGroup[]OptionalArray of SCIM Group resources.
Resources[].schemasstring[]OptionalSCIM Group schema URN.
Resources[].idstringOptionalSutraID group identifier.
Resources[].displayNamestringOptionalName of the group.
Resources[].externalIdstringOptionalExternal identifier from the identity provider.
Resources[].membersobject[]OptionalArray of member references with value (userId) and display (email).

Response Example

{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:ListResponse"
  ],
  "totalResults": 1,
  "startIndex": 1,
  "itemsPerPage": 1,
  "Resources": [
    {
      "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:Group"
      ],
      "id": "g1a2b3c4-d5e6-7890-abcd-ef1234567890",
      "displayName": "Engineering",
      "externalId": "grp-eng-001",
      "members": [
        {
          "value": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
          "display": "jane@example.com"
        }
      ]
    }
  ]
}

Code Examples

curl -X GET "https://api.sutraid.com/scim/v2/my-org/Groups?startIndex=1&count=100" \
  -H "Authorization: Bearer <scim_token>"
GET/scim/v2/:orgRef/Groups/:groupIdGet SCIM group by IDSCIM Token

Returns a single SCIM 2.0 Group resource by its SutraID group identifier, including the full member list.

Parameters

NameTypeRequiredDescription
orgRefstringRequiredOrganization identifier -- a UUID, slug, or legacy org_ prefixed reference.e.g. my-org
groupIdstring (UUID)RequiredSutraID group identifier.e.g. g1a2b3c4-d5e6-7890-abcd-ef1234567890

Response Fields

NameTypeRequiredDescription
schemasstring[]OptionalSCIM Group schema URN.
idstringOptionalSutraID group identifier.
displayNamestringOptionalName of the group.
externalIdstringOptionalExternal identifier from the identity provider.
membersobject[]OptionalArray of member references with value (userId) and display (email).

Response Example

{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group"
  ],
  "id": "g1a2b3c4-d5e6-7890-abcd-ef1234567890",
  "displayName": "Engineering",
  "externalId": "grp-eng-001",
  "members": [
    {
      "value": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "display": "jane@example.com"
    },
    {
      "value": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "display": "john@example.com"
    }
  ]
}

Code Examples

curl -X GET "https://api.sutraid.com/scim/v2/my-org/Groups/g1a2b3c4-d5e6-7890-abcd-ef1234567890" \
  -H "Authorization: Bearer <scim_token>"
POST/scim/v2/:orgRef/GroupsCreate SCIM groupSCIM Token

Provisions a new group via SCIM 2.0. Optionally includes initial members by user ID. Returns 201 on success.

Parameters

NameTypeRequiredDescription
orgRefstringRequiredOrganization identifier -- a UUID, slug, or legacy org_ prefixed reference.e.g. my-org

Request Body

NameTypeRequiredDescription
displayNamestringRequiredDisplay name for the group.e.g. Engineering
externalIdstringOptionalExternal identifier from the upstream identity provider.e.g. grp-eng-001
membersobject[]OptionalArray of member objects. Each must have a value field containing the SutraID user ID.e.g. [{ "value": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }]

Response Fields

NameTypeRequiredDescription
schemasstring[]OptionalSCIM Group schema URN.
idstringOptionalSutraID group identifier.
displayNamestringOptionalName of the group.
externalIdstringOptionalExternal identifier.
membersobject[]OptionalArray of member references with value (userId) and display (email).

Response Example

{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group"
  ],
  "id": "g1a2b3c4-d5e6-7890-abcd-ef1234567890",
  "displayName": "Engineering",
  "externalId": "grp-eng-001",
  "members": [
    {
      "value": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "display": "jane@example.com"
    }
  ]
}

Code Examples

curl -X POST "https://api.sutraid.com/scim/v2/my-org/Groups" \
  -H "Authorization: Bearer <scim_token>" \
  -H "Content-Type: application/scim+json" \
  -d '{
    "schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"],
    "displayName": "Engineering",
    "externalId": "grp-eng-001",
    "members": [
      { "value": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }
    ]
  }'
PATCH/scim/v2/:orgRef/Groups/:groupIdPatch SCIM groupSCIM Token

Partially updates a SCIM group resource using RFC 7644 PATCH operations. Supports add, replace, and remove operations on displayName and members.

Parameters

NameTypeRequiredDescription
orgRefstringRequiredOrganization identifier -- a UUID, slug, or legacy org_ prefixed reference.e.g. my-org
groupIdstring (UUID)RequiredSutraID group identifier.e.g. g1a2b3c4-d5e6-7890-abcd-ef1234567890

Request Body

NameTypeRequiredDescription
schemasstring[]RequiredMust include urn:ietf:params:scim:api:messages:2.0:PatchOp.e.g. ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]
Operationsobject[]RequiredArray of SCIM PATCH operations. Supports add/replace/remove on displayName and members. Use members[value eq "..."] path to remove specific members.e.g. [{ "op": "add", "path": "members", "value": [{ "value": "user-uuid" }] }]

Response Fields

NameTypeRequiredDescription
schemasstring[]OptionalSCIM Group schema URN.
idstringOptionalSutraID group identifier.
displayNamestringOptionalName of the group.
externalIdstringOptionalExternal identifier.
membersobject[]OptionalUpdated array of member references.

Response Example

{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group"
  ],
  "id": "g1a2b3c4-d5e6-7890-abcd-ef1234567890",
  "displayName": "Engineering",
  "externalId": "grp-eng-001",
  "members": [
    {
      "value": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "display": "jane@example.com"
    },
    {
      "value": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "display": "john@example.com"
    }
  ]
}

Code Examples

curl -X PATCH "https://api.sutraid.com/scim/v2/my-org/Groups/g1a2b3c4-d5e6-7890-abcd-ef1234567890" \
  -H "Authorization: Bearer <scim_token>" \
  -H "Content-Type: application/scim+json" \
  -d '{
    "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
    "Operations": [
      {
        "op": "add",
        "path": "members",
        "value": [{ "value": "b2c3d4e5-f6a7-8901-bcde-f12345678901" }]
      }
    ]
  }'
DELETE/scim/v2/:orgRef/Groups/:groupIdDelete SCIM groupSCIM Token

Permanently deletes a group and removes all group memberships. Returns 204 No Content on success.

Parameters

NameTypeRequiredDescription
orgRefstringRequiredOrganization identifier -- a UUID, slug, or legacy org_ prefixed reference.e.g. my-org
groupIdstring (UUID)RequiredSutraID group identifier.e.g. g1a2b3c4-d5e6-7890-abcd-ef1234567890

Response Example

{}

Code Examples

curl -X DELETE "https://api.sutraid.com/scim/v2/my-org/Groups/g1a2b3c4-d5e6-7890-abcd-ef1234567890" \
  -H "Authorization: Bearer <scim_token>"