Skip to content
Rigel docs
Open Rigel

Rigel's routines

agent.routine.list

GET/api/v1/households/{household_id}/queries/agent.routine.list

  • Query
  • Rigel runs it

Lists the routines Rigel runs on its own: what each does, when it repeats, who it is for, whether it is paused, and when it last ran and runs next. Oldest first. Give routine_id for just one. Check it before setting up a routine, so you update an existing one instead of adding a second.

Parameters#

Rigel's routines: parameters
FieldDescription
household_idpathstringrequired

The household's ID.

routine_idquerystringoptional

Only this routine.

Response#

200 The answer.

Rigel's routines: response fields
FieldDescription
routinesarray of objectsrequired
routines[].idstringrequired

A agent routine ID, such as rtn_01JC0000000000000000000000.

routines[].titlestringrequired

What it does, in plain words.

routines[].taskstringrequired

The instructions Rigel follows each time.

routines[].appone of: meals, recipes, shopping, inventory, calendar, email, tasks, documents, chat, maintenance, null or nullrequired

The app whose guide it reads, or null.

routines[].for_person_idstringrequired

Whose authority it runs with and who it is for.

routines[].for_person_namestringrequired

That person's name.

routines[].for_user_idstring or nullrequired

The account that person signs in with, or null if they have none.

routines[].repeatone of 4 shapesrequired

How often it runs: daily at a time, weekly on some days, monthly on a day (1–28), or once on a date. Example: { "kind": "weekly", "days": ["wed"], "time": "09:00" }.

Shape 1
routines[].repeat.kindone of: dailyrequiredNo description.
routines[].repeat.timestringrequired

The time of day in the household's time zone, 24-hour "HH:MM", such as "09:00".

pattern ^([01]\d|2[0-3]):[0-5]\d$
Shape 2, with days
routines[].repeat.kindone of: weeklyrequiredNo description.
routines[].repeat.daysarray, each one of: mon, tue, wed, thu, fri, sat, sunrequired

The days of the week: "mon", "tue", "wed", "thu", "fri", "sat", "sun".

1 to 7 items
routines[].repeat.timestringrequired

The time of day in the household's time zone, 24-hour "HH:MM", such as "09:00".

pattern ^([01]\d|2[0-3]):[0-5]\d$
Shape 3, with day
routines[].repeat.kindone of: monthlyrequiredNo description.
routines[].repeat.dayintegerrequired

The day of the month, 1 to 28, so every month has it.

1 to 28
routines[].repeat.timestringrequired

The time of day in the household's time zone, 24-hour "HH:MM", such as "09:00".

pattern ^([01]\d|2[0-3]):[0-5]\d$
Shape 4, with date
routines[].repeat.kindone of: oncerequiredNo description.
routines[].repeat.datestringrequired

A calendar date in the household's time zone, YYYY-MM-DD.

pattern ^\d{4}-\d{2}-\d{2}$
routines[].repeat.timestringrequired

The time of day in the household's time zone, 24-hour "HH:MM", such as "09:00".

pattern ^([01]\d|2[0-3]):[0-5]\d$
routines[].pausedbooleanrequiredNo description.
routines[].next_run_atinteger or nullrequired

When it runs next, UTC milliseconds; null if paused or finished.

routines[].last_run_atinteger or nullrequired

When it last ran, UTC milliseconds, or null.

routines[].created_atintegerrequiredNo description.

Errors#

Every error has the same envelope: error.code, error.message, error.details, error.recovery and error.request_id.

Rigel's routines: errors
StatusCodeWhen
400validation_failedA field is missing, misspelled or out of range. details.fields lists each problem.
401unauthenticatedThe request has no valid session.
404not_foundThe household doesn't exist, or you aren't a member of it.

Examples#

These are real. Each was recorded from a sample household, the Okafors, running through the whole API when this site was built.

List Rigel's routines

Oldest first, with when each last ran and runs next.

Request, curl
curl 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/agent.routine.list' \
  -H "Cookie: rigel_session=$RIGEL_SESSION"
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/agent.routine.list", {
  headers: {
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
});
const data = await response.json();
Request, HTTP
GET /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/agent.routine.list HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CTCCW6XNKYGM1FN77ZYE

{
  "routines": [
    {
      "id": "rtn_01M6V9CTC5VNP0HS02R6Q1BQHB",
      "title": "Nudge us to plan meals",
      "task": "On Sunday evening, if next week has fewer than five dinners planned, post a dashboard card that asks whether to plan the rest.",
      "app": "meals",
      "for_person_id": "per_01M6V9CS6RX26JK5KVYGRN22D2",
      "for_person_name": "Ada Okafor",
      "for_user_id": "usr_01M6V9CS5XV66GR856KS52MTTZ",
      "repeat": {
        "kind": "weekly",
        "days": [
          "sun"
        ],
        "time": "17:30"
      },
      "paused": false,
      "next_run_at": 1794180600000,
      "last_run_at": null,
      "created_at": 1794064673157
    },
    {
      "id": "rtn_01M6V9CTC7NW649VMCSKRPFYS2",
      "title": "Check the filter supply",
      "task": "On the first of the month, check that the pantry has a furnace filter. If it doesn't, add a pack to the shopping list and post a card that says so.",
      "app": "shopping",
      "for_person_id": "per_01M6V9CS6RX26JK5KVYGRN22D2",
      "for_person_name": "Ada Okafor",
      "for_user_id": "usr_01M6V9CS5XV66GR856KS52MTTZ",
      "repeat": {
        "kind": "monthly",
        "day": 1,
        "time": "09:00"
      },
      "paused": true,
      "next_run_at": null,
      "last_run_at": null,
      "created_at": 1794064673159
    }
  ]
}

Look at one routine

A paused routine has no next run.

Request, curl
curl 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/agent.routine.list?routine_id=rtn_01M6V9CTC7NW649VMCSKRPFYS2' \
  -H "Cookie: rigel_session=$RIGEL_SESSION"
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/agent.routine.list?routine_id=rtn_01M6V9CTC7NW649VMCSKRPFYS2", {
  headers: {
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
});
const data = await response.json();
Request, HTTP
GET /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/agent.routine.list?routine_id=rtn_01M6V9CTC7NW649VMCSKRPFYS2 HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CTCE8KSD4JRTEAZCCG0P

{
  "routines": [
    {
      "id": "rtn_01M6V9CTC7NW649VMCSKRPFYS2",
      "title": "Check the filter supply",
      "task": "On the first of the month, check that the pantry has a furnace filter. If it doesn't, add a pack to the shopping list and post a card that says so.",
      "app": "shopping",
      "for_person_id": "per_01M6V9CS6RX26JK5KVYGRN22D2",
      "for_person_name": "Ada Okafor",
      "for_user_id": "usr_01M6V9CS5XV66GR856KS52MTTZ",
      "repeat": {
        "kind": "monthly",
        "day": 1,
        "time": "09:00"
      },
      "paused": true,
      "next_run_at": null,
      "last_run_at": null,
      "created_at": 1794064673159
    }
  ]
}

For Rigel#

Rigel's tool for this query is agent_routine_list. Rigel runs this on its own, then says what it did. The agent guide has the rest.

Rigel is in early access, and sign-up is by invitation. Open Rigel