Skip to content

Bulk Operations

Bulk operations in SCIM allow clients to send multiple requests to the server in a single HTTP request. This can significantly reduce the number of HTTP round trips required to perform multiple operations, making it more efficient.

A typical bulk operation request contains an array of operations to be performed. Each operation specifies a method (such as POST, PUT, PATCH, or DELETE), a path (if applicable), and the data for the operation.

Create User, Create Group and Assign User to Group

Here's an example of how a bulk request can create a user, a group, and assign the user to the group. Note the use of bulkId.

After invoking this request you may want to check the result here.

/Bulk
{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:BulkRequest"
],
"Operations": [
{
"method": "POST",
"path": "/Users",
"bulkId": "mscott",
"data": {
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"externalId": "mscott",
"name": {
"formatted": "Mr. Michael Scott",
"familyName": "Scott",
"givenName": "Michael"
},
"emails": [
{
"value": "michael.scott@example.com"
}
],
"userName": "mscott"
}
},
{
"method": "POST",
"path": "/Groups",
"bulkId": "directors",
"data": {
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:Group"
],
"displayName": "Directors"

Create User and Assign Group

There may be instances where you need to assign groups to users at the time of their creation. This can be efficiently achieved in a single request. Pay particular attention to the usage of bulkId and bulkId:sdoe in the following example.

/Bulk
{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:BulkRequest"
],
"Operations": [
{
"method": "POST",
"path": "/Users",
"bulkId": "sdoe",
"data": {
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"externalId": "sdoe",
"name": {
"formatted": "Mrs. Sandra Doe",
"familyName": "Doe",
"givenName": "Sandra"
},
"emails": [
{
"value": "sandra.doe@example.com"
}
],
"userName": "sdoe"
}
},
{
"method": "PATCH",
"path": "/Groups/Click to fill ⚡",
"data": {
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:PatchOp"
],
"Operations": [
{

Asynchronous Processing in SCIM

In cases of bulk requests, asynchronous processing may be preferable.

The core SCIM protocol specification does not currently support asynchronous processing. However, a draft profile, SCIM Profile for Security Event Tokens, introduces a way to enable this. It allows clients to request asynchronous processing by using the Prefer: Async-response HTTP header. Servers can then acknowledge this request by returning an HTTP status of 202 Accepted.

At present, this functionality is not supported by SCIM Playground.