Skip to content
Rigel docs
Open Rigel

Record a part or consumable

maintenance.part.add

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

  • Command
  • Rigel runs it
  • Applies offline

Records a replacement part or consumable, such as a furnace filter. When manufacturer and part_number are both given and the household already has that part, it is reused unchanged, except that a product is filled in when it had none (use maintenance.part.update to change it); otherwise a new part is made. fits says which models or items it fits; a fit that already exists is left as it is. Give a product when the household keeps spares or buys it again. Errors: product_not_found.

Parameters#

Record a part or consumable: 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.

Record a part or consumable: request body fields
FieldDescription
namestringrequired

What it is, as the package says: "Furnace filter 16x25x1 MERV 11".

at most 200 characters
manufacturerstringoptional

The maker of the part.

at most 120 characters
part_numberstringoptional

The part number exactly as printed, with every suffix and letter case.

at most 120 characters
descriptionstringoptional

Size, how many the equipment takes, and anything else that matters when buying it.

at most 20,000 characters
is_oembooleanoptional

True when the equipment's maker makes or specifies it, false for a compatible part. Leave it out when unknown.

purchase_urlstring (uri)optional

One place to buy it. A link doesn't prove it fits.

at most 2,000 characters
product_idstringoptional

The inventory product this part is, when the household keeps spares or buys it again: the filters on the shelf are inventory items of that product.

product_namestringoptional

Instead of product_id, the product in the household's words, such as "Furnace filter 16x25x1". An existing product with that name (ignoring case) is used, or a new one is made.

1 to 120 characters
fitsarray of objectsoptional

What the part fits.

at most 50 items
fits[].model_idstringoptional

The model it fits, so every item of that model shares it.

fits[].asset_idstringoptional

The one item it fits.

fits[].evidenceobjectoptional

Where it was found that the part fits: the manual, a page, a person.

fits[].evidence.file_idstringoptional

A photo, manual or invoice already uploaded to the household's files.

fits[].evidence.urlstring (uri)optional

A web address.

at most 2,000 characters
fits[].evidence.said_by_person_idstringoptional

Who said it, when the source is something a person said.

fits[].evidence.locatorstringoptional

Where in the source: "p. 14", "rating plate".

at most 200 characters
fits[].evidence.excerptstringoptional

The exact text the value was read from.

at most 2,000 characters

Response#

200 The command was applied.

Record a part or consumable: response fields
FieldDescription
resultobjectrequired

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

result.part_idstringrequired

The part, new or already recorded.

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.

Record a part or consumable: errors
StatusCodeWhen
400validation_failedA field is missing, misspelled or out of range. details.fields lists each problem.
401unauthenticatedThe request has no valid session.
404product_not_found
  • The product doesn't exist in this household.
  • A product that isn't there.
404model_not_foundA model that isn't there.
404asset_not_foundAn item that isn't there.
404not_foundThe household doesn't exist, or you aren't a member of it.
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.

Records a part

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.part.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "name": "Filter 16x25x1",
  "manufacturer": "Filtrete",
  "part_number": "1900-4",
  "description": "One per change",
  "is_oem": false,
  "purchase_url": "https://example.com/filter"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.part.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Filter 16x25x1",
    manufacturer: "Filtrete",
    part_number: "1900-4",
    description: "One per change",
    is_oem: false,
    purchase_url: "https://example.com/filter",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.part.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "name": "Filter 16x25x1",
  "manufacturer": "Filtrete",
  "part_number": "1900-4",
  "description": "One per change",
  "is_oem": false,
  "purchase_url": "https://example.com/filter"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R06VB2WJ9RCAGWP1GE

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

Is_oem true is stored as 1 and unknown as null

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

