# How to call the Delete User API source: https://developer.mastercard.com/priceless-planet-carbon-tracker/tutorial/test-cases/step3/index.md ### Delete user profiles {#delete-user-profiles} The **Delete User** service allows the issuer to delete one or more users from the Carbon Calculator Experience platform. ## Pre-requisites {#pre-requisites} Before executing the test cases, acquaint yourself with the endpoint use case and parameters: * [Delete User](https://developer.mastercard.com/priceless-planet-carbon-tracker/documentation/use-cases/delete_user/index.md) * [Delete User Parameters](https://developer.mastercard.com/priceless-planet-carbon-tracker/documentation/parameters/index.md#delete-user/) ## Delete a user profile {#delete-a-user-profile} 1. To delete a user on the Carbon Calculator Experience platform, send a POST request. 2. Provide a list of user IDs in the request to delete. ```py https://sandbox.api.mastercard.com/cts/issuers/user-deletions ``` ```json [ "c8b38606-12b2-43c6-a641-be8eb0ab9dec", "4ba581a55-bcea-4c3e-8e0f-9b4726e5e6d3" ] ``` 3. A successful request returns the `HTTP 202 Success` status code and a JSON response body that includes a list of user identifiers that were deleted. ```json [ "c8b38606-12b2-43c6-a641-be8eb0ab9dec", "4ba581a55-bcea-4c3e-8e0f-9b4726e5e6d3" ] ``` Note: The API does not delete invalid user IDs present in the request body. It only returns in the response, the list of valid user IDs that were deleted successfully. ## Failed scenarios {#failed-scenarios} This section discusses a failed scenario and the error message expected. ### Delete a user with an invalid user ID {#delete-a-user-with-an-invalid-user-id} 1. Send a POST request to delete a user. 2. Provide an invalid user ID. ```py [ "c8b38606-12b2-43c6-a641-be8eb0ab9dec12" ] ``` 3. This request fails with the error code `HTTP 400 Bad Request` as the response. ```json { "Errors": { "Error": [ { "Source": "CARBON CALCULATOR EXPERIENCE", "ReasonCode": "INVALID_REQUEST_PARAMETER", "Description": "One of the request parameters is invalid, try again with correct request.", "Recoverable": true, "Details": "userId must match \"^[0-9A-Fa-f\\-]{36}\"" } ] } } ```