> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/Celaya55/app-cr/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Task

> Delete an existing task

<Note>
  This endpoint requires implementation in the backend. Documentation reflects the expected API design based on the Task model schema.
</Note>

## Authentication

This endpoint requires a valid JWT token in the Authorization header.

```
Authorization: Bearer YOUR_JWT_TOKEN
```

## Path Parameters

<ParamField path="id" type="integer" required>
  The unique identifier of the task to delete
</ParamField>

## Response

<ResponseField name="message" type="string">
  Confirmation message that the task was deleted
</ResponseField>

<ResponseField name="id" type="integer">
  The ID of the deleted task
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE http://localhost:3000/tasks/1 \
    -H "Authorization: Bearer YOUR_JWT_TOKEN"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "message": "Task deleted successfully",
    "id": 1
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "error": "Invalid or missing authentication token"
  }
  ```

  ```json 403 Forbidden theme={null}
  {
    "error": "You do not have permission to delete this task"
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "error": "Task not found"
  }
  ```

  ```json 500 Internal Server Error theme={null}
  {
    "error": "Error deleting task"
  }
  ```
</ResponseExample>
