Send a message in a conversation or thread
chat.message.send
POST/api/v1/households/{household_id}/commands/chat.message.send
- Command
- Rigel runs it
- Applies offline
Sends a message in a topic, or in the thread under one of its messages, optionally quoting another message, with up to 10 uploaded files or one sticker. A member sends as themselves; Rigel (the agent) sends as Rigel. Mentions (@Name, @Rigel) are worked out from the text, and the people following the topic, mentioned, quoted or in the thread are notified. Sending in an archived topic reopens it. The main chat's ID is fixed, so it can be sent to before anything is there. Errors: conversation_not_found, message_not_found (thread root or quoted message), thread_too_deep (the thread root is itself in a thread), empty_message (no text, files or sticker), too_many_attachments, sticker_with_attachments, file_not_found, sticker_not_found, sticker_archived, no_person (a member without a person in the family).
Parameters#
| Field | Description |
|---|---|
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.
| Field | Description |
|---|---|
conversation_idstringrequired | The conversation to send in. The main chat is cnv_00000000000000000000000000, whether or not anything has been sent there yet. |
bodystringrequired | The message text, as written, up to 8,000 characters. Mention someone with @ and their name (@Ada) or Rigel with @Rigel; use a custom emoji with :name:. May be empty when the message has attachments or a sticker. |
formatone of: markdown, plainoptional | How to read body: markdown (a CommonMark subset: emphasis, links, lists, quotes and code; raw HTML is shown as text) or plain (shown exactly as written). |
thread_root_message_idstringoptional | Send in the thread under this message. It must be a message in the conversation itself, not one in a thread: threads are one level deep. |
reply_to_message_idstringoptional | Quote this message of the same conversation as a reply. |
file_idsarray of stringsoptional | Files to attach, already uploaded, in order. Up to 10. |
sticker_idstringoptional | Send a sticker. A sticker message has no attachments. |
Response#
200 The command was applied.
| Field | Description |
|---|---|
resultobjectrequired | What the command returned, such as the IDs it created. |
result.message_idstringrequired | The new message: always the first ID its command makes. |
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.
| Status | Code | When |
|---|---|---|
400 | validation_failed | A field is missing, misspelled or out of range. details.fields lists each problem. |
401 | unauthenticated | The request has no valid session. |
404 | conversation_not_found |
|
404 | message_not_found |
|
404 | file_not_found |
|
404 | sticker_not_found |
|
404 | not_found | The household doesn't exist, or you aren't a member of it. |
409 | thread_too_deep |
|
409 | empty_message |
|
409 | too_many_attachments | Described above. |
409 | sticker_with_attachments | A sticker together with files. |
409 | sticker_archived | An archived sticker. |
409 | no_person |
|
409 | idempotency_key_reused | The 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.
The main chat before its row exists: made, titled Family, and the message lands in it
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_00000000000000000000000000",
"body": "Hello **everyone**"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_00000000000000000000000000",
body: "Hello **everyone**",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_00000000000000000000000000",
"body": "Hello **everyone**"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0J29KKD8QE249ZZZF
{
"result": {
"message_id": "msg_01JC4N0000MBGE5RJ6Q7V6V6T8"
},
"version": 1
}Files kept once in order, mentions found, a mention notifies at the default level
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "Look @ben and @Rigel, thanks",
"format": "plain",
"file_ids": [
"fil_01JC0000000000000000000001",
"fil_01JC0000000000000000000002",
"fil_01JC0000000000000000000001"
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_01JC0000000000000000000001",
body: "Look @ben and @Rigel, thanks",
format: "plain",
file_ids: [
"fil_01JC0000000000000000000001",
"fil_01JC0000000000000000000002",
"fil_01JC0000000000000000000001",
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "Look @ben and @Rigel, thanks",
"format": "plain",
"file_ids": [
"fil_01JC0000000000000000000001",
"fil_01JC0000000000000000000002",
"fil_01JC0000000000000000000001"
]
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R005R3NDK1AYEN2391
{
"result": {
"message_id": "msg_01JC4N0000MBGE5RJ6Q7V6V6T8"
},
"version": 1
}An empty body with a file is a message, and a follower of everything is told what it is
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "",
"file_ids": [
"fil_01JC0000000000000000000001"
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_01JC0000000000000000000001",
body: "",
file_ids: [
"fil_01JC0000000000000000000001",
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "",
"file_ids": [
"fil_01JC0000000000000000000001"
]
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R00C0BV59QHBEZKT0S
{
"result": {
"message_id": "msg_01JC4N0000MBGE5RJ6Q7V6V6T8"
},
"version": 1
}Two files of different kinds are described as files
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_00000000000000000000000000",
"body": "",
"file_ids": [
"fil_01JC0000000000000000000001",
"fil_01JC0000000000000000000002"
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_00000000000000000000000000",
body: "",
file_ids: [
"fil_01JC0000000000000000000001",
"fil_01JC0000000000000000000002",
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_00000000000000000000000000",
"body": "",
"file_ids": [
"fil_01JC0000000000000000000001",
"fil_01JC0000000000000000000002"
]
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0SQ98GP4F6ENEKXYN
{
"result": {
"message_id": "msg_01JC4N0000MBGE5RJ6Q7V6V6T8"
},
"version": 1
}Ten attachments, the most: the last is at position 9
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "",
"file_ids": [
"fil_01JC0000000000000000000001",
"fil_01JC0000000000000000000002",
"fil_01JC0000000000000000000003",
"fil_01JC0000000000000000000004",
"fil_01JC0000000000000000000005",
"fil_01JC0000000000000000000006",
"fil_01JC0000000000000000000007",
"fil_01JC0000000000000000000008",
"fil_01JC0000000000000000000009",
"fil_01JC0000000000000000000010"
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_01JC0000000000000000000001",
body: "",
file_ids: [
"fil_01JC0000000000000000000001",
"fil_01JC0000000000000000000002",
"fil_01JC0000000000000000000003",
"fil_01JC0000000000000000000004",
"fil_01JC0000000000000000000005",
"fil_01JC0000000000000000000006",
"fil_01JC0000000000000000000007",
"fil_01JC0000000000000000000008",
"fil_01JC0000000000000000000009",
"fil_01JC0000000000000000000010",
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "",
"file_ids": [
"fil_01JC0000000000000000000001",
"fil_01JC0000000000000000000002",
"fil_01JC0000000000000000000003",
"fil_01JC0000000000000000000004",
"fil_01JC0000000000000000000005",
"fil_01JC0000000000000000000006",
"fil_01JC0000000000000000000007",
"fil_01JC0000000000000000000008",
"fil_01JC0000000000000000000009",
"fil_01JC0000000000000000000010"
]
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0K6XNRD98WJN8SNCA
{
"result": {
"message_id": "msg_01JC4N0000MBGE5RJ6Q7V6V6T8"
},
"version": 1
}A reply in a thread tells the person who wrote the thread's root
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "I do",
"thread_root_message_id": "msg_01JC0000000000000000000001"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_01JC0000000000000000000001",
body: "I do",
thread_root_message_id: "msg_01JC0000000000000000000001",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "I do",
"thread_root_message_id": "msg_01JC0000000000000000000001"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R02CRK34ERPFC5CPW7
{
"result": {
"message_id": "msg_01JC4N0000MBGE5RJ6Q7V6V6T8"
},
"version": 1
}Quoting someone's message tells them, even in a topic they only follow for mentions
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "Me",
"reply_to_message_id": "msg_01JC0000000000000000000001"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_01JC0000000000000000000001",
body: "Me",
reply_to_message_id: "msg_01JC0000000000000000000001",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "Me",
"reply_to_message_id": "msg_01JC0000000000000000000001"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R012F9WHXF4JP6F70B
{
"result": {
"message_id": "msg_01JC4N0000MBGE5RJ6Q7V6V6T8"
},
"version": 1
}A sticker alone is a message
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_00000000000000000000000000",
"body": "",
"sticker_id": "stk_01JC0000000000000000000001"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_00000000000000000000000000",
body: "",
sticker_id: "stk_01JC0000000000000000000001",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_00000000000000000000000000",
"body": "",
"sticker_id": "stk_01JC0000000000000000000001"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R092JXA4J45TBFSB49
{
"result": {
"message_id": "msg_01JC4N0000MBGE5RJ6Q7V6V6T8"
},
"version": 1
}Sending in an archived topic reopens it
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "We'\''re back on"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_01JC0000000000000000000001",
body: "We're back on",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "We're back on"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0DTPZFDF90EXYT57H
{
"result": {
"message_id": "msg_01JC4N0000MBGE5RJ6Q7V6V6T8"
},
"version": 1
}Someone who follows a topic at none is not told, even when mentioned
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_00000000000000000000000000",
"body": "@Ben hello"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_00000000000000000000000000",
body: "@Ben hello",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_00000000000000000000000000",
"body": "@Ben hello"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R08BP088W21W7HYCKK
{
"result": {
"message_id": "msg_01JC4N0000MBGE5RJ6Q7V6V6T8"
},
"version": 1
}A long topic title is shortened so the notification title fits
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "Hi"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_01JC0000000000000000000001",
body: "Hi",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "Hi"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0N2BXV0Q0W6YA57ZD
{
"result": {
"message_id": "msg_01JC4N0000MBGE5RJ6Q7V6V6T8"
},
"version": 1
}The records its links point at are kept once each, in order, outside code and not for users or commands
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "See [stock](/inventory/inv_01JC0000000000000000000001) and https://rigel.house/chat/message/msg_01JC0000000000000000000009, again [x](/inventory/inv_01JC0000000000000000000001), `https://rigel.house/p/prd_01JC0000000000000000000001` and usr_01JC0000000000000000000001 and https://rigel.house/u/usr_01JC0000000000000000000001"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_01JC0000000000000000000001",
body: "See [stock](/inventory/inv_01JC0000000000000000000001) and https://rigel.house/chat/message/msg_01JC0000000000000000000009, again [x](/inventory/inv_01JC0000000000000000000001), `https://rigel.house/p/prd_01JC0000000000000000000001` and usr_01JC0000000000000000000001 and https://rigel.house/u/usr_01JC0000000000000000000001",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "See [stock](/inventory/inv_01JC0000000000000000000001) and https://rigel.house/chat/message/msg_01JC0000000000000000000009, again [x](/inventory/inv_01JC0000000000000000000001), `https://rigel.house/p/prd_01JC0000000000000000000001` and usr_01JC0000000000000000000001 and https://rigel.house/u/usr_01JC0000000000000000000001"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R09X17VDA5VG3SCNXZ
{
"result": {
"message_id": "msg_01JC4N0000MBGE5RJ6Q7V6V6T8"
},
"version": 1
}A conversation that isn't there
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "Hi"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_01JC0000000000000000000001",
body: "Hi",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "Hi"
}HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R058P3PS0Z2MBG2VAF
{
"error": {
"code": "conversation_not_found",
"message": "That topic isn't there any more. No changes were applied.",
"details": {
"conversation_id": "cnv_01JC0000000000000000000001"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R058P3PS0Z2MBG2VAF"
}
}A thread root that isn't there
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "Hi",
"thread_root_message_id": "msg_01JC0000000000000000000009"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_01JC0000000000000000000001",
body: "Hi",
thread_root_message_id: "msg_01JC0000000000000000000009",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "Hi",
"thread_root_message_id": "msg_01JC0000000000000000000009"
}HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0R4RX305HBFNMW0NK
{
"error": {
"code": "message_not_found",
"message": "That message isn't there any more. No changes were applied.",
"details": {
"message_id": "msg_01JC0000000000000000000009"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R0R4RX305HBFNMW0NK"
}
}A thread root in another conversation
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "Hi",
"thread_root_message_id": "msg_01JC0000000000000000000001"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_01JC0000000000000000000001",
body: "Hi",
thread_root_message_id: "msg_01JC0000000000000000000001",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "Hi",
"thread_root_message_id": "msg_01JC0000000000000000000001"
}HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0V2NTN14RPVE561KY
{
"error": {
"code": "message_not_found",
"message": "That message isn't in this topic. No changes were applied.",
"details": {
"message_id": "msg_01JC0000000000000000000001"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R0V2NTN14RPVE561KY"
}
}A thread root that is itself in a thread
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "Hi",
"thread_root_message_id": "msg_01JC0000000000000000000002"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_01JC0000000000000000000001",
body: "Hi",
thread_root_message_id: "msg_01JC0000000000000000000002",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "Hi",
"thread_root_message_id": "msg_01JC0000000000000000000002"
}HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0XCN0W03ESD5SXXGM
{
"error": {
"code": "thread_too_deep",
"message": "Threads are one level deep: reply in the thread under that message. No changes were applied.",
"details": {
"message_id": "msg_01JC0000000000000000000002"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R0XCN0W03ESD5SXXGM"
}
}A quoted message that isn't there
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "Hi",
"reply_to_message_id": "msg_01JC0000000000000000000009"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_01JC0000000000000000000001",
body: "Hi",
reply_to_message_id: "msg_01JC0000000000000000000009",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "Hi",
"reply_to_message_id": "msg_01JC0000000000000000000009"
}HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R04F6Z5DY4E0PJJ85B
{
"error": {
"code": "message_not_found",
"message": "That message isn't there any more. No changes were applied.",
"details": {
"message_id": "msg_01JC0000000000000000000009"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R04F6Z5DY4E0PJJ85B"
}
}A quoted message in another conversation
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "Hi",
"reply_to_message_id": "msg_01JC0000000000000000000001"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_01JC0000000000000000000001",
body: "Hi",
reply_to_message_id: "msg_01JC0000000000000000000001",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "Hi",
"reply_to_message_id": "msg_01JC0000000000000000000001"
}HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0VX47X6QAWP6MD99V
{
"error": {
"code": "message_not_found",
"message": "That message isn't in this topic. No changes were applied.",
"details": {
"message_id": "msg_01JC0000000000000000000001"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R0VX47X6QAWP6MD99V"
}
}Nothing to send: blank text
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": " \n "
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_01JC0000000000000000000001",
body: " \n ",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": " \n "
}HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0D3MKFV56HDX3H2D4
{
"error": {
"code": "empty_message",
"message": "There's nothing to send: add some text, a file or a sticker. No changes were applied.",
"details": {},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R0D3MKFV56HDX3H2D4"
}
}A sticker together with files
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "",
"sticker_id": "stk_01JC0000000000000000000001",
"file_ids": [
"fil_01JC0000000000000000000001"
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_01JC0000000000000000000001",
body: "",
sticker_id: "stk_01JC0000000000000000000001",
file_ids: [
"fil_01JC0000000000000000000001",
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "",
"sticker_id": "stk_01JC0000000000000000000001",
"file_ids": [
"fil_01JC0000000000000000000001"
]
}HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R06X211VY49CE1DDRY
{
"error": {
"code": "sticker_with_attachments",
"message": "A sticker is sent on its own, without files. No changes were applied.",
"details": {},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R06X211VY49CE1DDRY"
}
}A file that isn't there
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "",
"file_ids": [
"fil_01JC0000000000000000000009"
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_01JC0000000000000000000001",
body: "",
file_ids: [
"fil_01JC0000000000000000000009",
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "",
"file_ids": [
"fil_01JC0000000000000000000009"
]
}HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R013V08E31XWWWHXND
{
"error": {
"code": "file_not_found",
"message": "That file isn't there any more. No changes were applied.",
"details": {
"file_id": "fil_01JC0000000000000000000009"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R013V08E31XWWWHXND"
}
}A sticker that isn't there
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "",
"sticker_id": "stk_01JC0000000000000000000009"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_01JC0000000000000000000001",
body: "",
sticker_id: "stk_01JC0000000000000000000009",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "",
"sticker_id": "stk_01JC0000000000000000000009"
}HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R019S7GJGV9AGCBA47
{
"error": {
"code": "sticker_not_found",
"message": "That sticker 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_01K9D9S2R019S7GJGV9AGCBA47"
}
}An archived sticker
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "",
"sticker_id": "stk_01JC0000000000000000000001"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_01JC0000000000000000000001",
body: "",
sticker_id: "stk_01JC0000000000000000000001",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "",
"sticker_id": "stk_01JC0000000000000000000001"
}HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R09YCE8DV7NBF85FJP
{
"error": {
"code": "sticker_archived",
"message": "That sticker has been retired. No changes were applied.",
"details": {},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R09YCE8DV7NBF85FJP"
}
}A signed-in account that isn't a person in the family
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "Hi"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_01JC0000000000000000000001",
body: "Hi",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"conversation_id": "cnv_01JC0000000000000000000001",
"body": "Hi"
}HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0YS8WDTPPREEXJV2Y
{
"error": {
"code": "no_person",
"message": "Only a member of the family can write in chat. No changes were applied.",
"details": {},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R0YS8WDTPPREEXJV2Y"
}
}Send a message
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CSMQ7CDEFT1CKMCYS4N7' \
-d '{
"conversation_id": "cnv_00000000000000000000000000",
"body": "Dinner on Monday is the orzo. Make extra for lunches."
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CSMQ7CDEFT1CKMCYS4N7",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_00000000000000000000000000",
body: "Dinner on Monday is the orzo. Make extra for lunches.",
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSMQ7CDEFT1CKMCYS4N7
{
"conversation_id": "cnv_00000000000000000000000000",
"body": "Dinner on Monday is the orzo. Make extra for lunches."
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSMQD7JNHQZ259Y8K0PN
{
"result": {
"message_id": "msg_01M6V9CSMQRZ6GEQ67CPHFX844"
},
"version": 108
}Mention someone
A mention is written @Name in the text. The message lists who was mentioned, and a mentioned person who signs in is notified.
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CSMTH8JN0BBT2JBJ7AH0' \
-d '{
"conversation_id": "cnv_00000000000000000000000000",
"body": "@Ben can you pick Theo up from soccer on Tuesday? I have a late meeting."
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CSMTH8JN0BBT2JBJ7AH0",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_00000000000000000000000000",
body: "@Ben can you pick Theo up from soccer on Tuesday? I have a late meeting.",
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSMTH8JN0BBT2JBJ7AH0
{
"conversation_id": "cnv_00000000000000000000000000",
"body": "@Ben can you pick Theo up from soccer on Tuesday? I have a late meeting."
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSMTED9W29DZBTTJ86DZ
{
"result": {
"message_id": "msg_01M6V9CSMTRMX2BPZ3MJTKGREF"
},
"version": 109
}Reply to a message
reply_to_message_id quotes the message you're answering.
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CSMWJF7SJ82SB1K1BQG1' \
-d '{
"conversation_id": "cnv_00000000000000000000000000",
"body": "Practice is at 5:00 pm, so leave by 4:40.",
"reply_to_message_id": "msg_01M6V9CSMTRMX2BPZ3MJTKGREF"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CSMWJF7SJ82SB1K1BQG1",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_00000000000000000000000000",
body: "Practice is at 5:00 pm, so leave by 4:40.",
reply_to_message_id: "msg_01M6V9CSMTRMX2BPZ3MJTKGREF",
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSMWJF7SJ82SB1K1BQG1
{
"conversation_id": "cnv_00000000000000000000000000",
"body": "Practice is at 5:00 pm, so leave by 4:40.",
"reply_to_message_id": "msg_01M6V9CSMTRMX2BPZ3MJTKGREF"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSMWFNA5PB48SREBYJDY
{
"result": {
"message_id": "msg_01M6V9CSMWTTAMGZS9MTJ8YK65"
},
"version": 110
}Send a photo
Upload the file first, then attach it by ID. A message can have up to 10.
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CSMZ7AWBQ04D3J75T9ZN' \
-d '{
"conversation_id": "cnv_00000000000000000000000000",
"body": "Middle shelf, restocked.",
"file_ids": [
"fil_01M6V9CS96RRJQEBVXVCKMMR0T"
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CSMZ7AWBQ04D3J75T9ZN",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_00000000000000000000000000",
body: "Middle shelf, restocked.",
file_ids: [
"fil_01M6V9CS96RRJQEBVXVCKMMR0T",
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSMZ7AWBQ04D3J75T9ZN
{
"conversation_id": "cnv_00000000000000000000000000",
"body": "Middle shelf, restocked.",
"file_ids": [
"fil_01M6V9CS96RRJQEBVXVCKMMR0T"
]
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSMZHBMHHRHD944TA33C
{
"result": {
"message_id": "msg_01M6V9CSMZCPCNEC9EM5YQPJZP"
},
"version": 111
}Reply in a thread
A thread stays under its first message, so the main conversation stays short.
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CSN531GSGCW296JHBDVV' \
-d '{
"conversation_id": "cnv_00000000000000000000000000",
"body": "We'\''re out of **rice** though.",
"thread_root_message_id": "msg_01M6V9CSMZCPCNEC9EM5YQPJZP",
"format": "markdown"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CSN531GSGCW296JHBDVV",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_00000000000000000000000000",
body: "We're out of **rice** though.",
thread_root_message_id: "msg_01M6V9CSMZCPCNEC9EM5YQPJZP",
format: "markdown",
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSN531GSGCW296JHBDVV
{
"conversation_id": "cnv_00000000000000000000000000",
"body": "We're out of **rice** though.",
"thread_root_message_id": "msg_01M6V9CSMZCPCNEC9EM5YQPJZP",
"format": "markdown"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSN52SH3WG73S9XAWCWW
{
"result": {
"message_id": "msg_01M6V9CSN5T718Z3H3SD8CW3D0"
},
"version": 112
}Send a message in a topic
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/chat.message.send' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CSNYQC1K0XPT9FTHEBKN' \
-d '{
"conversation_id": "cnv_01M6V9CSNXY07QQP2MFR78VN9K",
"body": "Lake cabin the second week of July? Nia found one with a dock."
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/chat.message.send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CSNYQC1K0XPT9FTHEBKN",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
conversation_id: "cnv_01M6V9CSNXY07QQP2MFR78VN9K",
body: "Lake cabin the second week of July? Nia found one with a dock.",
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/chat.message.send HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSNYQC1K0XPT9FTHEBKN
{
"conversation_id": "cnv_01M6V9CSNXY07QQP2MFR78VN9K",
"body": "Lake cabin the second week of July? Nia found one with a dock."
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSNYP585Y3B5D2B498TY
{
"result": {
"message_id": "msg_01M6V9CSNYDRWCJMP0BFEJ1TQD"
},
"version": 118
}For Rigel#
Rigel's tool for this command is chat_message_send. Rigel runs this on its own, then says what it did. The agent guide has the rest.