Change a problem, or watch it or reopen it
maintenance.issue.update
POST/api/v1/households/{household_id}/commands/maintenance.issue.update
- Command
- Rigel runs it
- Applies offline
Sets only the fields given; null clears an optional one. status may be open or monitoring (watching a symptom); setting either on a resolved problem reopens it and clears its resolved date and resolution. To mark it fixed use maintenance.issue.resolve. Giving an asset_id replaces the place and the other way round; fails with one_subject if both are given non-null.
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 |
|---|---|
issue_idstringrequired | A issue ID, such as iss_01JC0000000000000000000000. |
titlestringoptional | A short title, up to 200 characters. |
notesstring or nulloptional | What was seen or heard, and anything tried. |
severityone of: low, medium, high, urgentoptional | How bad it is: low (cosmetic or minor), medium (needs fixing), high (getting worse or costly), urgent (safety, water or no heat). |
statusone of: open, monitoringoptional | open (needs work) or monitoring (watching a symptom). Use |
opened_onstring (date)optional | A calendar date, YYYY-MM-DD. |
asset_idstring or nulloptional | The item it is about; null clears it. |
location_idstring or nulloptional | The place it is in; null clears it. |
photo_file_idstring or nulloptional | A photo of the problem; null clears it. |
project_idstring or nulloptional | The project it is part of; null clears it. |
Response#
200 The command was applied.
| Field | Description |
|---|---|
resultobjectrequired | What the command returned, such as the IDs it created. |
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 | issue_not_found | A problem that isn't there. |
404 | not_found | The household doesn't exist, or you aren't a member of it. |
409 | one_subject | An asset and a place together are rejected. |
409 | different_property | An item at another property. |
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.
Changes only what's given
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"issue_id": "iss_01JC00000000000000000000Q1",
"title": "Bigger leak",
"severity": "high",
"notes": "Now dripping"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
issue_id: "iss_01JC00000000000000000000Q1",
title: "Bigger leak",
severity: "high",
notes: "Now dripping",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"issue_id": "iss_01JC00000000000000000000Q1",
"title": "Bigger leak",
"severity": "high",
"notes": "Now dripping"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0STYF9NVB58KMQBH0
{
"result": {},
"version": 1
}Watching a symptom
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"issue_id": "iss_01JC00000000000000000000Q1",
"status": "monitoring"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
issue_id: "iss_01JC00000000000000000000Q1",
status: "monitoring",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"issue_id": "iss_01JC00000000000000000000Q1",
"status": "monitoring"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0YGRSQSKTHGDWTW51
{
"result": {},
"version": 1
}Reopening a resolved problem clears how it was resolved
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"issue_id": "iss_01JC00000000000000000000Q1",
"status": "open"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
issue_id: "iss_01JC00000000000000000000Q1",
status: "open",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"issue_id": "iss_01JC00000000000000000000Q1",
"status": "open"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0ZHTS6RDKCTFCZSVP
{
"result": {},
"version": 1
}Editing a resolved problem without a status leaves it resolved
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"issue_id": "iss_01JC00000000000000000000Q1",
"notes": "Fixed by Sam"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
issue_id: "iss_01JC00000000000000000000Q1",
notes: "Fixed by Sam",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"issue_id": "iss_01JC00000000000000000000Q1",
"notes": "Fixed by Sam"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0P3NKYKYPZZCDRMXT
{
"result": {},
"version": 1
}Null clears the notes
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"issue_id": "iss_01JC00000000000000000000Q1",
"notes": null
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
issue_id: "iss_01JC00000000000000000000Q1",
notes: null,
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"issue_id": "iss_01JC00000000000000000000Q1",
"notes": null
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R08D7T2TSBE0DQ1DX0
{
"result": {},
"version": 1
}Moving to a place clears the item
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"issue_id": "iss_01JC00000000000000000000Q1",
"location_id": "mlc_01JC00000000000000000000M1"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
issue_id: "iss_01JC00000000000000000000Q1",
location_id: "mlc_01JC00000000000000000000M1",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"issue_id": "iss_01JC00000000000000000000Q1",
"location_id": "mlc_01JC00000000000000000000M1"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R077TGC07EH2MP7VAP
{
"result": {},
"version": 1
}Moving to a project
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"issue_id": "iss_01JC00000000000000000000Q1",
"project_id": "mpj_01JC00000000000000000000J1"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
issue_id: "iss_01JC00000000000000000000Q1",
project_id: "mpj_01JC00000000000000000000J1",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"issue_id": "iss_01JC00000000000000000000Q1",
"project_id": "mpj_01JC00000000000000000000J1"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R06KPD0RQN77G1VCPW
{
"result": {},
"version": 1
}An asset and a place together are rejected
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"issue_id": "iss_01JC00000000000000000000Q1",
"asset_id": "ast_01JC00000000000000000000A1",
"location_id": "mlc_01JC00000000000000000000M1"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
issue_id: "iss_01JC00000000000000000000Q1",
asset_id: "ast_01JC00000000000000000000A1",
location_id: "mlc_01JC00000000000000000000M1",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"issue_id": "iss_01JC00000000000000000000Q1",
"asset_id": "ast_01JC00000000000000000000A1",
"location_id": "mlc_01JC00000000000000000000M1"
}HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0EF61D9BE0FXBD07D
{
"error": {
"code": "one_subject",
"message": "Give an asset or a place, not both. No changes were applied.",
"details": {},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R0EF61D9BE0FXBD07D"
}
}An item at another property
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"issue_id": "iss_01JC00000000000000000000Q1",
"asset_id": "ast_01JC00000000000000000000A2"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
issue_id: "iss_01JC00000000000000000000Q1",
asset_id: "ast_01JC00000000000000000000A2",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"issue_id": "iss_01JC00000000000000000000Q1",
"asset_id": "ast_01JC00000000000000000000A2"
}HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R04TF6KG0AW0Z450M2
{
"error": {
"code": "different_property",
"message": "That item is at a different property. No changes were applied.",
"details": {
"property_id": "prp_01JC00000000000000000000P2"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R04TF6KG0AW0Z450M2"
}
}A problem that isn't there
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"issue_id": "iss_01JC00000000000000000000QX",
"title": "x"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
issue_id: "iss_01JC00000000000000000000QX",
title: "x",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.issue.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"issue_id": "iss_01JC00000000000000000000QX",
"title": "x"
}HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0K1943ATNX8WXMD3P
{
"error": {
"code": "issue_not_found",
"message": "That problem isn't recorded any more. No changes were applied.",
"details": {
"issue_id": "iss_01JC00000000000000000000QX"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R0K1943ATNX8WXMD3P"
}
}Keep an eye on a problem
monitoring means watching a symptom.
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.issue.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CSYHKTQFEJC3C8V99HCY' \
-d '{
"issue_id": "iss_01M6V9CSYG0VSKKZ391H7TTWHX",
"status": "monitoring",
"notes": "Watching it. The lint trap is clean and the hood flap opens fully."
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.issue.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CSYHKTQFEJC3C8V99HCY",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
issue_id: "iss_01M6V9CSYG0VSKKZ391H7TTWHX",
status: "monitoring",
notes: "Watching it. The lint trap is clean and the hood flap opens fully.",
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.issue.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSYHKTQFEJC3C8V99HCY
{
"issue_id": "iss_01M6V9CSYG0VSKKZ391H7TTWHX",
"status": "monitoring",
"notes": "Watching it. The lint trap is clean and the hood flap opens fully."
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSYHP69ZSPWX9K2VTDTF
{
"result": {},
"version": 214
}For Rigel#
Rigel's tool for this command is maintenance_issue_update. Rigel runs this on its own, then says what it did. The agent guide has the rest.