Skip to content
Rigel docs
Open Rigel

Set what's in a pack

chat.pack.set_items

POST/api/v1/households/{household_id}/commands/chat.pack.set_items

  • Command
  • Rigel runs it
  • Applies offline

Replaces a pack's contents with these custom emoji and stickers, in this order. An item listed twice is kept once, at its first place. Errors: pack_not_found, custom_emoji_not_found, sticker_not_found.

Parameters#

Set what's in a pack: 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.

Set what's in a pack: request body fields
FieldDescription
pack_idstringrequired

A expression pack ID, such as epk_01JC0000000000000000000000.

itemsarray of objectsrequired

Everything in the pack, in order. Replaces what was there.

at most 200 items
items[].custom_emoji_idstringoptional

A custom emoji ID, such as cem_01JC0000000000000000000000.

items[].sticker_idstringoptional

A sticker ID, such as stk_01JC0000000000000000000000.

Response#

200 The command was applied.

Set what's in a pack: 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.

Set what's in a pack: errors
StatusCodeWhen
400validation_failedA field is missing, misspelled or out of range. details.fields lists each problem.
401unauthenticatedThe request has no valid session.
404pack_not_found
  • The pack doesn't exist in this household.
  • A pack that isn't there.
404custom_emoji_not_found
  • The custom emoji doesn't exist in this household.
  • An emoji that isn't there.
404sticker_not_found
  • The sticker doesn't exist in this household.
  • A sticker 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.

Replaces the contents, in order, listing an item twice once

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.pack.set_items' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "pack_id": "epk_01JC0000000000000000000001",
  "items": [
    {
      "sticker_id": "stk_01JC0000000000000000000001"
    },
    {
      "custom_emoji_id": "cem_01JC0000000000000000000002"
    },
    {
      "sticker_id": "stk_01JC0000000000000000000001"
    }
  ]
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.pack.set_items", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    pack_id: "epk_01JC0000000000000000000001",
    items: [
      {
        sticker_id: "stk_01JC0000000000000000000001",
      },
      {
        custom_emoji_id: "cem_01JC0000000000000000000002",
      },
      {
        sticker_id: "stk_01JC0000000000000000000001",
      },
    ],
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.pack.set_items HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "pack_id": "epk_01JC0000000000000000000001",
  "items": [
    {
      "sticker_id": "stk_01JC0000000000000000000001"
    },
    {
      "custom_emoji_id": "cem_01JC0000000000000000000002"
    },
    {
      "sticker_id": "stk_01JC0000000000000000000001"
    }
  ]
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0E55GWZDMJBZE4DJG

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

An empty list empties the pack

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

{
  "pack_id": "epk_01JC0000000000000000000001",
  "items": []
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0ZM1A89TKZK6YE59P

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

A pack that isn't there

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

{
  "pack_id": "epk_01JC0000000000000000000001",
  "items": []
}
Response, 404
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0VB0JC69187AW9VJF

{
  "error": {
    "code": "pack_not_found",
    "message": "That pack isn't there any more. No changes were applied.",
    "details": {
      "pack_id": "epk_01JC0000000000000000000001"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0VB0JC69187AW9VJF"
  }
}

An emoji that isn't there

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

{
  "pack_id": "epk_01JC0000000000000000000001",
  "items": [
    {
      "custom_emoji_id": "cem_01JC0000000000000000000009"
    }
  ]
}
Response, 404
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R09R89R6E59WZMDZN9

{
  "error": {
    "code": "custom_emoji_not_found",
    "message": "One of those emoji isn't there any more. No changes were applied.",
    "details": {},
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R09R89R6E59WZMDZN9"
  }
}

A sticker that isn't there

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

{
  "pack_id": "epk_01JC0000000000000000000001",
  "items": [
    {
      "sticker_id": "stk_01JC0000000000000000000009"
    }
  ]
}
Response, 404
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0Z1M92JDV5MS065R1

{
  "error": {
    "code": "sticker_not_found",
    "message": "One of those stickers isn't there any more. No changes were applied.",
    "details": {},
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0Z1M92JDV5MS065R1"
  }
}

Fill a pack

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/chat.pack.set_items' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CSPKF8S16NEDVXQG2QRX' \
  -d '{
  "pack_id": "epk_01M6V9CSPHPZGPH3BGCB1YP198",
  "items": [
    {
      "custom_emoji_id": "cem_01M6V9CSPG68TY89RDKJR3K9XC"
    }
  ]
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/chat.pack.set_items", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CSPKF8S16NEDVXQG2QRX",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    pack_id: "epk_01M6V9CSPHPZGPH3BGCB1YP198",
    items: [
      {
        custom_emoji_id: "cem_01M6V9CSPG68TY89RDKJR3K9XC",
      },
    ],
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/chat.pack.set_items HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSPKF8S16NEDVXQG2QRX

{
  "pack_id": "epk_01M6V9CSPHPZGPH3BGCB1YP198",
  "items": [
    {
      "custom_emoji_id": "cem_01M6V9CSPG68TY89RDKJR3K9XC"
    }
  ]
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSPKPNWGER6TJF3KBN23

{
  "result": {},
  "version": 128
}

For Rigel#

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