Update User API

Learn how to update CleverTap users using the SCIM Users API.

Overview

Updates an existing user’s details in CleverTap, including roles, teams, and account access. Use this endpoint to modify a user’s configuration across one or more accounts. This is a complete update operation, existing values are replaced with those in the request body.

HTTP Method

PUT

Endpoint

/nx/v2/scim/v2/Users/{email}

Base URL

The following is an example base URL for a CleverTap account in the United States region:

https://<clevertap_domain>/nx/v2/scim/v2/Users/{email}

Example: https://us1.dashboard.clevertap.com/nx/v2/scim/v2/Users/{email}

🚧

Region-Specific

The CleverTap domain is environment- and region-specific. Do not copy the example URL directly. Always replace <clevertap_domain> with the domain for your region. Refer Region for more details.

Authentication

This endpoint requires Bearer token authentication. Include the token in the Authorization header for all requests.

Required Headers

The following headers must be included with every API request:

Header

Description

Required

Content-Type

Content type of the request payload.
Must be application/scim+json

Yes

Authorization

Bearer <SCIM_TOKEN>

Yes

Replace <SCIM_TOKEN> with a valid SCIM Bearer token generated from the CleverTap dashboard. Refer to Generate SCIM Token for API-Based Provisioning.

Path Parameters

The following is the path parameter and its description:

ParameterTypeRequiredDescription
emailStringYesEmail address of the user to update. This value uniquely identifies the user and overrides userName in the request body.

Example Request

The following is the sample request:

curl -X PUT https://<clevertap_domain>/nx/v2/scim/v2/Users/{email}
-H "Authorization: Bearer <SCIM_TOKEN>"
-H "Content-Type: application/scim+json"
{
  "name": {
    "givenName": "John",
    "familyName": "Doe-Smith"
  },
  "active": true,
  "invitedBy": "[email protected]",
  "accounts": [
    {
      "accountId": "CLEVERTAP_ACCOUNT_ID",
      "roles": "Editor",
      "teams": "Marketing,Engineering,Product",
      "status": "Active"
    },
    {
      "accountId": "CLEVERTAP_ACCOUNT_ID",
      "roles": "Editor",
      "teams": "Marketing,Engineering,Product",
      "status": "Revoke"
    }
  ]
}

Request Parameters

The following table lists the request parameters:

ParameterTypeRequiredDescription
nameObjectNoUser’s name details.
name.givenNameStringNoUser’s first name.
name.familyNameStringNoUser’s last name.
activeBooleanNoIndicates whether the user is active.
invitedByStringYesEmail address of the user who invited this user.
accountsArray of ObjectNoList of account-level role, team, and status assignments for the user.
accounts.accountIdStringYesUnique identifier of the account.
accounts.rolesStringNoComma-separated list of roles assigned to the user for the account.
accounts.teamsStringNoComma-separated list of teams the user belongs to for the account.
accounts.statusStringNoAccount access status. Supported values include Active and Revoke.
🚧

Important

  • All fields in the request body replace existing values (full update, not partial)

Example Response

The following is the sample response:

{
  "id": "user-unique-id",
  "userName": "[email protected]",
  "name": {
    "givenName": "John",
    "familyName": "Doe-Smith"
  },
  "active": true,
  "accounts": [
    {
      "accountId": "CLEVERTAP_ACCOUNT_ID",
      "roles": "Editor",
      "teams": "Marketing,Engineering,Product",
      "status": "Active"
    },
    {
      "accountId": "CLEVERTAP_ACCOUNT_ID",
      "roles": "Editor",
      "teams": "Marketing,Engineering,Product",
      "status": "Revoke"
    }
  ],
  "invitedBy": "[email protected]"
}

Response Parameters

The following table lists the response parameters returned by the API.

ParameterTypeDescription
idStringUnique identifier of the user.
userNameStringUser’s email address.
nameObjectUser’s name details.
name.givenNameStringUser’s first name.
name.familyNameStringUser’s last name.
activeBooleanIndicates whether the user is active.
accountsArray of ObjectList of account-level role, team, and status assignments for the user.
accounts.accountIdStringUnique identifier of the account.
accounts.rolesStringComma-separated list of roles assigned to the user for the account.
accounts.teamsStringComma-separated list of teams the user belongs to for the account.
accounts.statusStringAccount access status. Supported values include Active, Revoke, and Delete.
invitedByStringEmail address of the user who invited this user.

Error Codes

All errors follow the SCIM v2.0 error schema and return standard HTTP status codes.

Error CodeDescriptionSample Payload
400One or more fields contain invalid values (e.g., roles, teams, or status)json { "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"], "detail": "account[ACC123].roles: Invalid role names present: Creator1", "status": 400 }
400Invalid status value (must be Active, Revoke, or Delete)json { "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"], "detail": "account[ACC456].status: Invalid status", "status": 400 }
400teams specified but Teams feature is not enabledjson { "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"], "detail": "account[ACC123].teams: Teams are not enabled for this account. Please remove teams from payload", "status": 400 }
400One or more team names are invalidjson { "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"], "detail": "Invalid teams: team4, team5 do not exist", "status": 400 }
403invitedBy user does not have admin permissionsjson { "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"], "detail": "User does not have admin permissions to invite user", "status": 403 }
404User not found using the provided {email} path parameterjson { "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"], "detail": "User not found: [email protected]", "status": 404 }
500Internal server error while updating the userjson { "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"], "detail": "Something went wrong while updating user", "status": 500 }

Supported Status Values

ValueDescription
ActiveGrants access to the account.
RevokeTemporarily suspends access.
DeleteMark's access for deletion.