# createTaskOnContact

Create a to-do task on a contact: one line item (title, optional description, due day, assignees) in someone's queue, checked off with completeTask; NOT a calendar event (createAppointment) and NOT a background job (bulkTasks). Requires contactId, title, dueDate, timezone. DUE DATES ARE A LOCAL DAY, NOT AN INSTANT: timezone (PST/MST/CST/EST/…) is the zone the day is read in, and it decides the TODAY/OVERDUE bucket in listMyTasks; send the user's zone, and for a day-level ask ("follow up Friday") pick an end-of-business time there, not a bare midnight. ALWAYS pass participants (getMyProfile for the key owner, listTeammates for a colleague; same-org): with none the task is UNASSIGNED and in nobody's listMyTasks, which is how a checklist silently goes missing. ONE TASK PER CALL: an ad-hoc multi-step checklist is one call per step, in order, with staggered due dates (a saved TASK_SET is one applyTaskSet call). bulkCreateTasksOnContacts puts ONE task on many contacts, so a checklist over many contacts is STILL one action per step even there; never promise a whole ad-hoc multi-step checklist in one click, here or in the app. The response echoes the contact's FULL task list: confirm the checklist from the last call's list. From a chat, a dealIds deal holding an open task refuses the create and names it: ask whether to move that one or add another, then resend with alongsideOpenTasks: true. Confirm the plan with the user before creating tasks for them.

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

## Variables

- `contactId`: `String!` (required)
- `title`: `String!` (required)
- `dueDate`: `DateTime!` (required)
- `timezone`: `Timezone!` (required, one of `IDLW`, `SST`, `HST`, `AKST`, `PST`, `MST`, `AZ`, `CST`, `EST`, `AST`, `BRT`, `FNT`, `AZOT`, `UTC`, `CET`, `EET`, `MSK`, `GST`, `PKT`, `BST`, `ICT`, `JST`, `AEST`, `NCT`, `NZST`). AZ: Arizona: MST all year, no DST.
- `description`: `String`
- `taskType`: `String`
- `participants`: `[String!]`
- `dealIds`: `[ID!]`
- `alongsideOpenTasks`: `Boolean`

## Response (data, an example)

```json
{
  "tasksMutation": {
    "createTaskOnContact": {
      "id": "<ID>",
      "name": "…",
      "tasks": [
        {
          "id": "<ID>",
          "title": "…",
          "description": "…",
          "taskType": "…",
          "dueDate": "2026-01-01T00:00:00.000Z",
          "timezone": "IDLW",
          "completedAt": "2026-01-01T00:00:00.000Z",
          "participants": [
            {
              "id": "<ID>",
              "firstName": "…",
              "lastName": "…"
            }
          ]
        }
      ]
    }
  }
}
```

## 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": "createTaskOnContact",
    "variables": {
      "contactId": "<String>",
      "title": "<String>",
      "dueDate": "2026-01-01T00:00:00.000Z",
      "timezone": "IDLW"
    }
  }'
```
