Skip to content
Rigel docs
Open Rigel

The product categories in use

inventory.category.list

GET/api/v1/households/{household_id}/queries/inventory.category.list

  • Query
  • Rigel runs it

Every product category in list order, with how many products are in each. Give products one of these names rather than inventing a near-duplicate.

Parameters#

The product categories in use: parameters
FieldDescription
household_idpathstringrequired

The household's ID.

Response#

200 The answer.

The product categories in use: response fields
FieldDescription
itemsarray of objectsrequired
items[].idstringrequired

A product category ID, such as pcg_01JC0000000000000000000000.

items[].namestringrequired

The category: "Produce", "Dairy".

items[].product_countintegerrequired

How many products are in it.

Errors#

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

The product categories in use: 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.

List product categories

Request, curl
curl 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/inventory.category.list' \
  -H "Cookie: rigel_session=$RIGEL_SESSION"
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/inventory.category.list", {
  headers: {
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
});
const data = await response.json();
Request, HTTP
GET /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/inventory.category.list 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_01M6V9CSBA6FPJAQVRN5K6GW2K

{
  "items": [
    {
      "id": "pcg_01M6V9CSAG0KYYACRJ15QGGWXF",
      "name": "Baking",
      "product_count": 1
    },
    {
      "id": "pcg_01M6V9CSAMTT3T032P7BR8RKP1",
      "name": "Canned goods",
      "product_count": 1
    },
    {
      "id": "pcg_01M6V9CSAY46AA0R1RMXHDQEQ5",
      "name": "Dairy",
      "product_count": 1
    }
  ]
}

For Rigel#

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