API reference · Routines

Update a routine

POST /api/v1/routines/ {routine}

Changes a routine, sending only what changes. Needs an API key. Terminal and routines open with the new RoTerminal: on an account it isn’t open on yet, the answer is permission_denied .

This endpoint needs an API key. See Authentication.

Parameters

routine string Required Path
The routine’s ID (12 characters), from Create a routine or List your routines.
name string
A short name in plain words, like Morning check-in .
question string
What RoBot is asked on each run, whole and on its own: name the games and what to compare.
every string
How often, for a routine on a schedule. minutes hour day week
at string
For day and week : the time of day in New York, as HH:MM (24-hour). Defaults to 08:00 .
weekday string
For week : the day. Defaults to Mon . Mon Tue Wed Thu Fri Sat Sun
minutes integer
For minutes : how many. 15 to 1440
trigger_sql string
For a routine set off when something happens, instead of every : one read-only SQL query over RoTerminal’s research tables, a row for each thing that has happened, its first column that thing’s key, newest first, LIMIT 50 at most. Its rows go to RoBot’s runs; the answer says how many match now.
check_every_minutes integer
For a trigger: how often it’s checked. Defaults to 15. 5 to 1440
cooldown_hours number
For a trigger: the least time between its runs. Defaults to 6. 0.25 to 168
max_fires_per_day integer
For a trigger: the most runs in a New York day. Defaults to 3. 1 to 24
deliver list
Where its note goes: bell (your notifications), discord and email when they’re connected. Defaults to bell .

Example

curl -X POST https://roterminal.co/api/v1/routines/a1b2c3d4e5f6 \ -H "Authorization: Bearer $ROTERMINAL_API_KEY" \ -H "Content-Type: application/json" \ -d '{"at":"09:00"}' import RoTerminal from 'roterminal' const rt = new RoTerminal ({ apiKey: process.env.ROTERMINAL_API_KEY }) const { data } = await rt.routines. update ( 'a1b2c3d4e5f6' , { at: '09:00' }) from roterminal import RoTerminal rt = RoTerminal () # reads ROTERMINAL_API_KEY data = rt.routines. update ( "a1b2c3d4e5f6" , at= "09:00" )[ "data" ]

Response

Every response is { data, link, as_of } . The fields of data are below.

Fields

The fields in data . A field with nothing to say is left out.

id string
Its ID (12 characters).
name string
Its name.
kind string
schedule or trigger .
when string
When it runs, in words.
on boolean
False while it’s paused.
next string
When it runs next (New York time), in words.
delivers_to list of strings
Where its note goes: bell , discord , email .
runs integer
How many times it has run.
last_run string or null
When it last ran, or null.
question string
What RoBot is asked on each run.
channels object
Whether Discord and email are connected for it. 2 fields
discord boolean
email boolean
note string
What was done, in a sentence.