Skip to main content
POST
Create a routine

Authorizations

Authorization
string
header
required

API key (fam_..., created under Settings → API Keys) or an OAuth 2.0 access token (fam_at_...). Keys can be restricted to scopes such as assistants:read, calls:write, campaigns:write, automations:read, dashboards:read, dashboards:write, leads:write, segments:write, phone_numbers:write, sip_trunks:write, knowledge:write, voices:read, billing:read, settings:write, platform:read, platform:write; a *:write scope implies the matching *:read. Automation and dashboard endpoints also accept the legacy calls:* scope. Keys without scope restrictions have full access.

Body

application/json
name
string
required
prompt
string
required

The instruction the routine runs unattended each time it fires.

schedule_type
enum<string>
required

manual = only runs via POST /routines/{id}/run. hourly/daily/weekdays/weekly/custom fire on the given schedule.

Available options:
manual,
hourly,
daily,
weekdays,
weekly,
custom
id
string<uuid>
schedule_minute
integer | null

hourly only — minute of the hour to fire on (0-59), default 0.

Required range: 0 <= x <= 59
schedule_time
string | null

daily/weekdays/weekly only — 24h wall-clock time "HH:MM", default "09:00".

schedule_weekday
integer | null

weekly only — day of week, 0=Sunday … 6=Saturday.

Required range: 0 <= x <= 6
cron_expression
string | null

custom only — standard 5-field cron (minute hour day-of-month month day-of-week). Occurrences must be at least 10 minutes apart.

timezone
string

IANA timezone the schedule fields above are evaluated in, e.g. Europe/Berlin. Default UTC.

enabled
boolean
required_toolkits
string[]

Connected-app toolkit slugs this routine's prompt depends on, e.g. ["slack","gmail"]. The routine refuses to be created while one of these is not connected.

Maximum array length: 10

Response

The created routine.

data
object
required