Delete User
This endpoint permanently deletes a user by ID. It cannot be undone.
Endpoint
Section titled “Endpoint”DELETE /v1/users/users/:idAuthentication
Section titled “Authentication”Include your API key in the x-api-key header. See Authentication.
Required Scope
Section titled “Required Scope”users:writePath Parameters
Section titled “Path Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | User ID to delete. |
Request Body
Section titled “Request Body”This endpoint does not accept a request body.
Example Request
Section titled “Example Request”curl -X DELETE "https://api.crewsum.com/v1/users/users/user-a" \ -H "x-api-key: $CREWSUM_API_KEY"const response = await fetch("https://api.crewsum.com/v1/users/users/user-a", { method: "DELETE", headers: { "x-api-key": process.env.CREWSUM_API_KEY, },});const result = await response.json();DELETE /v1/users/users/user-a HTTP/1.1Host: api.crewsum.comx-api-key: <your-api-key>Response
Section titled “Response”On success, the API returns HTTP 200 OK.
Example Response
Section titled “Example Response”{ "message": "Successfully deleted user"}Behavior
Section titled “Behavior”- This is a hard delete. The user record is removed from the database. It is not archived.
- Crewsum also removes the user’s direct project and task assignments, supplier contact links, and user group memberships.
- Crewsum deletes the user’s sign-in profile. If that step fails, the user is still deleted and the API still returns
200. - Crewsum updates the number of paid seats on your subscription. This can change your bill.
- You cannot delete a user with the
tenant-adminrole. The API returns500. - The delete fails with
500when other records still refer to the user, for example the user’s timesheets or a linked internal contact. To remove such a user from active use, archive them with Update User instead. - An unknown user ID returns
500, not404. - After the user is deleted, Crewsum sends the
users.deletedwebhook event.
Error Responses
Section titled “Error Responses”| Status | Meaning |
|---|---|
400 | "User ID not found": the ID path segment was empty. |
500 | "Error deleting user": the user does not exist, has the tenant-admin role, is still referenced by other records, or the delete failed. |
Authentication and scope failures are described in Errors.
Related Webhooks
Section titled “Related Webhooks” users.deleted View webhook event details.