Skip to content
Rigel docs
Open Rigel

Create a household

households.create

POST/api/v1/households

  • Route

Creates a household with you as its admin, and adds you to its family.

Request body#

JSON, as application/json.

Create a household: request body fields
FieldDescription
namestringrequired

What the household calls itself, such as "The Okafors".

1 to 80 characters
time_zonestringrequired

IANA time zone, such as America/New_York.

at least 1 character

Response#

201 The new household.

Create a household: response fields
FieldDescription
idstringrequired

The household's ID.

namestringrequired

What the household calls itself.

time_zonestringrequired

IANA time zone, such as America/New_York.

roleone of: adminrequired

Your role there: admin (the only role for now).

Errors#

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

Create a household: errors
StatusCodeWhen
400validation_failedA field is missing, misspelled or out of range. details.fields lists each problem.
401unauthenticatedThe request has no valid session.

Examples#

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

Create a household

You become its admin, and your own person is added to the family.

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

{
  "name": "The Okafors",
  "time_zone": "America/Chicago"
}
Response, 201
HTTP/1.1 201 Created
Content-Type: application/json
X-Request-Id: req_01M6V9CS6DJNA2ST949WNQ7PTT

{
  "id": "hh_01M6V9CS6GGVFCY7NAS8ZTQV95",
  "name": "The Okafors",
  "time_zone": "America/Chicago",
  "role": "admin"
}

A time zone that doesn't exist

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

{
  "name": "The Okafors",
  "time_zone": "Chicago"
}
Response, 400
HTTP/1.1 400 Bad Request
Content-Type: application/json
X-Request-Id: req_01M6V9CS6WF40PJGRAH78QRPMX

{
  "error": {
    "code": "validation_failed",
    "message": "The request has invalid fields. No changes were applied.",
    "details": {
      "fields": [
        {
          "field": "time_zone",
          "problem": "must be an IANA time zone, such as America/New_York"
        }
      ]
    },
    "recovery": "Correct each field listed in details.fields, then send the request again.",
    "request_id": "req_01M6V9CS6WF40PJGRAH78QRPMX"
  }
}

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