Skip to content
Rigel docs
Open Rigel

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#

Change a problem, or watch it or reopen it: parameters
FieldDescription
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.

Change a problem, or watch it or reopen it: request body fields
FieldDescription
issue_idstringrequired

A issue ID, such as iss_01JC0000000000000000000000.

titlestringoptional

A short title, up to 200 characters.

at most 200 characters
notesstring or nulloptional

What was seen or heard, and anything tried.

at most 20,000 characters
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 maintenance.issue.resolve to resolve.

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.

Change a problem, or watch it or reopen it: response fields
FieldDescription
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.

Change a problem, or watch it or reopen it: errors
StatusCodeWhen
400validation_failedA field is missing, misspelled or out of range. details.fields lists each problem.
401unauthenticatedThe request has no valid session.
404issue_not_foundA problem that isn't there.
404not_foundThe household doesn't exist, or you aren't a member of it.
409one_subjectAn asset and a place together are rejected.
409different_propertyAn item at another property.
409idempotency_key_reusedThe 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

Request, curl
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"
}'
Request, TypeScript
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();
Request, HTTP
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"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0STYF9NVB58KMQBH0

{
  "result": {},
  "version": 1
}

Watching a symptom

Request, curl
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"
}'
Request, TypeScript
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();
Request, HTTP
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"
}
Response, 200
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

Request, curl
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"
}'
Request, TypeScript
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();
Request, HTTP
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"
}
Response, 200
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

Request, curl
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"
}'
Request, TypeScript
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();
Request, HTTP
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"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0P3NKYKYPZZCDRMXT

{
  "result": {},
  "version": 1
}

Null clears the notes

Request, curl
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
}'
Request, TypeScript
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();
Request, HTTP
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
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R08D7T2TSBE0DQ1DX0

{
  "result": {},
  "version": 1
}

Moving to a place clears the item

Request, curl
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"
}'
Request, TypeScript
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();
Request, HTTP
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"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R077TGC07EH2MP7VAP

{
  "result": {},
  "version": 1
}

Moving to a project

Request, curl
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"
}'
Request, TypeScript
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();
Request, HTTP
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"
}
Response, 200
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

Request, curl
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"
}'
Request, TypeScript
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();
Request, HTTP
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"
}
Response, 409
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

Request, curl
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"
}'
Request, TypeScript
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();
Request, HTTP
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"
}
Response, 409
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

Request, curl
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"
}'
Request, TypeScript
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();
Request, HTTP
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"
}
Response, 404
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.

Request, curl
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."
}'
Request, TypeScript
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();
Request, HTTP
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."
}
Response, 200
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.

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