setMyAvailabilitySchedule
Create or replace the key owner's availability schedule, a FULL replacement.
Create or replace the key owner's availability schedule, a FULL replacement: read getMyAvailabilitySchedule and send back a modified copy, every override to keep included. Requires timezone (an IANA zone such as America/Chicago, the zone every time is read in) and weeklyHours; dateOverrides optional. It drives the open slots their booking pages offer. "weeklyHours" and "dateOverrides" are raw JSON with a FIXED shape, and this text is their only documentation. "weeklyHours": one day rule per bookable weekday, { "day": 0-6 with Sunday = 0 through Saturday = 6, "intervals": [ { "start": "HH:MM", "end": "HH:MM" } ] }; a weekday with no entry is not bookable. "dateOverrides" (optional): exceptions that REPLACE that day's weekly hours, a single date { "date": "YYYY-MM-DD", "intervals": [...] } or a span { "startDate": "YYYY-MM-DD", "endDate": "YYYY-MM-DD", "intervals": [...] }; either may add "repeat": "monthly" (same day-of-month) or "repeat": "yearly" (same month/day); omit "repeat" for a one-off. "intervals": [] means UNAVAILABLE for that date or span (PTO, holidays, "block me off"). The write REJECTS the whole save (nothing stored) when: "weeklyHours" is empty (block a whole week with a "dateOverrides" span instead); a time is not strict 24-hour "HH:MM" ("9:00" and "5pm" are invalid); an interval's "end" is not after its "start"; intervals in one day or override overlap (touching, 09:00-12:00 then 12:00-17:00, is fine); a date is not a real calendar date; a span's "startDate" equals its "endDate" (write a single "date"); or a one-off span's "endDate" is an earlier calendar date than its "startDate". A one-off span may cross a month or year end with the dates in full ("2026-12-20" to "2027-01-02"): do NOT add "repeat" to make a one-time absence span the year end, that makes it recur every year. Only a RECURRING span may have an "endDate" that reads earlier than its "startDate" ("12-29" to "01-02" every year), which is how it wraps. Example of a complete valid payload: {"timezone":"America/Chicago","weeklyHours":[{"day":1,"intervals":[{"start":"09:00","end":"12:00"},{"start":"13:00","end":"17:00"}]},{"day":3,"intervals":[{"start":"09:00","end":"17:00"}]},{"day":5,"intervals":[{"start":"09:00","end":"15:00"}]}],"dateOverrides":[{"date":"2026-12-24","intervals":[{"start":"09:00","end":"12:00"}]},{"startDate":"2026-11-23","endDate":"2026-11-27","intervals":[],"repeat":"yearly"}]}
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": "setMyAvailabilitySchedule",
"variables": {
"timezone": "<String>",
"weeklyHours": "<JSON>"
}
}'import { GoliathClient } from '@goliath-data/sdk'
const goliath = new GoliathClient({
apiKey: process.env.GOLIATH_API_KEY!,
baseUrl: 'https://server.goliathdata.com',
})
const result = await goliath.appointments.setMyAvailabilitySchedule(
{
timezone: '<String>',
weeklyHours: '<JSON>'
},
{ 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: 'setMyAvailabilitySchedule',
variables: {
timezone: '<String>',
weeklyHours: '<JSON>'
}
}),
})
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.
Response
What comes back under data: a list shows as one entry, and a value as its type.
{
"data": {
"availabilityScheduleMutation": {
"upsert": {
"id": "<ID>",
"userId": "<ID>",
"timezone": "…",
"weeklyHours": "…",
"dateOverrides": "…",
"updatedAt": "2026-01-01T00:00:00.000Z"
}
}
}
}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 →