Skip to content
Rigel docs
Open Rigel

Record an item's warranty

maintenance.warranty.add

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

  • Command
  • Rigel runs it
  • Applies offline

Records coverage for an item; an item can have several. Errors: invalid_range (it ends before it starts).

Parameters#

Record an item's warranty: 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 an item's warranty: request body fields
FieldDescription
asset_idstringrequired

A asset ID, such as ast_01JC0000000000000000000000.

providerstringoptional

Who provides the coverage, as written: "Carrier", "Home Depot protection plan".

at most 200 characters
coveragestringoptional

What it covers and its limits.

at most 20,000 characters
starts_onstring (date)optional

When coverage starts, YYYY-MM-DD.

ends_onstring (date)optional

When coverage ends, YYYY-MM-DD.

evidenceobjectoptional

Where the coverage was read: the warranty card, the receipt.

evidence.file_idstringoptional

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

evidence.urlstring (uri)optional

A web address.

at most 2,000 characters
evidence.said_by_person_idstringoptional

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

evidence.locatorstringoptional

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

at most 200 characters
evidence.excerptstringoptional

The exact text the value was read from.

at most 2,000 characters

Response#

200 The command was applied.

Record an item's warranty: response fields
FieldDescription
resultobjectrequired

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

result.warranty_idstringrequired

The new warranty.

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 an item's warranty: 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.
409invalid_range
  • It ends before it starts.
  • Ends before it starts.
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 coverage with evidence (file present)

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.warranty.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "asset_id": "ast_01JC0000000000000000000001",
  "provider": "Carrier",
  "coverage": "Parts for 10 years",
  "starts_on": "2019-06-15",
  "ends_on": "2029-06-15",
  "evidence": {
    "file_id": "fil_01JC0000000000000000000001"
  }
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.warranty.add", {
  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",
    provider: "Carrier",
    coverage: "Parts for 10 years",
    starts_on: "2019-06-15",
    ends_on: "2029-06-15",
    evidence: {
      file_id: "fil_01JC0000000000000000000001",
    },
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.warranty.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "asset_id": "ast_01JC0000000000000000000001",
  "provider": "Carrier",
  "coverage": "Parts for 10 years",
  "starts_on": "2019-06-15",
  "ends_on": "2029-06-15",
  "evidence": {
    "file_id": "fil_01JC0000000000000000000001"
  }
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0FCHYWGMTGMFT3GV3

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

An item can have several; nothing but the asset is needed

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.warranty.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "asset_id": "ast_01JC0000000000000000000001"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.warranty.add", {
  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",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.warranty.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

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

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

A one-day warranty is allowed

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.warranty.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "asset_id": "ast_01JC0000000000000000000001",
  "starts_on": "2025-01-01",
  "ends_on": "2025-01-01"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.warranty.add", {
  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",
    starts_on: "2025-01-01",
    ends_on: "2025-01-01",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.warranty.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "asset_id": "ast_01JC0000000000000000000001",
  "starts_on": "2025-01-01",
  "ends_on": "2025-01-01"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0NRT0MYGTT8VSHH3M

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

Ends before it starts

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.warranty.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "asset_id": "ast_01JC0000000000000000000001",
  "starts_on": "2025-01-02",
  "ends_on": "2025-01-01"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.warranty.add", {
  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",
    starts_on: "2025-01-02",
    ends_on: "2025-01-01",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.warranty.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "asset_id": "ast_01JC0000000000000000000001",
  "starts_on": "2025-01-02",
  "ends_on": "2025-01-01"
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0640138N0C6YXDWQP

{
  "error": {
    "code": "invalid_range",
    "message": "The coverage can't end before it starts. No changes were applied.",
    "details": {
      "starts_on": "2025-01-02",
      "ends_on": "2025-01-01"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0640138N0C6YXDWQP"
  }
}

An item that isn't there

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.warranty.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "asset_id": "ast_01JC0000000000000000000001"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.warranty.add", {
  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",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/maintenance.warranty.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

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

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

Record an item's warranty

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.warranty.add' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CSWB96BGFRQ05AVKF8D6' \
  -d '{
  "asset_id": "ast_01M6V9CSVH77630WV0WA1X2DAK",
  "provider": "Hartwell",
  "coverage": "Parts and labor for 2 years; the wash motor for 5 years.",
  "starts_on": "2026-03-22",
  "ends_on": "2031-03-21"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.warranty.add", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CSWB96BGFRQ05AVKF8D6",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    asset_id: "ast_01M6V9CSVH77630WV0WA1X2DAK",
    provider: "Hartwell",
    coverage: "Parts and labor for 2 years; the wash motor for 5 years.",
    starts_on: "2026-03-22",
    ends_on: "2031-03-21",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/maintenance.warranty.add HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSWB96BGFRQ05AVKF8D6

{
  "asset_id": "ast_01M6V9CSVH77630WV0WA1X2DAK",
  "provider": "Hartwell",
  "coverage": "Parts and labor for 2 years; the wash motor for 5 years.",
  "starts_on": "2026-03-22",
  "ends_on": "2031-03-21"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSWBFZA00WPX3NVDTWXG

{
  "result": {
    "warranty_id": "wty_01M6V9CSWBMQER80DQ5KEZS608"
  },
  "version": 189
}

For Rigel#

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