Skip to content
Rigel docs
Open Rigel

Add something to the house's records

maintenance.asset.add

POST/api/v1/households/{household_id}/commands/maintenance.asset.add

  • Command
  • Rigel runs it
  • Applies offline

Adds an item such as an appliance, system or fixture. Only a name is needed; everything else can come later from a photo or from Rigel. With no category it waits in "Not identified yet". With a model (manufacturer and/or model number) the model is found or made and the item becomes identified. Photos are attached as given. Given a model number, or a unit or label photo, Rigel starts looking the item up on its own and the item shows as researching until it finishes. Errors: unknown_category, file_not_found, different_property.

Parameters#

Add something to the house's records: 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.

Add something to the house's records: request body fields
FieldDescription
property_idstringoptional

Which property. Leave it out when the household has one property (it's made on first use); with several, give it, or the command is rejected with property_required.

namestringrequired

What the household calls it: "Basement furnace", "Upstairs toilet".

at most 120 characters
category_keystringoptional

A curated category key, such as furnace, water_heater or refrigerator, or unidentified. Rejected with unknown_category when the key isn't one. Give this or category_name, not both.

category_namestringoptional

A one-off category by its name, found if the household already has one with exactly that name and made if not. Use it only when no curated category fits. Give this or category_key, not both.

at most 120 characters
location_idstringoptional

The place it is in. Leave it out when unknown.

parent_idstringoptional

The group it belongs to, another item at the same property, such as a water softener's system.

serialstringoptional

The serial number exactly as printed on the label.

at most 120 characters
quantityintegeroptional

How many identical items this record stands for (a row of 6 recessed lights), 1 or more. Leave it out for 1.

1 to 10,000
installed_onstringoptional

When it was installed: YYYY-MM-DD, YYYY-MM or YYYY, matching installed_precision. Never invent a month or day.

pattern ^\d{4}(-(0[1-9]|1[0-2])(-(0[1-9]|[12]\d|3[01]))?)?$
installed_precisionone of: day, month, year, approximateoptional

How much of installed_on is known: day, month, year or approximate (about that year).

notesstringoptional

Anything worth knowing about it that has no field of its own.

at most 20,000 characters
modelobjectoptional

The model, when it is known from a label or a receipt. Found by exact maker, number and variant, or made.

model.manufacturerstringoptional

The maker as printed on the label, such as Carrier. Case is kept.

at most 120 characters
model.model_numberstringoptional

The complete model number exactly as printed, with every suffix and letter case. Never shorten it.

at most 120 characters
model.variantstringoptional

A variant that changes compatibility or specs, such as 120V or left-hand. Leave it out when there isn't one.

at most 120 characters
photosarray of objectsoptional

Photos to attach, such as the unit and its label.

at most 20 items
photos[].file_idstringrequired

A photo already uploaded to the household's files.

photos[].roleone of: unit, label, damage, otherrequired

What the photo shows: unit (the equipment itself), label (its brand, model or rating sticker), damage (a problem), other.

photos[].captionstringoptional

A few words about the photo.

at most 500 characters
researchbooleanoptional

false to skip looking it up, for corrections Rigel's own research makes. Leave it out otherwise.

Response#

200 The command was applied.

Add something to the house's records: response fields
FieldDescription
resultobjectrequired

What the command returned, such as the IDs it created.

result.asset_idstringrequired

The new item.

result.model_idstring or nullrequired

Its model, when one was given.

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.

Add something to the house's records: errors
StatusCodeWhen
400validation_failedA field is missing, misspelled or out of range. details.fields lists each problem.
401unauthenticatedThe request has no valid session.
404file_not_found
  • The file doesn't exist in this household.
  • A photo that isn't there.
404location_not_foundA place that isn't there.
404not_foundThe household doesn't exist, or you aren't a member of it.
409unknown_categoryA category key that isn't curated.
409different_property
  • A place at another property than the one named.
  • A group at another property.
409property_requiredSeveral properties and none named.
409photo_already_addedThe same photo twice.
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.

Only a name: the first command makes the default property and the item waits unidentified

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "name": "Basement furnace"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Basement furnace",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "name": "Basement furnace"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0YHF3AT0JXPXFGK4S

{
  "result": {
    "asset_id": "ast_01JC4N0000H4B98ZJ6CJHSCWXM",
    "model_id": null
  },
  "version": 1
}

A curated category is found by key and not made twice

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "name": "Furnace",
  "category_key": "furnace",
  "location_id": "mlc_01JC0000000000000000000001",
  "serial": "SN1",
  "quantity": 2,
  "installed_on": "2019-06",
  "installed_precision": "month",
  "notes": "Replaced the igniter"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Furnace",
    category_key: "furnace",
    location_id: "mlc_01JC0000000000000000000001",
    serial: "SN1",
    quantity: 2,
    installed_on: "2019-06",
    installed_precision: "month",
    notes: "Replaced the igniter",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "name": "Furnace",
  "category_key": "furnace",
  "location_id": "mlc_01JC0000000000000000000001",
  "serial": "SN1",
  "quantity": 2,
  "installed_on": "2019-06",
  "installed_precision": "month",
  "notes": "Replaced the igniter"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R09AX8Y2CK2ZTZHZ6Y

{
  "result": {
    "asset_id": "ast_01JC4N0000MBGE5RJ6Q7V6V6T8",
    "model_id": null
  },
  "version": 1
}

A curated category that has no row yet is made with its name

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "name": "Water heater",
  "category_key": "water_heater"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Water heater",
    category_key: "water_heater",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "name": "Water heater",
  "category_key": "water_heater"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0SGW7ZQQ5H6WJQYT9

{
  "result": {
    "asset_id": "ast_01JC4N0000VGW1STJ6TGXRB7FY",
    "model_id": null
  },
  "version": 1
}

A one-off category name is made without a key

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "name": "Koi pond pump",
  "category_name": "Pond equipment"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Koi pond pump",
    category_name: "Pond equipment",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "name": "Koi pond pump",
  "category_name": "Pond equipment"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0QRH0GP2P0V5GDHF3

{
  "result": {
    "asset_id": "ast_01JC4N0000VGW1STJ6TGXRB7FY",
    "model_id": null
  },
  "version": 1
}

A one-off category with the same name is found

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "name": "Koi pond pump",
  "category_name": "Pond equipment"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Koi pond pump",
    category_name: "Pond equipment",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "name": "Koi pond pump",
  "category_name": "Pond equipment"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R082ZB1CTE69W64FG2

{
  "result": {
    "asset_id": "ast_01JC4N0000MBGE5RJ6Q7V6V6T8",
    "model_id": null
  },
  "version": 1
}

A model makes the item identified; the model takes the category

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "name": "Furnace",
  "category_key": "furnace",
  "model": {
    "manufacturer": "Carrier",
    "model_number": "59TP6B080M1714",
    "variant": "120V"
  }
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Furnace",
    category_key: "furnace",
    model: {
      manufacturer: "Carrier",
      model_number: "59TP6B080M1714",
      variant: "120V",
    },
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "name": "Furnace",
  "category_key": "furnace",
  "model": {
    "manufacturer": "Carrier",
    "model_number": "59TP6B080M1714",
    "variant": "120V"
  }
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R03E5N5F7TQDQRJMKA

{
  "result": {
    "asset_id": "ast_01JC4N0000VGW1STJ6TGXRB7FY",
    "model_id": "eqm_01JC4N0000MBGE5RJ6Q7V6V6T8"
  },
  "version": 1
}

A model with no category leaves the model's category empty

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "name": "Mystery box",
  "model": {
    "model_number": "X-100"
  }
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Mystery box",
    model: {
      model_number: "X-100",
    },
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "name": "Mystery box",
  "model": {
    "model_number": "X-100"
  }
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0BFPTY1YYBFA97086

{
  "result": {
    "asset_id": "ast_01JC4N0000VGW1STJ6TGXRB7FY",
    "model_id": "eqm_01JC4N0000MBGE5RJ6Q7V6V6T8"
  },
  "version": 1
}

The same model identity is found, not made again (case and suffix count)

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "name": "Furnace",
  "category_key": "furnace",
  "model": {
    "manufacturer": "Carrier",
    "model_number": "59tp6b080m1714"
  }
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Furnace",
    category_key: "furnace",
    model: {
      manufacturer: "Carrier",
      model_number: "59tp6b080m1714",
    },
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "name": "Furnace",
  "category_key": "furnace",
  "model": {
    "manufacturer": "Carrier",
    "model_number": "59tp6b080m1714"
  }
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0EEYQ9G2S0J0F0CKH

{
  "result": {
    "asset_id": "ast_01JC4N0000MBGE5RJ6Q7V6V6T8",
    "model_id": "eqm_01JC0000000000000000000002"
  },
  "version": 1
}

A variant is part of the identity: null equals only null

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "name": "Furnace",
  "category_key": "furnace",
  "model": {
    "manufacturer": "Carrier",
    "model_number": "59TP"
  }
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Furnace",
    category_key: "furnace",
    model: {
      manufacturer: "Carrier",
      model_number: "59TP",
    },
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "name": "Furnace",
  "category_key": "furnace",
  "model": {
    "manufacturer": "Carrier",
    "model_number": "59TP"
  }
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0ZYJNED7S69PNYAZ1

{
  "result": {
    "asset_id": "ast_01JC4N0000VGW1STJ6TGXRB7FY",
    "model_id": "eqm_01JC4N0000MBGE5RJ6Q7V6V6T8"
  },
  "version": 1
}

Photos are attached

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "name": "Furnace",
  "photos": [
    {
      "file_id": "fil_01JC0000000000000000000001",
      "role": "unit"
    },
    {
      "file_id": "fil_01JC0000000000000000000002",
      "role": "label",
      "caption": "Rating plate"
    }
  ]
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Furnace",
    photos: [
      {
        file_id: "fil_01JC0000000000000000000001",
        role: "unit",
      },
      {
        file_id: "fil_01JC0000000000000000000002",
        role: "label",
        caption: "Rating plate",
      },
    ],
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "name": "Furnace",
  "photos": [
    {
      "file_id": "fil_01JC0000000000000000000001",
      "role": "unit"
    },
    {
      "file_id": "fil_01JC0000000000000000000002",
      "role": "label",
      "caption": "Rating plate"
    }
  ]
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0FB8T1TN8M2VAF0WY

{
  "result": {
    "asset_id": "ast_01JC4N0000MBGE5RJ6Q7V6V6T8",
    "model_id": null
  },
  "version": 1
}

Inside a group at the same property

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "name": "Softener",
  "parent_id": "ast_01JC0000000000000000000001"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Softener",
    parent_id: "ast_01JC0000000000000000000001",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "name": "Softener",
  "parent_id": "ast_01JC0000000000000000000001"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0SCHZD9205PZE6NQS

{
  "result": {
    "asset_id": "ast_01JC4N0000MBGE5RJ6Q7V6V6T8",
    "model_id": null
  },
  "version": 1
}

The place decides the property

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "name": "Stove",
  "location_id": "mlc_01JC0000000000000000000002"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Stove",
    location_id: "mlc_01JC0000000000000000000002",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "name": "Stove",
  "location_id": "mlc_01JC0000000000000000000002"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0X61E49XW877X2DWZ

{
  "result": {
    "asset_id": "ast_01JC4N0000MBGE5RJ6Q7V6V6T8",
    "model_id": null
  },
  "version": 1
}

Research: false adds a model without looking it up

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "name": "Furnace",
  "category_key": "furnace",
  "model": {
    "manufacturer": "Carrier",
    "model_number": "59TP6B080M1714",
    "variant": "120V"
  },
  "research": false
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Furnace",
    category_key: "furnace",
    model: {
      manufacturer: "Carrier",
      model_number: "59TP6B080M1714",
      variant: "120V",
    },
    research: false,
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "name": "Furnace",
  "category_key": "furnace",
  "model": {
    "manufacturer": "Carrier",
    "model_number": "59TP6B080M1714",
    "variant": "120V"
  },
  "research": false
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R06MS51JTCC4WCW45K

{
  "result": {
    "asset_id": "ast_01JC4N0000VGW1STJ6TGXRB7FY",
    "model_id": "eqm_01JC4N0000MBGE5RJ6Q7V6V6T8"
  },
  "version": 1
}

Several properties and none named

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "name": "Furnace"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Furnace",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "name": "Furnace"
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0FPXVHQ7291TQHAWC

{
  "error": {
    "code": "property_required",
    "message": "This household has more than one property. Say which one. No changes were applied.",
    "details": {},
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0FPXVHQ7291TQHAWC"
  }
}

A place at another property than the one named

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "name": "Stove",
  "property_id": "prp_01JC0000000000000000000001",
  "location_id": "mlc_01JC0000000000000000000002"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Stove",
    property_id: "prp_01JC0000000000000000000001",
    location_id: "mlc_01JC0000000000000000000002",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "name": "Stove",
  "property_id": "prp_01JC0000000000000000000001",
  "location_id": "mlc_01JC0000000000000000000002"
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0E2STF1HE1FRS8CS8

{
  "error": {
    "code": "different_property",
    "message": "That place is at a different property. No changes were applied.",
    "details": {
      "property_id": "prp_01JC0000000000000000000002"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0E2STF1HE1FRS8CS8"
  }
}

A group at another property

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "name": "Softener",
  "property_id": "prp_01JC0000000000000000000001",
  "parent_id": "ast_01JC0000000000000000000001"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Softener",
    property_id: "prp_01JC0000000000000000000001",
    parent_id: "ast_01JC0000000000000000000001",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "name": "Softener",
  "property_id": "prp_01JC0000000000000000000001",
  "parent_id": "ast_01JC0000000000000000000001"
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0DRKVPH33DXPJN4PF

{
  "error": {
    "code": "different_property",
    "message": "That group is at a different property. No changes were applied.",
    "details": {
      "property_id": "prp_01JC0000000000000000000002"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0DRKVPH33DXPJN4PF"
  }
}

A category key that isn't curated

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "name": "Thing",
  "category_key": "spaceship"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Thing",
    category_key: "spaceship",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "name": "Thing",
  "category_key": "spaceship"
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0REEEGNM0BBPW41FW

{
  "error": {
    "code": "unknown_category",
    "message": "\"spaceship\" isn't a category Rigel knows. Pick a curated key or use category_name. No changes were applied.",
    "details": {
      "category_key": "spaceship"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0REEEGNM0BBPW41FW"
  }
}

A photo that isn't there

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "name": "Thing",
  "photos": [
    {
      "file_id": "fil_01JC0000000000000000000001",
      "role": "unit"
    }
  ]
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Thing",
    photos: [
      {
        file_id: "fil_01JC0000000000000000000001",
        role: "unit",
      },
    ],
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "name": "Thing",
  "photos": [
    {
      "file_id": "fil_01JC0000000000000000000001",
      "role": "unit"
    }
  ]
}
Response, 404
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R03YA65AWPS37A1BZJ

{
  "error": {
    "code": "file_not_found",
    "message": "That file isn't there any more. No changes were applied.",
    "details": {
      "file_id": "fil_01JC0000000000000000000001"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R03YA65AWPS37A1BZJ"
  }
}

The same photo twice

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "name": "Thing",
  "photos": [
    {
      "file_id": "fil_01JC0000000000000000000001",
      "role": "unit"
    },
    {
      "file_id": "fil_01JC0000000000000000000001",
      "role": "label"
    }
  ]
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Thing",
    photos: [
      {
        file_id: "fil_01JC0000000000000000000001",
        role: "unit",
      },
      {
        file_id: "fil_01JC0000000000000000000001",
        role: "label",
      },
    ],
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "name": "Thing",
  "photos": [
    {
      "file_id": "fil_01JC0000000000000000000001",
      "role": "unit"
    },
    {
      "file_id": "fil_01JC0000000000000000000001",
      "role": "label"
    }
  ]
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0TM0D6FCBDQP44Z4T

{
  "error": {
    "code": "photo_already_added",
    "message": "The same photo is listed twice. No changes were applied.",
    "details": {
      "file_id": "fil_01JC0000000000000000000001"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0TM0D6FCBDQP44Z4T"
  }
}

A place that isn't there

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "name": "Thing",
  "location_id": "mlc_01JC0000000000000000000009"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Thing",
    location_id: "mlc_01JC0000000000000000000009",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "name": "Thing",
  "location_id": "mlc_01JC0000000000000000000009"
}
Response, 404
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0WNCDRZJXFH6SVD41

{
  "error": {
    "code": "location_not_found",
    "message": "That place isn't there any more. No changes were applied.",
    "details": {
      "location_id": "mlc_01JC0000000000000000000009"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0WNCDRZJXFH6SVD41"
  }
}

Add an item with its model

A model number starts Rigel looking the item up, and the item shows as researching until that finishes.

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CSVC9BBXQHVH8AV36ZWK' \
  -d '{
  "name": "Basement furnace",
  "category_key": "furnace",
  "location_id": "mlc_01M6V9CSTZEJ4XTJHRBQ1HGD2J",
  "serial": "4116A04418",
  "installed_on": "2016",
  "installed_precision": "year",
  "model": {
    "manufacturer": "Hearthline",
    "model_number": "FX96-080-1625"
  }
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CSVC9BBXQHVH8AV36ZWK",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Basement furnace",
    category_key: "furnace",
    location_id: "mlc_01M6V9CSTZEJ4XTJHRBQ1HGD2J",
    serial: "4116A04418",
    installed_on: "2016",
    installed_precision: "year",
    model: {
      manufacturer: "Hearthline",
      model_number: "FX96-080-1625",
    },
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSVC9BBXQHVH8AV36ZWK

{
  "name": "Basement furnace",
  "category_key": "furnace",
  "location_id": "mlc_01M6V9CSTZEJ4XTJHRBQ1HGD2J",
  "serial": "4116A04418",
  "installed_on": "2016",
  "installed_precision": "year",
  "model": {
    "manufacturer": "Hearthline",
    "model_number": "FX96-080-1625"
  }
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSVCJH7SGDGB8ZCNHFFP

{
  "result": {
    "asset_id": "ast_01M6V9CSVCMZFAP6ZN5WANZ6M8",
    "model_id": "eqm_01M6V9CSVCHRA5SDZNT6181WQM"
  },
  "version": 174
}

Add an item without looking it up

research: false skips the online lookup, for an item that will be filled in by hand.

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CSVG9AYPERPKE561HX8M' \
  -d '{
  "name": "Water heater",
  "category_key": "water_heater",
  "location_id": "mlc_01M6V9CSTX3QNP5B6R3SMP5B2B",
  "installed_on": "2019-06",
  "installed_precision": "month",
  "model": {
    "manufacturer": "Tidewell",
    "model_number": "WH50-NG-40"
  },
  "research": false
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CSVG9AYPERPKE561HX8M",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Water heater",
    category_key: "water_heater",
    location_id: "mlc_01M6V9CSTX3QNP5B6R3SMP5B2B",
    installed_on: "2019-06",
    installed_precision: "month",
    model: {
      manufacturer: "Tidewell",
      model_number: "WH50-NG-40",
    },
    research: false,
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSVG9AYPERPKE561HX8M

{
  "name": "Water heater",
  "category_key": "water_heater",
  "location_id": "mlc_01M6V9CSTX3QNP5B6R3SMP5B2B",
  "installed_on": "2019-06",
  "installed_precision": "month",
  "model": {
    "manufacturer": "Tidewell",
    "model_number": "WH50-NG-40"
  },
  "research": false
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSVGK0W3DNZAM1CCDN88

{
  "result": {
    "asset_id": "ast_01M6V9CSVGS9W2A8K5MDGN7GGD",
    "model_id": "eqm_01M6V9CSVGWCW4G0K5ZADZNTTE"
  },
  "version": 176
}

Add an appliance

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CSVHAZW0HKKPA62Y599K' \
  -d '{
  "name": "Dishwasher",
  "category_key": "dishwasher",
  "location_id": "mlc_01M6V9CSV0Z1XFB5VWFWXV2SQY",
  "installed_on": "2022-03",
  "installed_precision": "month",
  "model": {
    "manufacturer": "Hartwell",
    "model_number": "HDW-3200"
  },
  "research": false
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CSVHAZW0HKKPA62Y599K",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Dishwasher",
    category_key: "dishwasher",
    location_id: "mlc_01M6V9CSV0Z1XFB5VWFWXV2SQY",
    installed_on: "2022-03",
    installed_precision: "month",
    model: {
      manufacturer: "Hartwell",
      model_number: "HDW-3200",
    },
    research: false,
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSVHAZW0HKKPA62Y599K

{
  "name": "Dishwasher",
  "category_key": "dishwasher",
  "location_id": "mlc_01M6V9CSV0Z1XFB5VWFWXV2SQY",
  "installed_on": "2022-03",
  "installed_precision": "month",
  "model": {
    "manufacturer": "Hartwell",
    "model_number": "HDW-3200"
  },
  "research": false
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSVHDENJRSDEYQ13KZ57

{
  "result": {
    "asset_id": "ast_01M6V9CSVH77630WV0WA1X2DAK",
    "model_id": "eqm_01M6V9CSVHEN2DHYV0V3SEKX3H"
  },
  "version": 177
}

Add an item with a note

Without a model, it waits to be identified.

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CSVKMBJ4W6F8M3KESAP7' \
  -d '{
  "name": "Dryer",
  "category_key": "dryer",
  "location_id": "mlc_01M6V9CSV1BGK3V8FK4RRCEZYS",
  "notes": "The vent runs about 14 feet to the outside wall.",
  "research": false
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CSVKMBJ4W6F8M3KESAP7",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Dryer",
    category_key: "dryer",
    location_id: "mlc_01M6V9CSV1BGK3V8FK4RRCEZYS",
    notes: "The vent runs about 14 feet to the outside wall.",
    research: false,
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSVKMBJ4W6F8M3KESAP7

{
  "name": "Dryer",
  "category_key": "dryer",
  "location_id": "mlc_01M6V9CSV1BGK3V8FK4RRCEZYS",
  "notes": "The vent runs about 14 feet to the outside wall.",
  "research": false
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSVKMMWR45ME6Y58D354

{
  "result": {
    "asset_id": "ast_01M6V9CSVKPYARY331YY06WH85",
    "model_id": null
  },
  "version": 178
}

Add several of the same thing

quantity counts identical items kept as one record.

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CSVN21X4J7AER6RNVT6T' \
  -d '{
  "name": "Smoke alarms",
  "category_key": "smoke_alarm",
  "quantity": 5,
  "notes": "One in each bedroom, one in the upstairs hall, one in the basement.",
  "research": false
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CSVN21X4J7AER6RNVT6T",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Smoke alarms",
    category_key: "smoke_alarm",
    quantity: 5,
    notes: "One in each bedroom, one in the upstairs hall, one in the basement.",
    research: false,
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSVN21X4J7AER6RNVT6T

{
  "name": "Smoke alarms",
  "category_key": "smoke_alarm",
  "quantity": 5,
  "notes": "One in each bedroom, one in the upstairs hall, one in the basement.",
  "research": false
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSVNDW70EWCWVN8NCQQA

{
  "result": {
    "asset_id": "ast_01M6V9CSVNY4PN710B9NWNSNVT",
    "model_id": null
  },
  "version": 179
}

Add an item with a name and a place

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.asset.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CSVP1CX2F34B6CQXE7H6' \
  -d '{
  "name": "Washing machine",
  "category_key": "washer",
  "location_id": "mlc_01M6V9CSV1BGK3V8FK4RRCEZYS",
  "research": false
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.asset.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CSVP1CX2F34B6CQXE7H6",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Washing machine",
    category_key: "washer",
    location_id: "mlc_01M6V9CSV1BGK3V8FK4RRCEZYS",
    research: false,
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.asset.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSVP1CX2F34B6CQXE7H6

{
  "name": "Washing machine",
  "category_key": "washer",
  "location_id": "mlc_01M6V9CSV1BGK3V8FK4RRCEZYS",
  "research": false
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSVP86E0WX6DQ73804YT

{
  "result": {
    "asset_id": "ast_01M6V9CSVPKQEST2JSGBYP0KJQ",
    "model_id": null
  },
  "version": 180
}

For Rigel#

Rigel's tool for this command is maintenance_asset_add. 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