Skip to main content
POST /api/auth/signup No authentication required.

Request body

name
string
required
The user’s display name.
email
string
required
The user’s email address. Must be unique across all accounts.
password
string
required
The user’s password. Minimum 6 characters.

Example

curl --request POST \
  --url http://localhost:3000/api/auth/signup \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Maria Silva",
    "email": "[email protected]",
    "password": "s3cr3tpass"
  }'

Response

201 Created
token
string
required
A signed JWT valid for 30 days. Include this token in the Authorization header for authenticated requests.
user
object
required
Example response
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "user": {
    "id": "a3f2c1d0-89b4-4e7a-b6f5-1234567890ab",
    "name": "Maria Silva",
    "email": "[email protected]",
    "points": 0,
    "current_streak": 0,
    "max_streak": 0
  }
}

Errors

StatusDescription
400Email is already in use, or request body fails validation.
500Internal server error.

Build docs developers (and LLMs) love