Skip to content
  • There are no suggestions because the search field is empty.

Delete user in company API Route

This route is used to delete users via the Phin API. Users who are managed by a user-sync integration (Google/Azure) will not be deleted. 

Body Reference

Field Type Required
userIds Array[String] Yes
 

Body Sample

{ "userIds":
[
"userId1",
"userId2",
...,
"userIdN"

]
}

Response Reference

Field Type Description
error String If no users were successfully deleted, this field is returned with a description of what error was encountered. 
failedUserIds Array[String] If any users failed to be deleted, this field is returned and provides a list of all users that failed to be deleted.
successfullyDeletedUserIds Array[String] Array of all userIds that were successfully deleted.
message String String description of what happened. Can denote either complete or partial success.

Error Reference

Code Message Explanation
400 Bad request The request was missing required fields.
404 Company does not exist The provided companyId either does not exist, or maps to a company that has been deleted.
500 Failed to delete users None of the provided users were successfully deleted. Ensure that provided userIds exist and are not managed by a third party integration.

Error Response Sample

{ 
"error": "Failed to delete 1 users. Ensure that the provided userIds are valid and that the users exist in the provided company",
"failedUserIds": ["userId1"]
}