Skip to content
Rigel docs
Open Rigel

Add an email address

email.addresses_create

POST/api/v1/households/{household_id}/email/addresses

  • Route

Claims an address for the household, on Rigel's domain or one of its custom domains, and records it. Fails with address_taken when any household has it, invalid_address when the name can't be an address, or domain_not_found.

Parameters#

Add an email address: parameters
FieldDescription
household_idpathstringrequired

The household's ID.

Request body#

JSON, as application/json.

Add an email address: request body fields
FieldDescription
local_partstringrequired

The part before the @, such as "home". Letters, digits and . _ - only.

1 to 64 characters
email_domain_idstring or nullrequired

The household's custom domain to put it on, or null for Rigel's own.

display_namestringrequired

The name on mail sent from it, such as "The Okafors". 1–80 characters.

1 to 80 characters

Response#

201 The address was added.

Add an email address: response fields
FieldDescription
email_address_idstringrequired

The new address.

addressstringrequired

The address itself.

Errors#

Every error has the same envelope: error.code, error.message, error.details, error.recovery and error.request_id.

Add an email address: errors
StatusCodeWhen
400validation_failedA field is missing, misspelled or out of range. details.fields lists each problem.
401unauthenticatedThe request has no valid session.
404not_foundThe household doesn't exist, or you aren't a member of it.
409Read error.codeDescribed above.

Examples#

These are real. Each was recorded from a sample household, the Okafors, running through the whole API when this site was built.

Add an email address

A name on one of the household's domains, or on Rigel's when email_domain_id is null.

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/email/addresses' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -d '{
  "local_part": "home",
  "email_domain_id": "emd_01M6V9CSQ63D47MKP7KG4FEBDJ",
  "display_name": "The Okafors"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/email/addresses", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    local_part: "home",
    email_domain_id: "emd_01M6V9CSQ63D47MKP7KG4FEBDJ",
    display_name: "The Okafors",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/email/addresses HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json

{
  "local_part": "home",
  "email_domain_id": "emd_01M6V9CSQ63D47MKP7KG4FEBDJ",
  "display_name": "The Okafors"
}
Response, 201
HTTP/1.1 201 Created
Content-Type: application/json
X-Request-Id: req_01M6V9CSQ9K91Q609HTVPBAZ1R

{
  "email_address_id": "eml_01M6V9CSQB5Y3M8ETS3YPHFPA1",
  "address": "home@okafors.example.com"
}

Add an address for receipts

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/email/addresses' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -d '{
  "local_part": "receipts",
  "email_domain_id": "emd_01M6V9CSQ63D47MKP7KG4FEBDJ",
  "display_name": "Okafor receipts"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/email/addresses", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    local_part: "receipts",
    email_domain_id: "emd_01M6V9CSQ63D47MKP7KG4FEBDJ",
    display_name: "Okafor receipts",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/email/addresses HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json

{
  "local_part": "receipts",
  "email_domain_id": "emd_01M6V9CSQ63D47MKP7KG4FEBDJ",
  "display_name": "Okafor receipts"
}
Response, 201
HTTP/1.1 201 Created
Content-Type: application/json
X-Request-Id: req_01M6V9CSS7GXW1JPJT2J5H4RFY

{
  "email_address_id": "eml_01M6V9CSS8GN4S0XWFK70XY4ZJ",
  "address": "receipts@okafors.example.com"
}

Add an address that is taken

Addresses are unique across all households.

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/email/addresses' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -d '{
  "local_part": "home",
  "email_domain_id": "emd_01M6V9CSQ63D47MKP7KG4FEBDJ",
  "display_name": "The Okafors"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/email/addresses", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    local_part: "home",
    email_domain_id: "emd_01M6V9CSQ63D47MKP7KG4FEBDJ",
    display_name: "The Okafors",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/email/addresses HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json

{
  "local_part": "home",
  "email_domain_id": "emd_01M6V9CSQ63D47MKP7KG4FEBDJ",
  "display_name": "The Okafors"
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01M6V9CSSB3CMXSZ07HR4BJ1W1

{
  "error": {
    "code": "address_taken",
    "message": "home@okafors.example.com is already one of your addresses. No changes were applied.",
    "details": {},
    "recovery": "Choose another name.",
    "request_id": "req_01M6V9CSSB3CMXSZ07HR4BJ1W1"
  }
}

Rigel is in early access, and sign-up is by invitation. Open Rigel