# Zoom SCIM2 'Deactivate A User' API Inaccurate Error Response

**URL:** <https://devforum.zoom.us/t/zoom-scim2-deactivate-a-user-api-inaccurate-error-response/100447>\
**Category:** API and Webhooks\
**Tags:** api\
**Created:** [December 19, 2023, 7:15pm UTC](https://devforum.zoom.us/t/zoom-scim2-deactivate-a-user-api-inaccurate-error-response/100447 "2023-12-19T19:15:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cabosticgardner](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/cabosticgardner/32/52969_2.png) [@cabosticgardner](https://devforum.zoom.us/u/cabosticgardner)\
**Post date:** [December 19, 2023, 7:15pm UTC](https://devforum.zoom.us/t/zoom-scim2-deactivate-a-user-api-inaccurate-error-response/100447/1 "2023-12-19T19:15:01Z")

</div>

### Format Your New Topic as Follows:

**API Endpoint(s) and/or Zoom API Event(s)**  
[SCIM2 - Deactivate a user](https://developers.zoom.us/docs/api/rest/reference/scim-api/methods/#operation/userADSCIM2Deactivate)

**Description**  
When sending a request to deactivate a user, improper capitalization of the ‘Operations’ property of the JSON for the request Body causes a response error of: ‘The request JSON did not contains valid active field’.

In testing, sending a request payload with a lower case ‘o’ for the operations property resulted in a 400 - Bad Request. When sending with a capital ‘O’ the request would be successful and the response back would be 200 - Ok.

The response message/details are inaccurate/misleading because the issue isn’t caused by any ‘fields’ of the object which the request would be trying to modify if successful; specifically the ‘active’ field, which both the JSON itself and the field itself are properly formed in the request Body (shown below in the Parameters dump, included as an attachment).

The ZoomSCIM2APISpec for a different endpoint: Update a group → `PATCH /scim2/Groups/{groupId}`, has more accurate 400 responses - [SCIM2 - Update a group](https://developers.zoom.us/docs/api/rest/reference/scim-api/methods/#operation/groupSCIM2Update)

**Error?**  
PowerShell Invoke-WebRequest Response

```json
{
  "ErrorDetails": {
    "Message": {
      "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:Error"
      ],
      "detail": "The request json did not contains valid active field.",
      "status": 400
    }
  }
}

```

**How To Reproduce**  
_Steps to reproduce the behavior:_

1. Send PowerShell API Request with lowercase ‘o’ for `Operations` property of request Body

```PowerShell
$Parameters = @{
    Uri = "https://api.zoom.us/scim2/Users/${UserId}"
    Method = 'PATCH'
    ContentType = 'application/json'
    Headers = @{ 'Accept' = 'application/scim+json'; 'Authorization' = "Bearer ${AccessToken}" }
    Body = $DeactivateUserBodyJson
}

$response = Invoke-WebRequest @Parameters

```

→ Request URL / Headers

```json
{
  "Uri": "https://api.zoom.us/scim2/Users/<user-id>",
  "ContentType": "application/json",
  "Body": "{\"operations\":[{\"value\":{\"active\":false},\"op\":\"replace\"}],\"schemas\":[\"urn:ietf:params:scim:api:messages:2.0:PatchOp\",\"urn:ietf:params:scim:api:messages:2.0:ListResponse\"]}",
  "Method": "PATCH",
  "Headers": {
    "Accept": "application/scim+json",
    "Authorization": "Bearer <token>"
  }
}

```

1. Authentication method or app type  
`Account Level`  
`Server-to-Server OAuth`

2. Any errors

```json
{
  "ErrorDetails": {
    "Message": {
      "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:Error"
      ],
      "detail": "The request json did not contains valid active field.",
      "status": 400
    }
  },
  "ErrorMessage": "Response status code does not indicate success: 400 (Bad Request).",
  "InvocationInfo": {
    "PositionMessage": "At <script-name>.ps1:119 char:21\r\n+ $response = Invoke-WebRequest @Parameters\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  },
  "ErrorCategory": {
    "Category": 7,
    "Activity": "Invoke-WebRequest",
    "Reason": "HttpResponseException",
    "TargetName": "Method: PATCH, RequestUri: 'https://api.zoom.us/scim2/Users/<user-id>', Version: 1.1, Content: System.Net.Http.ByteArrayContent, Headers:\r\n{\r\n Accept: application/scim+json\r\n Authorization: Bearer **** VEpg\r\n User-Agent: Mozilla/5.0\r\n User-Agent: (Windows NT 10.0; Microsoft Windows 10.0.19044; en-US)\r\n User-Agent: PowerShell/7.4.0\r\n Accept-Encoding: gzip\r\n Accept-Encoding: deflate\r\n Accept-Encoding: br\r\n Content-Type: application/json\r\n Content-Length: 171\r\n}",
    "TargetType": "HttpRequestMessage"
  },
  "ErrorTimestamp": "2023-12-15T13:42:33.0082336-05:00"
}

```

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [December 19, 2023, 9:13pm UTC](https://devforum.zoom.us/t/zoom-scim2-deactivate-a-user-api-inaccurate-error-response/100447/2 "2023-12-19T21:13:06Z")

</div>

Thank you for reporting @cabosticgardner , I’ll inquire about this further to see if it can be updated.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [December 20, 2023, 9:13pm UTC](https://devforum.zoom.us/t/zoom-scim2-deactivate-a-user-api-inaccurate-error-response/100447/4 "2023-12-20T21:13:22Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
