Skip to content
Rigel docs
Open Rigel

Link an item to the right model

maintenance.asset.correct_model

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

  • Command
  • Rigel runs it
  • Applies offline

Links the item to the model with exactly this manufacturer, model number and variant, made if the household has none yet, and marks the item identified (while Rigel is looking the item up, that waits until it finishes). Rigel then looks the model up online, unless research is false. This is also how a first model is set. It never edits the model the item had, which keeps its facts and parts for other items that share it. If category_key is given and the item is still "Not identified yet", it moves to that category.

Parameters#

Link an item to the right model: 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.

Link an item to the right model: request body fields
FieldDescription
asset_idstringrequired

A asset ID, such as ast_01JC0000000000000000000000.

manufacturerstringoptional

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

at most 120 characters
model_numberstringoptional

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

at most 120 characters
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
category_keystringoptional

A curated category key to move the item to when it is still unidentified, and to give a new model.

researchbooleanoptional

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

Response#

200 The command was applied.

Link an item to the right model: response fields
FieldDescription
resultobjectrequired

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

result.model_idstringrequired

The model the item now has.

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.

Link an item to the right model: errors
StatusCodeWhen
400validation_failedA field is missing, misspelled or out of range. details.fields lists each problem.
401unauthenticatedThe request has no valid session.
404asset_not_foundAn item 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.
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.

A first model is made, linked and the item moves out of unidentified

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

{
  "asset_id": "ast_01JC0000000000000000000001",
  "manufacturer": "Carrier",
  "model_number": "59TP6B080M1714",
  "category_key": "furnace"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0JXJPAP9NZYC2RDEN

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

Relinks to an existing model without touching either model

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

{
  "asset_id": "ast_01JC0000000000000000000001",
  "manufacturer": "Carrier",
  "model_number": "59TP6B"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0FQ3NDC05C0ATRNZ5

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

An identified item's category stays even when a key is given

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

{
  "asset_id": "ast_01JC0000000000000000000001",
  "model_number": "ST-1",
  "category_key": "range"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R03771KNCPTMA6GM9E

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

A new model takes the category of an already identified item

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

{
  "asset_id": "ast_01JC0000000000000000000001",
  "manufacturer": "Lennox"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0G67EM3MCG1NTCV5Z

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

Unidentified stays when no key is given, and the new model has no category

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

{
  "asset_id": "ast_01JC0000000000000000000001",
  "model_number": "X-1"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0PYMD30YWVV0YPX45

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

Research: false links and identifies without looking it up

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

{
  "asset_id": "ast_01JC0000000000000000000001",
  "manufacturer": "Carrier",
  "model_number": "59TP6B080M1714",
  "category_key": "furnace",
  "research": false
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0WQDDJ5XRT3C749S7

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

While researching, the status is left for the job to settle

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

{
  "asset_id": "ast_01JC0000000000000000000001",
  "manufacturer": "Carrier",
  "model_number": "59TP6B080M1714",
  "category_key": "furnace"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0SG3N00CK7WQ51AWK

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

A category key that isn't curated

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

{
  "asset_id": "ast_01JC0000000000000000000001",
  "model_number": "X",
  "category_key": "spaceship"
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0PB2AKEYGZABKGEAK

{
  "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_01K9D9S2R0PB2AKEYGZABKGEAK"
  }
}

An item that isn't there

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

{
  "asset_id": "ast_01JC0000000000000000000001",
  "model_number": "X"
}
Response, 404
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R03XR83JKJ5YYGTC64

{
  "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_01K9D9S2R03XR83JKJ5YYGTC64"
  }
}

Link an item to the right model

Never edits the model the item had, which other items may share.

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.asset.correct_model' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CSVY3MSY1J9H5FKHZ7FA' \
  -d '{
  "asset_id": "ast_01M6V9CSVH77630WV0WA1X2DAK",
  "manufacturer": "Hartwell",
  "model_number": "HDW-3250",
  "research": false
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.asset.correct_model", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CSVY3MSY1J9H5FKHZ7FA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    asset_id: "ast_01M6V9CSVH77630WV0WA1X2DAK",
    manufacturer: "Hartwell",
    model_number: "HDW-3250",
    research: false,
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.asset.correct_model HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSVY3MSY1J9H5FKHZ7FA

{
  "asset_id": "ast_01M6V9CSVH77630WV0WA1X2DAK",
  "manufacturer": "Hartwell",
  "model_number": "HDW-3250",
  "research": false
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSVYM5K12M9JQZ9RHJR5

{
  "result": {
    "model_id": "eqm_01M6V9CSVYCP9NFV9882GFRJFN"
  },
  "version": 182
}

For Rigel#

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