GoliathDevelopersGet an API key
Reference/Tasksgenerated from the gateway manifest

createTaskOnDeal

Create a to-do task on a deal with no contact.

POST/api/v1/callWRITEidempotent · 24 hruns as the key's owner
View as Markdown

Create a to-do task on a deal with no contact: pipeline work that belongs to the deal (order the title search, chase the inspection report). dealId from findDeals/getDeal. createTaskOnContact's rules apply: timezone is the zone the due day is read in, participants (getMyProfile/listTeammates) put it in a real queue (none = unassigned, invisible to listMyTasks), and a multi-step checklist is one call per step with staggered due dates. The response echoes the deal's full task list; getDeal tasks reads it too (never listContactTasks). Edit or delete it with updateTaskOnDeal / deleteTaskOnDeal. From a chat, a 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 with the user before creating tasks for them.

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": "createTaskOnDeal",
    "variables": {
      "dealId": "<dealId>",
      "title": "<String>",
      "dueDate": "2026-01-01T00:00:00.000Z",
      "timezone": "IDLW"
    }
  }'
import { GoliathClient } from '@goliath-data/sdk'

const goliath = new GoliathClient({
  apiKey: process.env.GOLIATH_API_KEY!,
  baseUrl: 'https://server.goliathdata.com',
})

// Enum values as strings: the SDK's enum types aren't exported yet, so assert to the method's variables type.
const variables = {
  dealId: '<dealId>',
  title: '<String>',
  dueDate: '2026-01-01T00:00:00.000Z',
  timezone: 'IDLW'
} as Parameters<typeof goliath.tasks.createTaskOnDeal>[0]

const result = await goliath.tasks.createTaskOnDeal(variables, { idempotencyKey: crypto.randomUUID() })
const res = await fetch('https://server.goliathdata.com/api/v1/call', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.GOLIATH_API_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({
    operationId: 'createTaskOnDeal',
    variables: {
      dealId: '<dealId>',
      title: '<String>',
      dueDate: '2026-01-01T00:00:00.000Z',
      timezone: 'IDLW'
    }
  }),
})
const { data, errors } = await res.json()

Variables

The example sends only what the schema requires. Some operations also need one of several optional variables (one filter or another, say); the description above says which.

dealIdID!required
titleString!required
dueDateDateTime!required
timezoneTimezone!required

AZ: Arizona: MST all year, no DST.

IDLWSSTHSTAKSTPSTMSTAZCSTESTASTBRTFNTAZOTUTCCETEETMSKGSTPKTBSTICTJSTAESTNCTNZST
descriptionString
taskTypeString
participants[String!]
alongsideOpenTasksBoolean

Response

What comes back under data: a list shows as one entry, and a value as its type.

response shape
{
  "data": {
    "tasksMutation": {
      "createTaskOnDeal": {
        "id": "<ID>",
        "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": "…"
              }
            ]
          }
        ]
      }
    }
  }
}

Errors

Idempotency

Send an Idempotency-Key of 1 to 255 characters. A finished request retried with the same key replays its stored response, marked Idempotency-Replayed: true; one still in flight returns 409 idempotency_conflict. Keys expire after 24 hours. Write without fear →