# completeTask

Mark a task complete by taskId + its contactId (listMyTasks/listContactTasks). USE THIS whenever the task has a contact: it also writes the completion to the contact's timeline, and the response echoes the contact's tasks with completedAt, to confirm and show what's open. Synchronous. isCompleted: false reopens. The task must be on that contact. A task listed with contact: null has no contactId: use completeTaskById. Confirm with the user before completing anything for them.

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

## Variables

- `taskId`: `String!` (required)
- `contactId`: `String!` (required)
- `isCompleted`: `Boolean!` (default `true`)

## Response (data, an example)

```json
{
  "tasksMutation": {
    "updateTaskCompleted": {
      "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": "completeTask",
    "variables": {
      "taskId": "<String>",
      "contactId": "<String>"
    }
  }'
```
