# deleteTask

PERMANENTLY delete ONE task by taskId + its contactId: gone from the contact and the queue with NO undo, so ALWAYS confirm with the user, naming the task. Prefer completeTask if the work is DONE (keeps the record and completedAt) or updateTask if details were wrong; delete is for a task that should never have existed. Many at once is deleteTasks: for a sweep ('delete my completed tasks') list them with listMyTasks, get explicit confirmation of the list, then delete. Returns the contact's remaining tasks. The task must belong to the given contact; a task with no contact is deleteTaskOnDeal.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "deleteTask", "variables": {...} }`
- Scope: `WRITE`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `taskId`: `String!` (required)
- `contactId`: `String!` (required)

## Response (data, an example)

```json
{
  "tasksMutation": {
    "deleteTaskOnContact": {
      "id": "<ID>",
      "name": "…",
      "tasks": [
        {
          "id": "<ID>",
          "title": "…",
          "dueDate": "2026-01-01T00:00:00.000Z",
          "completedAt": "2026-01-01T00:00:00.000Z"
        }
      ]
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "deleteTask",
    "variables": {
      "taskId": "<String>",
      "contactId": "<String>"
    }
  }'
```
