createTaskOnContact
Create a to-do task on a contact.
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.
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"
}
}'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 = {
contactId: '<String>',
title: '<String>',
dueDate: '2026-01-01T00:00:00.000Z',
timezone: 'IDLW'
} as Parameters<typeof goliath.tasks.createTaskOnContact>[0]
const result = await goliath.tasks.createTaskOnContact(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: 'createTaskOnContact',
variables: {
contactId: '<String>',
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.
AZ: Arizona: MST all year, no DST.
Response
What comes back under data: a list shows as one entry, and a value as its type.
{
"data": {
"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": "…"
}
]
}
]
}
}
}
}Errors
unknown_variableA variable the operation does not declare. A typo is refused rather than silently dropped.
unauthorizedNo bearer header, or the key is invalid or revoked.
insufficient_scopeThe key lacks the scope the operation requires.
forbiddenA referenced record does not exist, was deleted, or is outside your organization. The gateway cannot tell those apart.
idempotency_conflictA request with this Idempotency-Key is still in flight.
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 →