Trillet AI logo

Save a Schedule

Save a named week that you can switch to later in one call.

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

A schedule is a complete named copy of a week, kept on the shelf. It contains only the recurring week, never dates.

Headers

x-workspace-idstringrequired

Workspace identifier for the API.

Path Parameters

idstringrequired

The unique ID of the call flow.

Request Body

namestringrequired

A name for the schedule, up to 60 characters, for example Storm or Winter hours.

perDayobject

The week to save. Omit this to snapshot the flow's current weekly hours under the given name.

activatebooleandefault: false

Switch to the new schedule in the same call.

A flow holds at most 20 saved schedules.

Save the current week
curl -X POST 'https://api.trillet.ai/v1/api/call-flows/{flowId}/office-hours/schedules' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'x-workspace-id: YOUR_WORKSPACE_ID' \
  -H 'Content-Type: application/json' \
  -d '{"name": "Normal"}'
Save and switch to it
curl -X POST 'https://api.trillet.ai/v1/api/call-flows/{flowId}/office-hours/schedules' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'x-workspace-id: YOUR_WORKSPACE_ID' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Storm",
    "activate": true,
    "perDay": {
      "Monday":    { "enabled": true,  "start": "10:00", "end": "16:00" },
      "Saturday":  { "enabled": false, "start": "09:00", "end": "17:00" }
    }
  }'
200
{
  "success": true,
  "schedule": { "id": "a1b2c3", "name": "Storm", "perDay": {} },
  "officeHours": {},
  "version": "2d4f6a81-90bc-4e1d-a3f7-5b8c0d1e2f34"
}

Last updated on