Delete Task
This endpoint soft-deletes an existing task by ID.
Endpoint
Section titled “Endpoint”DELETE /v1/tasks/tasks/:idAuthentication
Section titled “Authentication”Include your API key in the x-api-key header. See Authentication.
Required Scope
Section titled “Required Scope”tasks:writePath Parameters
Section titled “Path Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Task 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/tasks/tasks/task-pqr123stu4567890" \ -H "x-api-key: $CREWSUM_API_KEY"const response = await fetch( "https://api.crewsum.com/v1/tasks/tasks/task-pqr123stu4567890", { method: "DELETE", headers: { "x-api-key": process.env.CREWSUM_API_KEY }, },);const result = await response.json();DELETE /v1/tasks/tasks/task-pqr123stu4567890 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 task task-pqr123stu4567890"}Behavior
Section titled “Behavior”- The task is soft-deleted: it is marked
isDeleted: true. Get Task still returns it. List Tasks returns it only whenallis"true". - You can delete a project’s default task with this endpoint.
- If no task exists for the ID, the API still returns
200. No webhook is sent in that case. - After the task is deleted, Crewsum emits the
tasks.deletedwebhook event. A webhook delivery failure does not change the API response.
Error Responses
Section titled “Error Responses”| Status | Meaning |
|---|---|
400 | The task ID was missing from the route. |
500 | Crewsum could not delete the task. The message is Error deleting task <id>. |
Authentication and scope failures are described in Errors.
Related Webhooks
Section titled “Related Webhooks” tasks.deleted View webhook event details.