Get the household's email address, making it if needed
email.setup
POST/api/v1/households/{household_id}/email/setup
- Route
Returns the household's default email address. If it has none, makes one on Rigel's domain from the household's name (the Okafors get okafors@mail.rigel.house; a number is added if another household has it). Safe to repeat.
Parameters#
| Field | Description |
|---|---|
household_idpathstringrequired | The household's ID. |
Response#
200 The default address.
| Field | Description |
|---|---|
email_address_idstringrequired | The address. |
addressstringrequired | The address itself. |
display_namestringrequired | The name on mail sent from it. |
Errors#
Every error has the same envelope: error.code, error.message, error.details, error.recovery and error.request_id.
| Status | Code | When |
|---|---|---|
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.
Get the household's email address
Returns the default address. A household with none gets one on Rigel's domain, made from its name, so it is safe to repeat.
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/email/setup' \
-H "Cookie: rigel_session=$RIGEL_SESSION"const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/email/setup", {
method: "POST",
headers: {
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/email/setup HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSQDPNG5NDZH8681DCTJ
{
"email_address_id": "eml_01M6V9CSQB5Y3M8ETS3YPHFPA1",
"address": "home@okafors.example.com",
"display_name": "The Okafors"
}