Delete a user account for a customer

Applies To

  • Partner Center

How to delete an existing user account for a customer.


  • Credentials as described in Partner Center authentication. This scenario supports authentication with App+User credentials only.
  • A customer ID (customer-tenant-id). If you do not have a customer's ID, you can look up the ID in Partner Center by choosing the customer from the customers list, selecting Account, then saving their Microsoft ID.
  • A user ID. If you do not have the user ID, see Get a list of all user accounts for a customer.

What happens when you delete a user account?

The user state is set to "inactive" when you delete a user account. It remains that way for thirty days, after which the user account and its associated data are purged and made unrecoverable. If you want to restore a deleted user account within the thirty day window, see Restore a deleted user for a customer. Note that once deleted and marked "inactive" the user account is no longer returned as a member of the user collection (for example, using Get a list of all user accounts for a customer).


To delete an existing customer user account, use the IAggregatePartner.Customers.ById method with the customer ID to identify the customer. Then call the Users.ById method to identify the user. Finally, call the Delete method to delete the user and set the user state to inactive.

// IAggregatePartner partnerOperations;
// string selectedCustomerId;
// string customerUserIdToDelete;


Sample: Console test app. Project: Partner Center SDK Samples Class: DeleteCustomerUser.cs

REST Request

Request syntax

Method Request URI
DELETE {baseURL}/v1/customers/{customer-tenant-id}/users/{user-id} HTTP/1.1

URI parameter

Use the following query parameter to identify the customer and user.

Name Type Required Description
customer-tenant-id guid Y The value is a GUID formatted customer-tenant-id that allows the reseller to filter the results for a given customer.
user-id guid Y The value is a GUID formatted user-id that belongs to a single user account.

Request headers

Request body


Request example

Authorization: Bearer <token>
Accept: application/json
MS-RequestId: f113b126-ec13-4baa-ab4d-67c245244971
MS-CorrelationId: 709c0b80-016c-4662-b29f-697fdf03e87a
X-Locale: en-US
Content-Length: 0

REST Response

If successful, this method returns 204 No Content.

Response success and error codes

Each response comes with an HTTP status code that indicates success or failure and additional debugging information. Use a network trace tool to read this code, error type, and additional parameters. For the full list, see Partner Center REST Error Codes.

Response example

HTTP/1.1 204 No Content
Content-Length: 0
MS-CorrelationId: 709c0b80-016c-4662-b29f-697fdf03e87a
MS-RequestId: f113b126-ec13-4baa-ab4d-67c245244971
MS-ServerId: 101112616
Date: Tue, 24 Jan 2017 23:27:18 GMT