---
schema_version: "1"
id: 09e656e99f40f553d45b788baf2c2f76ee7e0ca4208b1292bc143eb0ca1b5fbf
title: "Examples: Deactivate and Reactivate Users with SCIM"
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/identity_scim_deactivate_reactivate_user.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.identity_scim_deactivate_reactivate_user.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 17592d57060ddb3ac16e733cf2f598fddcfee4c185f93e0c43fa80bb1ff23852
description: In Salesforce, you deactivate user objects rather than deleting them. By deactivating a user object, the user’s active status becomes false. Even though you can still query the user object, the user can’t log in to Salesforce with the deactivated account. To allow a user to log in, you can reactivate their account.
products:
  - Security
  - Cross Cloud
release: "264"
---
# Examples: Deactivate and Reactivate Users with SCIM

In Salesforce, you deactivate user objects rather than deleting them. By deactivating a user object, the user’s active status becomes `false`. Even though you can still query the user object, the user can’t log in to Salesforce with the deactivated account. To allow a user to log in, you can reactivate their account.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Salesforce Classic and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>All</strong> Editions</td></tr></tbody></table>

To see how to deactivate and reactivate user accounts, view the following examples.

- [Deactivate a User with PATCH](https://help.salesforce.com/s/articleView?id=xcloud.identity_scim_deactivate_reactivate_user.htm&release=264.0.0&type=5)
- [Deactivate a User with DELETE](https://help.salesforce.com/s/articleView?id=xcloud.identity_scim_deactivate_reactivate_user.htm&release=264.0.0&type=5)
- [Reactivate a User](https://help.salesforce.com/s/articleView?id=xcloud.identity_scim_deactivate_reactivate_user.htm&release=264.0.0&type=5)

## Deactivate a User with PATCH

To deactivate a user, send a PATCH request to the Users endpoint, as shown in this example.

Request:

```
PATCH https://mycompany.my.salesforce.com/services/scim/v2/Users/<user_Id>

{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ],
  "Operations": [
    {
      "op": "replace",
      "value": {
        "active": false
      }
    }
  ]
}
```

Response:

```
HTTP/1.1 200 OK
…

{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User",
    "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"
  ],
  "id": "0054W00000...",
  "userName": "scimuser@mycompany.com",
  "externalId": "scimUser",
  "name": {
    "formatted": "User Scim",
    "familyName": "Scim",
    "givenName": "User"
  },
  "displayName": "User Scim",
  "nickName": "user2",
  "emails": [
    {
      "type": "work",
      "primary": true,
      "value": "user@mycompany.com"
    }
...  

  "meta": {
    "created": "2020-10-22T06:21:45Z",
    "lastModified": "2020-10-25T09:21:43Z",
    "location": "https://mycompany.my.salesforce.com/services/scim/v2/Users/0054W000...",
    "resourceType": "User",
    "version": "6a91c1386738961d6b223b2c6ef860715f2ab155"
  }
}
```

## Deactivate a User with DELETE

You can also deactivate a user with a DELETE request, as shown here. The result is the same as deactivating a user with a PATCH request. The user object’s active status is updated to `false`. In this example, notice that the response code only includes an HTTP code. This code indicates that the request is successful.

Request:

```
DELETE https://mycompany.my.salesforce.com/services/scim/v2/Users/<user_id>
```

Response:

```
HTTP/1.1 204 No Content
```

## Reactivate a User

You can reactivate a user object by sending a PATCH request to the Users endpoint. Here’s an example request.

Request:

```
PATCH https://mycompany.my.salesforce.com/services/scim/v2/Users/<user_id>

{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ],
  "Operations": [
    {
      "op": "replace",
      "value": {
        "active": true
      }
    }
  ]
}
```

Response:

```
HTTP/1.1 200 OK
…

{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User",
    "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"
  ],
  "id": "0054W00000CVREkQAP",
  "userName": "scimuser@mycompany.com",
  "externalId": "scimUser",
  "name": {
    "formatted": "User Scim",
    "familyName": "Scim",
    "givenName": "User"
  },
  "displayName": "User Scim",
  "nickName": "user2",
  "emails": [
    {
      "type": "work",
      "primary": true,
      "value": "user@mycompany.com"
    }
  ...

  "meta": {
    "created": "2020-10-22T06:21:45Z",
    "lastModified": "2020-10-25T15:18:57Z",
    "location": "https://mycompany.my.salesforce.com/services/scim/v2/Users/0054W00000CVREkQAP",
    "resourceType": "User",
    "version": "b5f45d87e1a39af1f10ef8d16fd7f61a30c171ed"
  }
}
```