Skip to content
Rigel docs
Open Rigel

Move a meal to another date or slot

meals.meal.move

POST/api/v1/households/{household_id}/commands/meals.meal.move

  • Command
  • Rigel runs it
  • Applies offline

Moves the meal. A meal already at the target whose people are all in the moved meal goes to the moved meal's old date and slot (a swap: moving Monday's dinner to Thursday sends Thursday's dinner to Monday, so one move does "swap Monday and Thursday dinner"). A meal at the target that also has other people keeps them and loses only the moved meal's people. Nobody ends up with two meals in one slot. Moving to the same date and slot changes nothing.

Parameters#

Move a meal to another date or slot: 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.

Move a meal to another date or slot: request body fields
FieldDescription
meal_idstringrequired

A meal ID, such as mel_01JC0000000000000000000000.

datestring (date)required

The day of the meal, YYYY-MM-DD.

slotone of: breakfast, lunch, dinner, snackrequired

Which meal of the day: breakfast, lunch, dinner or snack.

Response#

200 The command was applied.

Move a meal to another date or slot: response fields
FieldDescription
resultobjectrequired

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

result.swapped_meal_idsarray of stringsrequired

Meals that moved to the old date and slot in exchange.

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.

Move a meal to another date or slot: errors
StatusCodeWhen
400validation_failedA field is missing, misspelled or out of range. details.fields lists each problem.
401unauthenticatedThe request has no valid session.
404meal_not_foundA missing meal.
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.

To an empty slot

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

{
  "meal_id": "mel_01JC000000000000000000000A",
  "date": "2026-11-11",
  "slot": "lunch"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0T54JFQ28J7B2NZ9K

{
  "result": {
    "swapped_meal_ids": []
  },
  "version": 1
}

Onto a meal with the same people swaps them

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

{
  "meal_id": "mel_01JC000000000000000000000A",
  "date": "2026-11-12",
  "slot": "dinner"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0EBCBMS36YYYXT3VZ

{
  "result": {
    "swapped_meal_ids": [
      "mel_01JC000000000000000000000B"
    ]
  },
  "version": 1
}

A target with fewer people, all in the moved meal, is swapped too

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

{
  "meal_id": "mel_01JC000000000000000000000A",
  "date": "2026-11-12",
  "slot": "dinner"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0E0ZVHWDRKGQX2G8N

{
  "result": {
    "swapped_meal_ids": [
      "mel_01JC000000000000000000000B"
    ]
  },
  "version": 1
}

A target that has other people keeps them and loses only the overlap

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

{
  "meal_id": "mel_01JC000000000000000000000A",
  "date": "2026-11-12",
  "slot": "dinner"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R09TPKZKYJJV9SG4T2

{
  "result": {
    "swapped_meal_ids": []
  },
  "version": 1
}

A meal at the target with different people is left alone

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

{
  "meal_id": "mel_01JC000000000000000000000A",
  "date": "2026-11-12",
  "slot": "dinner"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0FT9VK4SRP043ABB2

{
  "result": {
    "swapped_meal_ids": []
  },
  "version": 1
}

To its own date and slot changes nothing

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

{
  "meal_id": "mel_01JC000000000000000000000A",
  "date": "2026-11-09",
  "slot": "dinner"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0E8NZB99ZFZ0RC1EP

{
  "result": {
    "swapped_meal_ids": []
  },
  "version": 1
}

A missing meal

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

{
  "meal_id": "mel_01JC000000000000000000000A",
  "date": "2026-11-09",
  "slot": "dinner"
}
Response, 404
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0RZTXM3WC1073KCKW

{
  "error": {
    "code": "meal_not_found",
    "message": "That meal isn't there any more. No changes were applied.",
    "details": {
      "meal_id": "mel_01JC000000000000000000000A"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0RZTXM3WC1073KCKW"
  }
}

Swap two dinners

Moving onto a day that already has a dinner for the same people swaps them.

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/meals.meal.move' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CSGJ57GSEKVPX8ZAHGYP' \
  -d '{
  "meal_id": "mel_01M6V9CSFXM0D756CP5KY4HP4Q",
  "date": "2026-11-12",
  "slot": "dinner"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/meals.meal.move", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CSGJ57GSEKVPX8ZAHGYP",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    meal_id: "mel_01M6V9CSFXM0D756CP5KY4HP4Q",
    date: "2026-11-12",
    slot: "dinner",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/meals.meal.move HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSGJ57GSEKVPX8ZAHGYP

{
  "meal_id": "mel_01M6V9CSFXM0D756CP5KY4HP4Q",
  "date": "2026-11-12",
  "slot": "dinner"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSGJTYPWJ60GVRHCR5D0

{
  "result": {
    "swapped_meal_ids": [
      "mel_01M6V9CSFX452XJRFQ0A5WTYPH"
    ]
  },
  "version": 80
}

For Rigel#

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