Delete End Customer
This endpoint soft-deletes an existing end customer by ID.
Endpoint
Section titled “Endpoint”DELETE /v1/end-customers/end-customers/:idAuthentication
Section titled “Authentication”Include your API key in the x-api-key header. See Authentication.
Required Scope
Section titled “Required Scope”end-customers:writePath Parameters
Section titled “Path Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | End customer 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/end-customers/end-customers/endcustomer-abc123def4567890" \ -H "x-api-key: $CREWSUM_API_KEY"const response = await fetch( "https://api.crewsum.com/v1/end-customers/end-customers/endcustomer-abc123def4567890", { method: "DELETE", headers: { "x-api-key": process.env.CREWSUM_API_KEY }, },);const result = await response.json();DELETE /v1/end-customers/end-customers/endcustomer-abc123def4567890 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 end customer: endcustomer-abc123def4567890"}Behavior
Section titled “Behavior”- This is a soft delete. The end customer is marked
isDeleted: true. It no longer appears in List End Customers, but Get End Customer still returns it. - Only the end customer record changes. Projects that use this end customer keep their
endCustomerId, and their responses showendCustomerDeleted: true. - The API does not check that the end customer exists. An unknown ID returns
200with the success message, and no webhook is sent. Deleting an end customer that is already deleted also returns200. - After the end customer is deleted, Crewsum attempts to send the
end-customers.deletedwebhook event. A webhook failure does not change the response.
Error Responses
Section titled “Error Responses”| Status | Meaning |
|---|---|
400 | {"message": "EndCustomerID not supplied"}. The ID path segment is empty. |
500 | {"message": "Error deleting end customer: <id>"}. Crewsum could not delete the end customer. |
Authentication and scope failures are described in Errors.
Related Webhooks
Section titled “Related Webhooks” end-customers.deleted View webhook event details.