Change a routine
agent.routine.update
POST/api/v1/households/{household_id}/commands/agent.routine.update
- Command
- Rigel runs it
- Applies offline
Changes only the fields given: the title, the task, the app, who it is for, or when it repeats. Changing when it repeats works out the next run again from now; a paused routine stays paused. Fails with routine_not_found, person_not_found, or time_in_past for a once-only time that has passed. Returns the routine's ID and when it runs next (null if paused or finished).
Parameters#
| Field | Description |
|---|---|
household_idpathstringrequired | The household's ID. |
Idempotency-Keyheaderstringoptional | The command's ID. Reuse it when retrying the same command. |
Request body#
JSON, as application/json.
| Field | Description |
|---|---|
routine_idstringrequired | A agent routine ID, such as rtn_01JC0000000000000000000000. |
titlestringoptional | What the routine does in plain words for the list in settings, 1–120 characters, such as "Suggest a new recipe on Wednesdays". |
taskstringoptional | The instructions Rigel follows each time, up to 4000 characters, written to be read with nobody around: what to check, when to do something, and what to leave alone. |
appone of: meals, recipes, shopping, inventory, calendar, email, tasks, documents, chat, maintenance, null or nulloptional | The app whose guide Rigel reads; null for none. |
for_person_idstringoptional | Whose authority it runs with and who it is for. |
repeatone of 4 shapesoptional | 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 | |
repeat.kindone of: dailyrequired | No description. |
repeat.timestringrequired | The time of day in the household's time zone, 24-hour "HH:MM", such as "09:00". |
| Shape 2, with days | |
repeat.kindone of: weeklyrequired | No description. |
repeat.daysarray, each one of: mon, tue, wed, thu, fri, sat, sunrequired | The days of the week: "mon", "tue", "wed", "thu", "fri", "sat", "sun". |
repeat.timestringrequired | The time of day in the household's time zone, 24-hour "HH:MM", such as "09:00". |
| Shape 3, with day | |
repeat.kindone of: monthlyrequired | No description. |
repeat.dayintegerrequired | The day of the month, 1 to 28, so every month has it. |
repeat.timestringrequired | The time of day in the household's time zone, 24-hour "HH:MM", such as "09:00". |
| Shape 4, with date | |
repeat.kindone of: oncerequired | No description. |
repeat.datestringrequired | A calendar date in the household's time zone, YYYY-MM-DD. |
repeat.timestringrequired | The time of day in the household's time zone, 24-hour "HH:MM", such as "09:00". |
Response#
200 The command was applied.
| Field | Description |
|---|---|
resultobjectrequired | What the command returned, such as the IDs it created. |
result.routine_idstringrequired | A agent routine ID, such as rtn_01JC0000000000000000000000. |
result.next_run_atinteger or nullrequired | When it runs next, UTC milliseconds, or null. |
versionintegerrequired | The household version after the command. |
Errors#
Every error has the same envelope: error.code, error.message, error.details, error.recovery and error.request_id.
| Status | Code | When |
|---|---|---|
400 | validation_failed | A field is missing, misspelled or out of range. details.fields lists each problem. |
401 | unauthenticated | The request has no valid session. |
404 | person_not_found | A person who isn't in the household. |
404 | routine_not_found | A routine that isn't there. |
404 | not_found | The household doesn't exist, or you aren't a member of it. |
409 | time_in_past | A once-only time that has passed. |
409 | idempotency_key_reused | The Idempotency-Key was already used for a different command. |
Examples#
These are real. Each scenario is one of the command's test cases, run on a household when this site was built, and the response is what the API returned.
Changing the words schedules nothing
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.routine.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"routine_id": "rtn_01JC00000000000000000000R1",
"title": "Suggest something new on Wednesdays"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.routine.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
routine_id: "rtn_01JC00000000000000000000R1",
title: "Suggest something new on Wednesdays",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.routine.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"routine_id": "rtn_01JC00000000000000000000R1",
"title": "Suggest something new on Wednesdays"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R063VEEQ94SBMDZ9C9
{
"result": {
"routine_id": "rtn_01JC00000000000000000000R1",
"next_run_at": 1762956000000
},
"version": 1
}Changing when it repeats works out the next run again
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.routine.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000BBBBBBBBBBBBBBBB' \
-d '{
"routine_id": "rtn_01JC00000000000000000000R1",
"repeat": {
"kind": "daily",
"time": "17:00"
},
"app": null
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.routine.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000BBBBBBBBBBBBBBBB",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
routine_id: "rtn_01JC00000000000000000000R1",
repeat: {
kind: "daily",
time: "17:00",
},
app: null,
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.routine.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000BBBBBBBBBBBBBBBB
{
"routine_id": "rtn_01JC00000000000000000000R1",
"repeat": {
"kind": "daily",
"time": "17:00"
},
"app": null
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0MVGHYW387WZ2AB2T
{
"result": {
"routine_id": "rtn_01JC00000000000000000000R1",
"next_run_at": 1762466400000
},
"version": 1
}A paused routine stays paused when its repeat changes
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.routine.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000CCCCCCCCCCCCCCCC' \
-d '{
"routine_id": "rtn_01JC00000000000000000000R1",
"repeat": {
"kind": "daily",
"time": "17:00"
}
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.routine.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000CCCCCCCCCCCCCCCC",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
routine_id: "rtn_01JC00000000000000000000R1",
repeat: {
kind: "daily",
time: "17:00",
},
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.routine.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000CCCCCCCCCCCCCCCC
{
"routine_id": "rtn_01JC00000000000000000000R1",
"repeat": {
"kind": "daily",
"time": "17:00"
}
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0TJFCS40RN47KV7CQ
{
"result": {
"routine_id": "rtn_01JC00000000000000000000R1",
"next_run_at": null
},
"version": 1
}A new person
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.routine.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000DDDDDDDDDDDDDDDD' \
-d '{
"routine_id": "rtn_01JC00000000000000000000R1",
"for_person_id": "per_01JC000000000000000000000B"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.routine.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000DDDDDDDDDDDDDDDD",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
routine_id: "rtn_01JC00000000000000000000R1",
for_person_id: "per_01JC000000000000000000000B",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.routine.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000DDDDDDDDDDDDDDDD
{
"routine_id": "rtn_01JC00000000000000000000R1",
"for_person_id": "per_01JC000000000000000000000B"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0ZZ894PE34ZC1N325
{
"result": {
"routine_id": "rtn_01JC00000000000000000000R1",
"next_run_at": 1762956000000
},
"version": 1
}A once-only time that has passed
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.routine.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000EEEEEEEEEEEEEEEE' \
-d '{
"routine_id": "rtn_01JC00000000000000000000R1",
"repeat": {
"kind": "once",
"date": "2025-01-01",
"time": "08:00"
}
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.routine.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000EEEEEEEEEEEEEEEE",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
routine_id: "rtn_01JC00000000000000000000R1",
repeat: {
kind: "once",
date: "2025-01-01",
time: "08:00",
},
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.routine.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000EEEEEEEEEEEEEEEE
{
"routine_id": "rtn_01JC00000000000000000000R1",
"repeat": {
"kind": "once",
"date": "2025-01-01",
"time": "08:00"
}
}HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0XDHDAV52SAFJCKZ4
{
"error": {
"code": "time_in_past",
"message": "That time has already passed. No changes were applied.",
"details": {},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R0XDHDAV52SAFJCKZ4"
}
}A person who isn't in the household
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.routine.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000FFFFFFFFFFFFFFFF' \
-d '{
"routine_id": "rtn_01JC00000000000000000000R1",
"for_person_id": "per_01JC000000000000000000000Z"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.routine.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000FFFFFFFFFFFFFFFF",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
routine_id: "rtn_01JC00000000000000000000R1",
for_person_id: "per_01JC000000000000000000000Z",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.routine.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000FFFFFFFFFFFFFFFF
{
"routine_id": "rtn_01JC00000000000000000000R1",
"for_person_id": "per_01JC000000000000000000000Z"
}HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R04JRXNXQZT7Z1HFBY
{
"error": {
"code": "person_not_found",
"message": "That person isn't in the household. No changes were applied.",
"details": {
"person_id": "per_01JC000000000000000000000Z"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R04JRXNXQZT7Z1HFBY"
}
}A routine that isn't there
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.routine.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000GGGGGGGGGGGGGGGG' \
-d '{
"routine_id": "rtn_01JC00000000000000000000R1",
"title": "Nope"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.routine.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000GGGGGGGGGGGGGGGG",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
routine_id: "rtn_01JC00000000000000000000R1",
title: "Nope",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.routine.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000GGGGGGGGGGGGGGGG
{
"routine_id": "rtn_01JC00000000000000000000R1",
"title": "Nope"
}HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0V8KQ4FC4DG4T5YP5
{
"error": {
"code": "routine_not_found",
"message": "That routine isn't there any more. No changes were applied.",
"details": {
"routine_id": "rtn_01JC00000000000000000000R1"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R0V8KQ4FC4DG4T5YP5"
}
}Change when a routine runs
The next run is worked out again from now.
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/agent.routine.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CTC882J0JMTH9MM6H500' \
-d '{
"routine_id": "rtn_01M6V9CTC5VNP0HS02R6Q1BQHB",
"repeat": {
"kind": "weekly",
"days": [
"sun"
],
"time": "17:30"
}
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/agent.routine.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CTC882J0JMTH9MM6H500",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
routine_id: "rtn_01M6V9CTC5VNP0HS02R6Q1BQHB",
repeat: {
kind: "weekly",
days: [
"sun",
],
time: "17:30",
},
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/agent.routine.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CTC882J0JMTH9MM6H500
{
"routine_id": "rtn_01M6V9CTC5VNP0HS02R6Q1BQHB",
"repeat": {
"kind": "weekly",
"days": [
"sun"
],
"time": "17:30"
}
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CTC8WX7JD0FGNYT0RRM2
{
"result": {
"routine_id": "rtn_01M6V9CTC5VNP0HS02R6Q1BQHB",
"next_run_at": 1794180600000
},
"version": 315
}For Rigel#
Rigel's tool for this command is agent_routine_update. Rigel runs this on its own, then says what it did. The agent guide has the rest.