> ## Documentation Index
> Fetch the complete documentation index at: https://api.docs.dealmachine.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Task

> Delete a task

Permanently delete a task.

<ParamField path="id" type="string" required>
  Task ID.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE "https://api.v2.dealmachine.com/v1/tasks/task_001" \
    -H "Authorization: Bearer dm_sk_live_xxx"
  ```

  ```typescript Node.js theme={null}
  const response = await fetch(
    `https://api.v2.dealmachine.com/v1/tasks/${taskId}`,
    {
      method: "DELETE",
      headers: { Authorization: `Bearer ${apiKey}` },
    }
  );

  const { data } = await response.json();
  console.log(data.deleted ? "Task deleted" : "Failed");
  ```

  ```python Python theme={null}
  import requests

  response = requests.delete(
      f"https://api.v2.dealmachine.com/v1/tasks/{task_id}",
      headers={"Authorization": f"Bearer {api_key}"},
  )

  print("Deleted" if response.json()["data"]["deleted"] else "Failed")
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": {
      "deleted": true
    }
  }
  ```

  ```json 404 theme={null}
  {
    "error": {
      "code": "task_not_found",
      "message": "Task not found"
    }
  }
  ```
</ResponseExample>
