Skip to content
merran
GitHubInstall

Merran documentation API & integrations

Set up the server

POST
/api/auth/setup
curl --request POST \
--url http://localhost:3000/api/auth/setup \
--header 'Content-Type: application/json' \
--data '{ "name": "Sam Rivera", "email": "sam@example.com", "username": "sam", "password": "correct horse battery staple", "code": "ABCD-EFGH-JKMN", "household": "The Riveras" }'

Makes the first account, which is the server admin, and its household, then signs in. Needs the setup code printed in the server’s log.

Media typeapplication/json
object
name
required
string
>= 1 characters <= 100 characters
email
required
string format: email
username
required
string
>= 3 characters <= 30 characters /^[a-zA-Z0-9_.]+$/
password
required
string
>= 10 characters <= 128 characters
code
required
string
>= 1 characters
household
required
string
>= 1 characters <= 100 characters

Example

{
"name": "Sam Rivera",
"email": "sam@example.com",
"username": "sam",
"password": "correct horse battery staple",
"code": "ABCD-EFGH-JKMN",
"household": "The Riveras"
}

Set up, and signed in.

Media typeapplication/json
object
id
required
string
name
required
string
email
required
string
username
required
string | null
serverAdmin
required
boolean
households
required
Array<object>
object
id
required
string
name
required
string
role
required
string
Allowed values: owner admin member
activeHouseholdId
required
string | null

Example

{
"id": "0199e8b0-5a10-7a01-8b00-000000000001",
"name": "Sam Rivera",
"email": "sam@example.com",
"username": "sam",
"serverAdmin": true,
"households": [
{
"id": "0199e8b0-5a10-7a01-8b00-000000000003",
"name": "The Riveras",
"role": "owner"
}
],
"activeHouseholdId": "0199e8b0-5a10-7a01-8b00-000000000003"
}

Something’s wrong with what was sent, or the code.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string

Example

{
"error": {
"code": "not_found",
"message": "There's nothing here.",
"fields": {
"name": "Give it a name."
}
}
}

The server’s already set up.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string

Example

{
"error": {
"code": "not_found",
"message": "There's nothing here.",
"fields": {
"name": "Give it a name."
}
}
}

Too many wrong codes. Try again in a few minutes.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string

Example

{
"error": {
"code": "not_found",
"message": "There's nothing here.",
"fields": {
"name": "Give it a name."
}
}
}

© 2026 Kyle Johnson. Documentation: CC BY 4.0. Merran: AGPL-3.0-or-later.