Skip to content
Rigel docs
Open Rigel

Delete a dish no meal uses

meals.dish.remove

POST/api/v1/households/{household_id}/commands/meals.dish.remove

  • Command
  • Rigel runs it
  • Applies offline

Deletes the dish, its ingredients and any plate icons that include it. Fails with dish_in_use (saying how many meals) if a meal still has the dish; use meals.dish.merge to replace it with another dish instead.

Parameters#

Delete a dish no meal uses: 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.

Delete a dish no meal uses: request body fields
FieldDescription
dish_idstringrequired

A dish ID, such as dsh_01JC0000000000000000000000.

Response#

200 The command was applied.

Delete a dish no meal uses: 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.

Delete a dish no meal uses: errors
StatusCodeWhen
400validation_failedA field is missing, misspelled or out of range. details.fields lists each problem.
401unauthenticatedThe request has no valid session.
404dish_not_foundA missing dish.
404not_foundThe household doesn't exist, or you aren't a member of it.
409dish_in_useA dish in two meals is dish_in_use.
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.

An unused dish goes with its ingredients and combo icons

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

{
  "dish_id": "dsh_01JC000000000000000000000A"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0KQ5D6EB30K3Q3VP2

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

A dish in two meals is dish_in_use

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

{
  "dish_id": "dsh_01JC000000000000000000000A"
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R01XAZJC24RV0TZHRY

{
  "error": {
    "code": "dish_in_use",
    "message": "That dish is in 2 meals. No changes were applied.",
    "details": {
      "meal_count": 2
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R01XAZJC24RV0TZHRY"
  }
}

A missing dish

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

{
  "dish_id": "dsh_01JC000000000000000000000A"
}
Response, 404
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R03D551MKYAHRYDJ11

{
  "error": {
    "code": "dish_not_found",
    "message": "That dish isn't there any more. No changes were applied.",
    "details": {
      "dish_id": "dsh_01JC000000000000000000000A"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R03D551MKYAHRYDJ11"
  }
}

Remove a dish nothing uses

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/meals.dish.remove' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CSHBX5D0CEQHRSHWFYJY' \
  -d '{
  "dish_id": "dsh_01M6V9CSH9R3VN2JFHSQQ5Q86Y"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/meals.dish.remove", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CSHBX5D0CEQHRSHWFYJY",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    dish_id: "dsh_01M6V9CSH9R3VN2JFHSQQ5Q86Y",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/meals.dish.remove HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSHBX5D0CEQHRSHWFYJY

{
  "dish_id": "dsh_01M6V9CSH9R3VN2JFHSQQ5Q86Y"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSHB6EXPM1GAABVHBZ3Q

{
  "result": {},
  "version": 85
}

Remove a dish that's still planned

A dish can only go when no meal uses it. Merge it into another dish to replace it.

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/meals.dish.remove' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CSHCQHG4W0DM2YGQJ3VN' \
  -d '{
  "dish_id": "dsh_01M6V9CSF42115AECDV14HYQ9G"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/meals.dish.remove", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CSHCQHG4W0DM2YGQJ3VN",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    dish_id: "dsh_01M6V9CSF42115AECDV14HYQ9G",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/meals.dish.remove HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSHCQHG4W0DM2YGQJ3VN

{
  "dish_id": "dsh_01M6V9CSF42115AECDV14HYQ9G"
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01M6V9CSHCPW59SR4G0K6A9GXM

{
  "error": {
    "code": "dish_in_use",
    "message": "That dish is in 1 meal. No changes were applied.",
    "details": {
      "meal_count": 1
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01M6V9CSHCPW59SR4G0K6A9GXM"
  }
}

For Rigel#

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