{
  "name": "Igniter",
  "is_oem": true
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0XP82NAY4RYRCZ82C

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

Fits a model and an item, with evidence on one

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

{
  "name": "Filter",
  "fits": [
    {
      "model_id": "eqm_01JC0000000000000000000001",
      "evidence": {
        "locator": "manual p. 12"
      }
    },
    {
      "asset_id": "ast_01JC0000000000000000000001"
    }
  ]
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0P4M88SYEFYGFXTBK

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

The same manufacturer and part number is the same part, left as it is

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

{
  "name": "Renamed",
  "manufacturer": "Filtrete",
  "part_number": "1900-4",
  "fits": [
    {
      "model_id": "eqm_01JC0000000000000000000001"
    }
  ]
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0Q6GBAYD49K12PN8P

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

A fit that already exists is left alone

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

{
  "name": "Filter",
  "manufacturer": "Filtrete",
  "part_number": "1900-4",
  "fits": [
    {
      "model_id": "eqm_01JC0000000000000000000001"
    }
  ]
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0N7BVJHRVEG6HFN94

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

A part number alone doesn't identify a part

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

{
  "name": "Other filter",
  "part_number": "1900-4"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0TD7KRB9VBN6J7WHW

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

The case of a part number counts

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

{
  "name": "Other filter",
  "manufacturer": "Filtrete",
  "part_number": "AB-1"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0H0HW1Q6708YXY457

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

Names a product in the household's words, made when it's new

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

{
  "name": "Filter 16x25x1 MERV 11",
  "product_name": "Furnace filter 16x25x1"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0753KVPX5RZMKGS3W

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

A product named like one the household has is that product, ignoring case

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

{
  "name": "Filter 16x25x1",
  "product_name": "Furnace Filter 16x25x1"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R06CGVT5RVP69WXC3Z

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

A part the household has gets the product when it had none

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

{
  "name": "Filter 16x25x1",
  "manufacturer": "Filtrete",
  "part_number": "1900-4",
  "product_id": "prd_01JC0000000000000000000001"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0QA01Q43FY5FM2HE9

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

A part the household has keeps the product it has

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

{
  "name": "Filter",
  "manufacturer": "Filtrete",
  "part_number": "1900-4",
  "product_id": "prd_01JC0000000000000000000002"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0QHTGJ47Z03EDBTJP

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

A model that isn't there

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

{
  "name": "Filter",
  "fits": [
    {
      "model_id": "eqm_01JC0000000000000000000001"
    }
  ]
}
Response, 404
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0RR9BFSPZ7067Z2DM

{
  "error": {
    "code": "model_not_found",
    "message": "That model isn't recorded any more. No changes were applied.",
    "details": {
      "model_id": "eqm_01JC0000000000000000000001"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0RR9BFSPZ7067Z2DM"
  }
}

An item that isn't there

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

{
  "name": "Filter",
  "fits": [
    {
      "asset_id": "ast_01JC0000000000000000000001"
    }
  ]
}
Response, 404
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0DV4G698WXNNK07NS

{
  "error": {
    "code": "asset_not_found",
    "message": "That item isn't in the house records any more. No changes were applied.",
    "details": {
      "asset_id": "ast_01JC0000000000000000000001"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0DV4G698WXNNK07NS"
  }
}

A product that isn't there

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

{
  "name": "Filter 16x25x1",
  "product_id": "prd_01JC0000000000000000000001"
}
Response, 404
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R05D958TBZ8Z1ERJRA

{
  "error": {
    "code": "product_not_found",
    "message": "That product isn't there any more. No changes were applied.",
    "details": {
      "product_id": "prd_01JC0000000000000000000001"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R05D958TBZ8Z1ERJRA"
  }
}

Record a part that fits an item

product_name ties it to a product in Inventory, so the shelf and the shopping list can answer for it.

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.part.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CSWCA3JQWGVR7BMSFPEK' \
  -d '{
  "name": "Furnace filter 16x25x1 MERV 11",
  "manufacturer": "Aerofresh",
  "part_number": "AF-1625-M11",
  "description": "The furnace takes one. They come in packs of four.",
  "is_oem": false,
  "product_name": "Furnace filter 16x25x1",
  "fits": [
    {
      "asset_id": "ast_01M6V9CSVCMZFAP6ZN5WANZ6M8"
    }
  ]
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.part.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CSWCA3JQWGVR7BMSFPEK",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    name: "Furnace filter 16x25x1 MERV 11",
    manufacturer: "Aerofresh",
    part_number: "AF-1625-M11",
    description: "The furnace takes one. They come in packs of four.",
    is_oem: false,
    product_name: "Furnace filter 16x25x1",
    fits: [
      {
        asset_id: "ast_01M6V9CSVCMZFAP6ZN5WANZ6M8",
      },
    ],
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.part.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSWCA3JQWGVR7BMSFPEK

{
  "name": "Furnace filter 16x25x1 MERV 11",
  "manufacturer": "Aerofresh",
  "part_number": "AF-1625-M11",
  "description": "The furnace takes one. They come in packs of four.",
  "is_oem": false,
  "product_name": "Furnace filter 16x25x1",
  "fits": [
    {
      "asset_id": "ast_01M6V9CSVCMZFAP6ZN5WANZ6M8"
    }
  ]
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSWCDR7DJE12VGYH5SCA

{
  "result": {
    "part_id": "prt_01M6V9CSWCCK3TQDA78RGRZ2E2"
  },
  "version": 190
}

For Rigel#

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