Delete Client
This endpoint soft-deletes an existing client by ID.
Endpoint
Section titled “Endpoint”DELETE /v1/clients/clients/:idAuthentication
Section titled “Authentication”Include your API key in the x-api-key header. See Authentication.
Required Scope
Section titled “Required Scope”clients:writePath Parameters
Section titled “Path Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Client 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/clients/clients/client-ghi123jkl4567890" \ -H "x-api-key: $CREWSUM_API_KEY"const response = await fetch( "https://api.crewsum.com/v1/clients/clients/client-ghi123jkl4567890", { method: "DELETE", headers: { "x-api-key": process.env.CREWSUM_API_KEY }, },);const result = await response.json();DELETE /v1/clients/clients/client-ghi123jkl4567890 HTTP/1.1Host: api.crewsum.comx-api-key: <your-api-key>Response
Section titled “Response”On success, the API returns HTTP 200 OK. The response has no data field.
Example Response
Section titled “Example Response”{ "message": "Successfully deleted client-ghi123jkl4567890"}Behavior
Section titled “Behavior”- This is a soft delete. The client is marked
isDeleted: true. It no longer appears in List Clients, but Get Client still returns it. - Only the client record changes. Its projects, contacts, and end customers are not deleted. Their responses show the client as deleted (
clientDeleted: true). - The API does not check that the client exists. An unknown ID returns
200with the success message, and no webhook is sent. Deleting a client that is already deleted also returns200. - After the client is deleted, Crewsum attempts to send the
clients.deletedwebhook event. A webhook failure does not change the response.
Error Responses
Section titled “Error Responses”| Status | Meaning |
|---|---|
400 | {"message": "ClientID not supplied"}. The ID path segment is empty. |
500 | {"message": "Error deleting <id>"}. Crewsum could not delete the client. |
Authentication and scope failures are described in Errors.
Related Webhooks
Section titled “Related Webhooks” clients.deleted View webhook event details.