Chilkat Online Tools

autoit / Zoom API / Delete a user

Back to Collection Items

; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.

$oHttp = ObjCreate("Chilkat.Http")
Local $bSuccess

; Adds the "Authorization: Bearer <access_token>" header.
$oHttp.AuthToken = "<access_token>"

Local $oResp = $oHttp.QuickRequest("DELETE","reprehenderit&transfer_meeting=true&transfer_webinar=true&transfer_recording=true")
If ($oHttp.LastMethodSuccess = False) Then
    ConsoleWrite($oHttp.LastErrorText & @CRLF)
    Exit
EndIf

Local $iRespStatusCode = $oResp.StatusCode
ConsoleWrite("Response Status Code = " & $iRespStatusCode & @CRLF)
If ($iRespStatusCode <> 204) Then
    ConsoleWrite("Response Header:" & @CRLF)
    ConsoleWrite($oResp.Header & @CRLF)
    ConsoleWrite("Response Body:" & @CRLF)
    ConsoleWrite($oResp.BodyStr & @CRLF)
    ConsoleWrite("Failed." & @CRLF)

    Exit
EndIf

ConsoleWrite("Success." & @CRLF)

Curl Command

curl -X DELETE
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/users/:userId?action=disassociate&transfer_email=quis officia in reprehenderit&transfer_meeting=true&transfer_webinar=true&transfer_recording=true

Postman Collection Item JSON

{
  "name": "Delete a user",
  "request": {
    "method": "DELETE",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/users/:userId?action=disassociate&transfer_email=quis officia in reprehenderit&transfer_meeting=true&transfer_webinar=true&transfer_recording=true",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "users",
        ":userId"
      ],
      "query": [
        {
          "key": "action",
          "value": "disassociate",
          "description": "Delete action options:<br>`disassociate` - Disassociate a user.<br>`delete`-  Permanently delete a user.<br>Note: To delete pending user in the account, use `disassociate`"
        },
        {
          "key": "transfer_email",
          "value": "quis officia in reprehenderit",
          "description": "Transfer email. This field is **required** if the user has upcoming Zoom Events scheduled. After you delete or disassociate the user, the user's upcoming Zoom Events will be transferred to the target user."
        },
        {
          "key": "transfer_meeting",
          "value": "true",
          "description": "Transfer meeting."
        },
        {
          "key": "transfer_webinar",
          "value": "true",
          "description": "Transfer webinar."
        },
        {
          "key": "transfer_recording",
          "value": "true",
          "description": "Transfer recording."
        }
      ],
      "variable": [
        {
          "key": "userId",
          "value": "quis officia in reprehenderit",
          "description": "(Required) The user ID or email address of the user. For user-level apps, pass the `me` value for this parameter."
        }
      ]
    },
    "description": "Use this API to disassociate (unlink) a user or permanently delete a user. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.\n\n**Deleting** a user **permanently** removes the user and their data from Zoom. Users can create a new Zoom account using the same email address. An account owner or an account admin can transfer meetings, webinars and cloud recordings to another Zoom user account before deleting.\n\n**Disassociating** a user unlinks the user from the associated Zoom account and provides the user their own basic free Zoom account. The disassociated user can then purchase their own Zoom licenses. An account owner or account admin can transfer the user's meetings, webinars, and cloud recordings to another user before disassociation.\n\n**Scopes:** `user:write:admin`, `user:write`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`"
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `204`<br>\nUser deleted.",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/users/:userId?action=disassociate&transfer_email=quis officia in reprehenderit&transfer_meeting=true&transfer_webinar=true&transfer_recording=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users",
            ":userId"
          ],
          "query": [
            {
              "key": "action",
              "value": "disassociate"
            },
            {
              "key": "transfer_email",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "transfer_meeting",
              "value": "true"
            },
            {
              "key": "transfer_webinar",
              "value": "true"
            },
            {
              "key": "transfer_recording",
              "value": "true"
            }
          ],
          "variable": [
            {
              "key": "userId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The user ID or email address of the user. For user-level apps, pass the `me` value for this parameter."
            }
          ]
        }
      },
      "status": "No Content",
      "code": 204,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `400` **Bad Request** <br><br> **Error Code:** `300`<br>The transfer-to email address cannot be the same as the unlinked or deleted user’s email address.<br> Unable to unlink API user(s).<br> This user has published events on Zoom Ev",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/users/:userId?action=disassociate&transfer_email=quis officia in reprehenderit&transfer_meeting=true&transfer_webinar=true&transfer_recording=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users",
            ":userId"
          ],
          "query": [
            {
              "key": "action",
              "value": "disassociate"
            },
            {
              "key": "transfer_email",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "transfer_meeting",
              "value": "true"
            },
            {
              "key": "transfer_webinar",
              "value": "true"
            },
            {
              "key": "transfer_recording",
              "value": "true"
            }
          ],
          "variable": [
            {
              "key": "userId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The user ID or email address of the user. For user-level apps, pass the `me` value for this parameter."
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `404` **Not Found**<br><br>\n**Error Code:** `1001`<br>\nUser does not exist: $userId.<br>",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/users/:userId?action=disassociate&transfer_email=quis officia in reprehenderit&transfer_meeting=true&transfer_webinar=true&transfer_recording=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users",
            ":userId"
          ],
          "query": [
            {
              "key": "action",
              "value": "disassociate"
            },
            {
              "key": "transfer_email",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "transfer_meeting",
              "value": "true"
            },
            {
              "key": "transfer_webinar",
              "value": "true"
            },
            {
              "key": "transfer_recording",
              "value": "true"
            }
          ],
          "variable": [
            {
              "key": "userId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The user ID or email address of the user. For user-level apps, pass the `me` value for this parameter."
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}