Remember something new about a person or the household
family.note.record
POST/api/v1/households/{household_id}/commands/family.note.record
- Command
- Rigel runs it
- Applies offline
Records one thing worth remembering. person_id null means the whole household. Give app only when the note matters to just that app.
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 |
|---|---|
person_idstring or nulloptional | Who it's about, or null for the whole household. |
textstringrequired | The note, as written, 1–1,000 characters, standing on its own: "Doesn't like carrots". |
appone of: meals, recipes, shopping, inventory, calendar, email, tasks, documents, chat, maintenance, null or nulloptional | An app: meals (meal planning), recipes, shopping, inventory, calendar, email, tasks, documents, chat, or maintenance (home maintenance). |
Response#
200 The command was applied.
| Field | Description |
|---|---|
resultobjectrequired | What the command returned, such as the IDs it created. |
result.note_idstringrequired | The new note. |
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 | person_not_found | About someone who isn't there. |
404 | not_found | The household doesn't exist, or you aren't a member of it. |
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.
A note about a person, noted now
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/family.note.record' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"person_id": "per_01JC000000000000000000000A",
"text": "Doesn'\''t like carrots"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/family.note.record", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
person_id: "per_01JC000000000000000000000A",
text: "Doesn't like carrots",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/family.note.record HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"person_id": "per_01JC000000000000000000000A",
"text": "Doesn't like carrots"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0MX70R7FWCDZ7XW8J
{
"result": {
"note_id": "fnt_01JC4N0000MBGE5RJ6Q7V6V6T8"
},
"version": 1
}A note about the whole household, for one app
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/family.note.record' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"text": "We don'\''t cook on Fridays",
"app": "meals"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/family.note.record", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
text: "We don't cook on Fridays",
app: "meals",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/family.note.record HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"text": "We don't cook on Fridays",
"app": "meals"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R07XPNK62M3YMQJQWT
{
"result": {
"note_id": "fnt_01JC4N0000MBGE5RJ6Q7V6V6T8"
},
"version": 1
}About someone who isn't there
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/family.note.record' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"person_id": "per_01JC000000000000000000000A",
"text": "Doesn'\''t like carrots"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/family.note.record", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
person_id: "per_01JC000000000000000000000A",
text: "Doesn't like carrots",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/family.note.record HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"person_id": "per_01JC000000000000000000000A",
"text": "Doesn't like carrots"
}HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0WMHVTRA7NHYG0KPC
{
"error": {
"code": "person_not_found",
"message": "That person isn't in the household any more. No changes were applied.",
"details": {
"person_id": "per_01JC000000000000000000000A"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R0WMHVTRA7NHYG0KPC"
}
}Remember something about a person
Notes can be about one person and tied to one app.
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CS7ET13SP1N80WJX7ERS' \
-d '{
"person_id": "per_01M6V9CS7CDAEP5VDA5T8R9TG6",
"text": "Theo isn'\''t into spicy food lately.",
"app": "meals"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CS7ET13SP1N80WJX7ERS",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
person_id: "per_01M6V9CS7CDAEP5VDA5T8R9TG6",
text: "Theo isn't into spicy food lately.",
app: "meals",
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CS7ET13SP1N80WJX7ERS
{
"person_id": "per_01M6V9CS7CDAEP5VDA5T8R9TG6",
"text": "Theo isn't into spicy food lately.",
"app": "meals"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CS7EPG1FS7GJVABY60A7
{
"result": {
"note_id": "fnt_01M6V9CS7E9NAJKGNWG7KBC8P4"
},
"version": 5
}Remember what a child is into
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CS7GBPYVJRF6DBKRG41R' \
-d '{
"person_id": "per_01M6V9CS79TMYHDAM7FTA9ZK3Z",
"text": "Nia wants to learn to bake. She likes measuring the flour.",
"app": "recipes"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CS7GBPYVJRF6DBKRG41R",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
person_id: "per_01M6V9CS79TMYHDAM7FTA9ZK3Z",
text: "Nia wants to learn to bake. She likes measuring the flour.",
app: "recipes",
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CS7GBPYVJRF6DBKRG41R
{
"person_id": "per_01M6V9CS79TMYHDAM7FTA9ZK3Z",
"text": "Nia wants to learn to bake. She likes measuring the flour.",
"app": "recipes"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CS7GESM8VJK3T2D6567G
{
"result": {
"note_id": "fnt_01M6V9CS7GXFHGYGZ4CFZG4J38"
},
"version": 6
}Remember a food someone avoids
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CS7HEVDCVGXVT8CAPYN3' \
-d '{
"person_id": "per_01M6V9CS744BQQH188FS6CXY9W",
"text": "Ben doesn'\''t eat shellfish.",
"app": "meals"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CS7HEVDCVGXVT8CAPYN3",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
person_id: "per_01M6V9CS744BQQH188FS6CXY9W",
text: "Ben doesn't eat shellfish.",
app: "meals",
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CS7HEVDCVGXVT8CAPYN3
{
"person_id": "per_01M6V9CS744BQQH188FS6CXY9W",
"text": "Ben doesn't eat shellfish.",
"app": "meals"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CS7HPTA0CX7S9CE8A42H
{
"result": {
"note_id": "fnt_01M6V9CS7HSE0X6FSYVAC690KF"
},
"version": 7
}Remember something about the whole household
Leave person_id out and the note is for everyone.
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CS7K8WDAG1ASKEZGDZJF' \
-d '{
"text": "Dinner is at 6:00 pm on weeknights.",
"app": "meals"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CS7K8WDAG1ASKEZGDZJF",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
text: "Dinner is at 6:00 pm on weeknights.",
app: "meals",
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CS7K8WDAG1ASKEZGDZJF
{
"text": "Dinner is at 6:00 pm on weeknights.",
"app": "meals"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CS7KETTRY5Q77G9QNZR9
{
"result": {
"note_id": "fnt_01M6V9CS7KC15H3QT502N0J25K"
},
"version": 8
}Remember a note that belongs to no app
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CS7MC2JB9XHQN59887EE' \
-d '{
"text": "Saturday mornings are for pancakes."
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CS7MC2JB9XHQN59887EE",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
text: "Saturday mornings are for pancakes.",
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CS7MC2JB9XHQN59887EE
{
"text": "Saturday mornings are for pancakes."
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CS7M6H8Z3PNM1797MMFJ
{
"result": {
"note_id": "fnt_01M6V9CS7MX4PM9SC6Z6NVA2EA"
},
"version": 9
}Remember an idea
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CS7W7YCM491RXHRX83FP' \
-d '{
"text": "Try tacos on Tuesdays.",
"app": "meals"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CS7W7YCM491RXHRX83FP",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
text: "Try tacos on Tuesdays.",
app: "meals",
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CS7W7YCM491RXHRX83FP
{
"text": "Try tacos on Tuesdays.",
"app": "meals"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CS7W0GM69GTVB5R33CCF
{
"result": {
"note_id": "fnt_01M6V9CS7WTZRFRHFAN0EGN39W"
},
"version": 12
}Send a command with an Idempotency-Key
The key is the command's ID. Make a new one for each command, and keep it to retry.
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CTCVRZ6CGXYPSZ46W0FZ' \
-d '{
"text": "Nia wants a bike helmet for her birthday.",
"app": "shopping"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CTCVRZ6CGXYPSZ46W0FZ",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
text: "Nia wants a bike helmet for her birthday.",
app: "shopping",
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CTCVRZ6CGXYPSZ46W0FZ
{
"text": "Nia wants a bike helmet for her birthday.",
"app": "shopping"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CTCVQFM1RPXXC6WSQE6E
{
"result": {
"note_id": "fnt_01M6V9CTCV0DCFSS67A1RVWWTP"
},
"version": 323
}Retry a command with the same key
The same key and body return the stored outcome, with the same version. Nothing is applied twice.
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CTCVRZ6CGXYPSZ46W0FZ' \
-d '{
"text": "Nia wants a bike helmet for her birthday.",
"app": "shopping"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CTCVRZ6CGXYPSZ46W0FZ",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
text: "Nia wants a bike helmet for her birthday.",
app: "shopping",
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CTCVRZ6CGXYPSZ46W0FZ
{
"text": "Nia wants a bike helmet for her birthday.",
"app": "shopping"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CTCWMWY6XP1P0KD8C4W7
{
"result": {
"note_id": "fnt_01M6V9CTCV0DCFSS67A1RVWWTP"
},
"version": 323
}Reuse a key for a different command
A key stands for one command. Using it with another body is refused, and nothing is applied.
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CTCVRZ6CGXYPSZ46W0FZ' \
-d '{
"text": "Theo wants a different present."
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CTCVRZ6CGXYPSZ46W0FZ",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
text: "Theo wants a different present.",
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/family.note.record HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CTCVRZ6CGXYPSZ46W0FZ
{
"text": "Theo wants a different present."
}HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01M6V9CTCXYJR7V0H7PT5TCH9A
{
"error": {
"code": "idempotency_key_reused",
"message": "This Idempotency-Key was already used for a different command. No changes were applied.",
"details": {},
"recovery": "Use a new key for a different command. If you're retrying, send exactly the original body.",
"request_id": "req_01M6V9CTCXYJR7V0H7PT5TCH9A"
}
}For Rigel#
Rigel's tool for this command is family_note_record. Rigel runs this on its own, then says what it did. The agent guide has the rest.