group | title | contributor_name | contributor_link | b2b_only | redirect_to | status |
---|---|---|---|---|---|---|
graphql |
deleteCompanyUser mutation |
Atwix |
true |
migrated |
Use the deleteCompanyUser
mutation to deactivate the specified company user.
You can get the user ID with the company
query.
mutation {
deleteCompanyUser(
id: ID!
) {
DeleteCompanyUserOutput
}
}
The following example deactivates the user specified in the id
attribute.
Request:
mutation {
deleteCompanyUser(
id: "Mg=="
) {
success
}
}
Response:
{
"data": {
"deleteCompanyUser": {
"success": true
}
}
}
The deleteCompanyUser
mutation requires the following input:
Attribute | Data Type | Description |
---|---|---|
id |
ID! | The encoded user ID to deactivate |
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 ) |
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. |