The household's calendars
calendar.calendar.list
GET/api/v1/households/{household_id}/queries/calendar.calendar.list
- Query
- Rigel runs it
Every calendar in the order shown, with its color, owner, whether it's the default, visible or busy-only, how many events it has (a repeating event counts once), and, if it's linked to a Google calendar, the link in words.
Parameters#
| Field | Description |
|---|---|
household_idpathstringrequired | The household's ID. |
Response#
200 The answer.
| Field | Description |
|---|---|
itemsarray of objectsrequired | |
items[].idstringrequired | A calendar ID, such as cal_01JC0000000000000000000000. |
items[].namestringrequired | No description. |
items[].colorone of: calendar-1, calendar-2, calendar-3, calendar-4, calendar-5, calendar-6, calendar-7, calendar-8required | No description. |
items[].ownerobject or nullrequired | Whose calendar it is, or null for a shared one. |
items[].owner.idstringrequired | A person ID, such as per_01JC0000000000000000000000. |
items[].owner.namestringrequired | No description. |
items[].is_defaultbooleanrequired | No description. |
items[].is_visiblebooleanrequired | No description. |
items[].is_busy_onlybooleanrequired | No description. |
items[].event_countintegerrequired | Events on it, counting a repeating event once. |
items[].googleobject or nullrequired | The Google calendar it's linked to, or null. |
items[].google.directionone of: both, import, exportrequired | No description. |
items[].google.summarystringrequired | In words, such as "Synced both ways with Work on ben@example.com". |
items[].google.google_calendarstring or nullrequired | Google's name for the calendar. |
items[].google.accountstring or nullrequired | The Google account's address. |
items[].google.problemstring or nullrequired | What's wrong with syncing it, in words, or null. |
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 | not_found | The household doesn't exist, or you aren't a member of it. |
Examples#
These are real. Each was recorded from a sample household, the Okafors, running through the whole API when this site was built.
List the calendars
curl 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/calendar.calendar.list' \
-H "Cookie: rigel_session=$RIGEL_SESSION"const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/calendar.calendar.list", {
headers: {
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
});
const data = await response.json();GET /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/calendar.calendar.list HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSHGZWN1RRZ16W5ZWYMF
{
"items": [
{
"id": "cal_01M6V9CS6RESEHY2KVBGF3JX5Q",
"name": "Family",
"color": "calendar-1",
"owner": null,
"is_default": true,
"is_visible": true,
"is_busy_only": false,
"event_count": 0,
"google": null
},
{
"id": "cal_01M6V9CS6R7BJ7D0KVCQQH1DCS",
"name": "Ada Okafor",
"color": "calendar-2",
"owner": {
"id": "per_01M6V9CS6RX26JK5KVYGRN22D2",
"name": "Ada Okafor"
},
"is_default": false,
"is_visible": true,
"is_busy_only": false,
"event_count": 0,
"google": null
}
]
}For Rigel#
Rigel's tool for this query is calendar_calendar_list. Rigel runs this on its own, then says what it did. The agent guide has the rest.