Open Tasks-app tasks for what's coming due
maintenance.task.open_due
POST/api/v1/households/{household_id}/commands/maintenance.task.open_due
- Command
- Rigel runs it
- Applies offline
Opens a task in the Tasks app for every active, non-optional maintenance task that is overdue or due within 14 days (or whose seasonal window is open or about to open). Safe to run again: a task never gets a second open occurrence. The agent's daily check runs it.
Parameters#
| Field | Description |
|---|---|
household_idpathstringrequired | The household's ID. |
Idempotency-Keyheaderstringoptional | The command's ID. Reuse it when retrying the same command. |
Request body#
The body is an empty JSON object, {}.
Response#
200 The command was applied.
| Field | Description |
|---|---|
resultobjectrequired | What the command returned, such as the IDs it created. |
result.task_idsarray of stringsrequired | The tasks that are due and have an occurrence open. |
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 | not_found | The household doesn't exist, or you aren't a member of it. |
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.
Reports the tasks that are overdue or due within 14 days, or in an open window, and changes no records
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.task.open_due' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAA37' \
-d '{}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.task.open_due", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAA37",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.task.open_due HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAA37
{}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0EENR1RQ0NFAT68BX
{
"result": {
"task_ids": [
"mtk_01JC0000000000000000000001",
"mtk_01JC0000000000000000000002",
"mtk_01JC0000000000000000000007"
]
},
"version": 1
}With nothing due, reports nothing
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.task.open_due' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAA38' \
-d '{}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.task.open_due", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAA38",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.task.open_due HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAA38
{}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0655NC4FT6CSKV8ND
{
"result": {
"task_ids": []
},
"version": 1
}Open tasks for what's coming due
Adds a task in Tasks for each rule that is overdue or due within 14 days. Running it again adds nothing new.
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.task.open_due' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CSXPA89EHFMNYF6RDJSV' \
-d '{}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.task.open_due", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CSXPA89EHFMNYF6RDJSV",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.task.open_due HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSXPA89EHFMNYF6RDJSV
{}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSXQWBMW1MRX9BW8JFMK
{
"result": {
"task_ids": [
"mtk_01M6V9CSWM1GKX8MAYQFYBAM3S",
"mtk_01M6V9CSWSHKH0MYE1RMRRDC58",
"mtk_01M6V9CSWXXCGQMAC702FF72JQ",
"mtk_01M6V9CSX1RN5MWBHS4SJAK8F3",
"mtk_01M6V9CSX5S6WYB5HV2YGMA0FD",
"mtk_01M6V9CSXBS5X8WTT5WMDY9GYD"
]
},
"version": 204
}For Rigel#
Rigel's tool for this command is maintenance_task_open_due. Rigel runs this on its own, then says what it did. The agent guide has the rest.