Skip to content
Rigel docs
Open Rigel

Find anything in the house records

maintenance.record.search

GET/api/v1/households/{household_id}/queries/maintenance.record.search

  • Query
  • Rigel runs it

Finds items, models, places, contractors and projects by text: names, model numbers (punctuation and spacing ignored), serial numbers, makers and trades. Best matches first, each with its kind and the web route that opens it. Use it to find the ID of 'the upstairs furnace' or whichever item has a model number.

Parameters#

Find anything in the house records: parameters
FieldDescription
household_idpathstringrequired

The household's ID.

textquerystringrequired

What to look for: a name, model number, serial, place or contractor.

1 to 200 characters
kindsqueryarray, each one of: asset, model, place, contractor, projectoptional

Only these kinds of record. Leave out for all.

limitqueryintegeroptional

How many to return, default 20.

1 to 100

Response#

200 The answer.

Find anything in the house records: response fields
FieldDescription
itemsarray of objectsrequired
items[].kindone of: asset, model, place, contractor, projectrequired

What kind of record it is: asset, model, place, contractor or project.

items[].idstringrequired

The record's ID.

items[].addressstring or nullrequired

The web route that opens it, when it has one.

items[].titlestringrequired

Its name.

items[].detailstring or nullrequired

A line about it: where it is, its model, its trade.

items[].matchedstringrequired

Which field matched, such as name, model_number or serial.

truncatedbooleanrequired

True when more matched than the limit allowed.

Errors#

Every error has the same envelope: error.code, error.message, error.details, error.recovery and error.request_id.

Find anything in the house records: errors
StatusCodeWhen
400validation_failedA field is missing, misspelled or out of range. details.fields lists each problem.
401unauthenticatedThe request has no valid session.
404not_foundThe household doesn't exist, or you aren't a member of it.

Examples#

These are real. Each was recorded from a sample household, the Okafors, running through the whole API when this site was built.

Search the house records for the furnace

Items, models, places, contractors and projects.

Request, curl
curl 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/maintenance.record.search?text=furnace' \
  -H "Cookie: rigel_session=$RIGEL_SESSION"
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/maintenance.record.search?text=furnace", {
  headers: {
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
});
const data = await response.json();
Request, HTTP
GET /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/maintenance.record.search?text=furnace HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CT26PS4Q6XWKM2ZG03HN

{
  "items": [
    {
      "kind": "asset",
      "id": "ast_01M6V9CSVCMZFAP6ZN5WANZ6M8",
      "address": "/maintenance/assets/ast_01M6V9CSVCMZFAP6ZN5WANZ6M8",
      "title": "Basement furnace",
      "detail": "Hearthline FX96-080-1625 ยท Utility closet, Basement",
      "matched": "name"
    }
  ],
  "truncated": false
}

Search only some kinds of record

Repeat kinds for each kind to include.

Request, curl
curl 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/maintenance.record.search?text=smith&kinds=contractor&kinds=asset' \
  -H "Cookie: rigel_session=$RIGEL_SESSION"
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/maintenance.record.search?text=smith&kinds=contractor&kinds=asset", {
  headers: {
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
});
const data = await response.json();
Request, HTTP
GET /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/maintenance.record.search?text=smith&kinds=contractor&kinds=asset HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CT28BW2WEWAF3D631NP6

{
  "items": [
    {
      "kind": "contractor",
      "id": "ctr_01M6V9CSWEFJH8CRZCXNAH8109",
      "address": "/maintenance/people/ctr_01M6V9CSWEFJH8CRZCXNAH8109",
      "title": "Smith Heating & Air",
      "detail": "HVAC",
      "matched": "name"
    }
  ],
  "truncated": false
}

For Rigel#

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