Trillet AI logo

Update Business Hours

Change the weekly hours, the timezone, or whether the hours are in use.

PUThttps://api.trillet.ai/v1/api/call-flows/{id}/office-hours

Send any combination of the three fields. Anything you leave out is untouched, so a timezone change does not have to resend the week.

Headers

x-workspace-idstringrequired

Workspace identifier for the API.

Path Parameters

idstringrequired

The unique ID of the call flow.

Request Body

perDayobject

The weekly hours. Keys are Monday through Sunday; days you omit fall back to closed.

timezonestring

IANA timezone the hours are read in, for example America/New_York.

holdOutboundCallsboolean

Whether these hours are in use. While false the agent does not read them and outbound calls are not held.

versionstring

The version from your last read. The write is refused with 409 HOURS_CHANGED if the hours changed since. Omit it to merge and retry instead.

At least one of perDay, timezone or holdOutboundCalls must be present, or the request is rejected with 400.

curl -X PUT 'https://api.trillet.ai/v1/api/call-flows/{flowId}/office-hours' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'x-workspace-id: YOUR_WORKSPACE_ID' \
  -H 'Content-Type: application/json' \
  -d '{
    "timezone": "America/New_York",
    "perDay": {
      "Monday":    { "enabled": true,  "start": "08:00", "end": "20:00" },
      "Tuesday":   { "enabled": true,  "start": "08:00", "end": "20:00" },
      "Wednesday": { "enabled": true,  "start": "08:00", "end": "20:00" },
      "Thursday":  { "enabled": true,  "start": "08:00", "end": "20:00" },
      "Friday":    { "enabled": true,  "start": "08:00", "end": "18:00" },
      "Saturday":  { "enabled": true,  "start": "08:00", "end": "22:00" },
      "Sunday":    { "enabled": false, "start": "09:00", "end": "17:00" }
    }
  }'
200
{
  "success": true,
  "officeHours": { "holdOutboundCalls": true, "timezone": "America/New_York", "perDay": {}, "status": {} },
  "version": "9b7e1d40-55a2-4c0f-8e3a-1c6d9f2b7a04"
}

Last updated on