GoliathDevelopersGet an API key
Reference/Appointmentsgenerated from the gateway manifest

createAppointment

Create an appointment.

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

Create an appointment: title, timezone, startDate, endDate; optional location, description, contactIds (accessible to the key owner), participant userIds (listTeammates), appointmentReminderWorkflowGroupId (listAppointmentReminders; null = no texts to contacts, but participants' 15-minute alert still follows their notification settings; this API applies no org default, so to give it the default pass the isGlobal one's id). By default it is ALSO created on a connected Google/Microsoft calendar, which is what invites the participants and linked contacts as guests: the key owner's, EXCEPT when userIds names exactly one teammate and not the key owner, then that teammate's, as organizer. createCalendarEvent: false keeps it inside Goliath. ALWAYS read calendarSync before telling anyone it is booked: SYNCED = the event exists and guests were invited, the only state where an invite went out (else say it was recorded, not sent); NOT_REQUESTED = Goliath-only; SKIPPED_NO_ACCESS = no connected calendar could be written; SKIPPED_WRITE_BLOCKED = a provider was reachable but deliberately not written; FAILED = the provider errored and the calendar may be stale. Confirm first: title, day, time, zone, participants, contacts and, with a calendar event, whose calendar (it invites them). Double-booking is allowed and nothing here warns, so run checkAvailability FIRST over the same window with every userId plus the key owner (getMyProfile; unless userIds is exactly one teammate without the key owner: then that teammate, the organizer, alone) and show its conflicts. listAppointments is NOT a conflict check: it sees ONLY Goliath appointments. A connected calendar's event lands there only when it already maps to a Goliath appointment, is an out-of-office blocker, or has an attendee whose email matches a CRM contact; everything else (a busy event whose attendees are not contacts, a free/transparent event, any calendar never connected) is never ingested and is invisible here, and a MEMBER key sees only its own rows. So a clear listAppointments window means the GOLIATH calendar looks clear, never that the time is free; even after a clean checkAvailability, say no conflicts were found rather than that the slot is free.

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": "createAppointment",
    "variables": {
      "title": "<String>",
      "timezone": "IDLW",
      "startDate": "2026-01-01T00:00:00.000Z",
      "endDate": "2026-01-01T00:00:00.000Z"
    }
  }'
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 = {
  title: '<String>',
  timezone: 'IDLW',
  startDate: '2026-01-01T00:00:00.000Z',
  endDate: '2026-01-01T00:00:00.000Z'
} as Parameters<typeof goliath.appointments.createAppointment>[0]

const result = await goliath.appointments.createAppointment(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: 'createAppointment',
    variables: {
      title: '<String>',
      timezone: 'IDLW',
      startDate: '2026-01-01T00:00:00.000Z',
      endDate: '2026-01-01T00:00:00.000Z'
    }
  }),
})
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.

titleString!required
timezoneTimezone!required

AZ: Arizona: MST all year, no DST.

IDLWSSTHSTAKSTPSTMSTAZCSTESTASTBRTFNTAZOTUTCCETEETMSKGSTPKTBSTICTJSTAESTNCTNZST
startDateDateTime!required
endDateDateTime!required
locationString
descriptionString
contactIds[ID!]
userIds[String!]
createCalendarEventBoolean
appointmentReminderWorkflowGroupIdID

Response

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

response shape
{
  "data": {
    "tasksMutation": {
      "createAppointment": {
        "id": "<ID>",
        "title": "…",
        "startDate": "2026-01-01T00:00:00.000Z",
        "endDate": "2026-01-01T00:00:00.000Z",
        "timezone": "IDLW",
        "location": "…",
        "description": "…",
        "appointmentReminderWorkflowGroupId": "<ID>",
        "calendarSync": {
          "status": "SYNCED",
          "provider": "GOOGLE"
        },
        "participants": [
          {
            "id": "<ID>",
            "firstName": "…",
            "lastName": "…"
          }
        ],
        "contacts": [
          {
            "id": "<ID>",
            "name": "…"
          }
        ]
      }
    }
  }
}

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 →