Skip to content
Rigel docs
Open Rigel

Change one aisle's label, sign text or sign photo

shopping.aisle.update

POST/api/v1/households/{household_id}/commands/shopping.aisle.update

  • Command
  • Rigel runs it
  • Applies offline

Sets only the fields given. Send contents or photo_file_id as null to clear them. To reorder or add aisles use shopping.aisle.set.

Parameters#

Change one aisle's label, sign text or sign photo: 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.

Change one aisle's label, sign text or sign photo: request body fields
FieldDescription
aisle_idstringrequired

The aisle to change.

labelstringoptional

The aisle or section's label: "Aisle 5", "Produce", "Deli", as written, 1–80 characters.

at most 80 characters
contentsstring or nulloptional

What the sign lists, or null to clear it.

at most 500 characters
photo_file_idstring or nulloptional

A photo of the sign, already uploaded as a file, or null to remove it.

Response#

200 The command was applied.

Change one aisle's label, sign text or sign photo: response fields
FieldDescription
resultobjectrequired

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

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.

Change one aisle's label, sign text or sign photo: errors
StatusCodeWhen
400validation_failedA field is missing, misspelled or out of range. details.fields lists each problem.
401unauthenticatedThe request has no valid session.
404aisle_not_foundAn aisle that isn't there.
404file_not_foundA photo 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.

Sets only the fields given

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

{
  "aisle_id": "ais_01JC000000000000000000000A",
  "label": "Aisle 1 - Pasta"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R05RTAH3ACZHMP0THV

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

Clears the sign text and sets a photo

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

{
  "aisle_id": "ais_01JC000000000000000000000A",
  "contents": null,
  "photo_file_id": "fil_01JC000000000000000000000A"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0H21PD6S3N9XPTA77

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

An aisle that isn't there

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

{
  "aisle_id": "ais_01JC000000000000000000000A",
  "label": "x"
}
Response, 404
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R09ZK2ES90T0VMRK6B

{
  "error": {
    "code": "aisle_not_found",
    "message": "That aisle isn't there any more. No changes were applied.",
    "details": {
      "aisle_id": "ais_01JC000000000000000000000A"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R09ZK2ES90T0VMRK6B"
  }
}

A photo that isn't there

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

{
  "aisle_id": "ais_01JC000000000000000000000A",
  "photo_file_id": "fil_01JC000000000000000000000B"
}
Response, 404
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R00BS99ET8ZMF8K456

{
  "error": {
    "code": "file_not_found",
    "message": "That file isn't there any more. No changes were applied.",
    "details": {
      "file_id": "fil_01JC000000000000000000000B"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R00BS99ET8ZMF8K456"
  }
}

Change what an aisle's sign says

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/shopping.aisle.update' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CT723H5ZBJ6JCXAVVPC1' \
  -d '{
  "aisle_id": "ais_01M6V9CT70QB5HHFQCH5HEANWJ",
  "label": "Aisle 3",
  "contents": "Paper goods, cleaning, first aid"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/shopping.aisle.update", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CT723H5ZBJ6JCXAVVPC1",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    aisle_id: "ais_01M6V9CT70QB5HHFQCH5HEANWJ",
    label: "Aisle 3",
    contents: "Paper goods, cleaning, first aid",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/shopping.aisle.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CT723H5ZBJ6JCXAVVPC1

{
  "aisle_id": "ais_01M6V9CT70QB5HHFQCH5HEANWJ",
  "label": "Aisle 3",
  "contents": "Paper goods, cleaning, first aid"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CT72BYN6SPB2W463VXZE

{
  "result": {},
  "version": 266
}

For Rigel#

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