Users
Use the SCIM API requests to provision, deprovison, and perform other operations on users.
Provision User into Organization
https://auth-api.contentstack.com/scim/v2.0/organizations/{organization_uid}/UsersThe Provision User into Organization request adds the user to a Contentstack organization.
If the user does not already exist in Contentstack, you can add the new user to the organization by using this request.
{
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"userName": "email_of_user",
"name": {
"familyName": "last_name",
"givenName": "first_name"
}
}{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"id": "blta********",
"userName": "[email protected]",
"name": {
"givenName": "firstname",
"familyName": "lastname"
},
"active": true,
"emails": [
{
"value": "[email protected]",
"type": "work",
"primary": true
}
],
"meta": {
"resourceType": "User",
"created": "2021-02-05T07:44:33.272Z",
"lastModified": "2021-02-05T07:45:41.301Z",
"location": "https://auth-api.contentstack.com/scim/v2.0/organizations/blt********/Users/blta*******"
}
}Get All Users
https://auth-api.contentstack.com/scim/v2.0/organizations/{organization_uid}/UsersThe Get All Users request fetches the list of all users (along with details such as name, user ID, and email address) of your Contentstack organization.
{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:ListResponse"
],
"totalResults": 17,
"startIndex": 2,
"itemsPerPage": 2,
"Resources": [
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"id": "bl*********",
"userName": "[email protected]",
"name": {
"givenName": "firstname",
"familyName": "lastname"
},
"active": true,
"emails": [
{
"value": "[email protected]",
"type": "work",
"primary": true
}
],
"meta": {
"resourceType": "User",
"created": "2018-01-10T09:54:44.800Z",
"lastModified": "2021-02-08T11:06:02.058Z",
"location": "https://auth-api.contentstack.com/scim/v2.0/organizations/blt*******/Users/blt*******"
}
},
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"id": "blta3*********",
"userName": "[email protected]",
"name": {
"givenName": "firstname3",
"familyName": "lastname3"
},
"active": true,
"emails": [
{
"value": "[email protected]",
"type": "work",
"primary": true
}
],
"meta": {
"resourceType": "User",
"created": "2018-08-14T06:18:34.231Z",
"lastModified": "2021-01-28T06:10:33.971Z",
"location": "https://auth-api.contentstack.com/scim/v2.0/organizations/blt*********/Users/blta3*********"
}
}
]
}Get Single User By ID
https://auth-api.contentstack.com/scim/v2.0/organizations/{organization_uid}/Users/{user_id}The Get Single User by ID request returns comprehensive information of a specific user that exists in the organization.
You need to pass the ID of the user as the URL parameter.
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"id": "blt**********",
"userName": "[email protected]",
"name": {
"givenName": "firstname",
"familyName": "lastname"
},
"active": true,
"emails": [
{
"value": "[email protected]",
"type": "work",
"primary": true
}
],
"meta": {
"resourceType": "User",
"created": "2018-01-10T09:54:44.800Z",
"lastModified": "2021-02-08T11:06:02.058Z",
"location": "https://auth-api.contentstack.com/scim/v2.0/organizations/blt**********/Users/blt**********"
}
}Get Single User By Username
https://auth-api.contentstack.com/scim/v2.0/organizations/{organization_uid}/Users?filter=userName eq "<<email-address>>"The Get Single User by Username request returns comprehensive details of a specific user that exists in the Contentstack organization.
You need to pass the username as a query parameter.
{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:ListResponse"
],
"totalResults": 1,
"startIndex": 1,
"itemsPerPage": 100,
"Resources": [
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"id": "bltfa*********",
"userName": "[email protected]",
"name": {
"givenName": "User",
"familyName": "Name"
},
"active": true,
"emails": [
{
"value": "[email protected]",
"type": "work",
"primary": true
}
],
"meta": {
"resourceType": "User",
"created": "2020-09-30T13:34:40.878Z",
"lastModified": "2021-01-27T09:59:35.782Z",
"location": "https://auth-api.contentstack.com/scim/v2.0/organizations/blt56********/Users/bltfa*********"
}
}
]
}Update User By ID (PUT)
https://auth-api.contentstack.com/scim/v2.0/organizations/{organization_uid}/Users/{user_id}The Update User Using PUT request lets you update the details of a specific user by using the PUT request type.
In the “Body” section, you need to provide the updated schema of the user in the JSON format.
NoteAs no user attributes, like name and email, are liable to change, this endpoint is currently provided for identity provider compatibility. Set the active flag to “False” to deprovision a user.
{
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"userName": "{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"id": "blt***********",
"userName": "Update User By ID (PATCH)
https://auth-api.contentstack.com/scim/v2.0/organizations/{organization_uid}/Users/{user_id}The Update User Using PATCH request lets you update the details of a specific user by using the PATCH request type.
In the “Body” section, you need to provide the updated schema of the user in JSON format.
NoteAs no user attributes, like name and email, are liable to change, this endpoint is currently provided for identity provider compatibility. You can deprovision a user by sending the 'Replace' operation to the path 'active' with the value 'false'.
{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:PatchOp"
],
"Operations": [{
"op": "Replace",
"path": "active",
"value": false
}]
}{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"id": "blt6b9c8c1164bf8e6c",
"userName": "Deprovision User
https://auth-api.contentstack.com/scim/v2.0/organizations/{organization_uid}/Users/{user_id}The Deprovision User request lets you remove a user from a Contentstack organization.
This will remove the user from all the assigned stacks, but the user will continue to have a Contentstack account.