B2B for Adobe Commerce only. Learn more.

deleteCompanyUser mutation

Use the deleteCompanyUser mutation to deactivate the specified company user.

You can get the user ID with the company query.

Syntax

1
2
3
4
5
6
7
mutation {
    deleteCompanyUser(
        id: ID!
    ) {
        DeleteCompanyUserOutput
    }
}

Example usage

The following example deactivates the user specified in the id attribute.

Request:

1
2
3
4
5
6
7
mutation {
  deleteCompanyUser(
    id: "Mg=="
  ) {
    success
  }
}

Response:

1
2
3
4
5
6
7
{
  "data": {
    "deleteCompanyUser": {
      "success": true
    }
  }
}

Input attributes

The deleteCompanyUser mutation requires the following input:

Attribute Data Type Description
id ID! The encoded user ID to deactivate

Output attributes

The deleteCompanyUser mutation returns a Boolean value that indicates whether the operation was successful.

Attribute Data Type Description
success Boolean! Indicates whether the company user has been deactivated successfully (true or false)

Errors

Error Description
You do not have authorization to perform this action. The user with the ID provided in the input.id argument is not available to your company, or you do not have the necessary permissions to perform this operation.
You cannot delete yourself. You must specify a company user other than yourself.
A customer with the same email address already exists in an associated website The email provided in the input.email argument belongs to another user.
The user XXX is the company admin and cannot be set to inactive. You must set another user as the company admin first. The company owner cannot be deactivated. You must set another user as the company admin first.