# Delete task

```http
DELETE /projects/{project_reference}/tasks/{task_id}
```

Delete the source file of a task that is no longer needed; returns the acknowledgement ok: true. Requires project.runs.write.

## Parameters

| Name                 | In    | Required | Description                                                           |
| -------------------- | ----- | -------- | --------------------------------------------------------------------- |
| `project_reference`  | path  | Yes      | Project slug, UUID, or domain that identifies the project.            |
| `task_id`            | path  | Yes      |                                                                       |
| `source_target_kind` | query |          | Source to write: project or preview\_branch. Defaults to project.     |
| `target_branch_id`   | query |          | Preview branch to write when source\_target\_kind is preview\_branch. |

## Responses

| Status | Description                                    |
| ------ | ---------------------------------------------- |
| 200    | Task deleted                                   |
| 400    | Bad request                                    |
| 401    | Unauthorized                                   |
| 403    | Forbidden. API keys also require delete scope. |
| 404    | Not found                                      |
| 409    | Conflict                                       |
