Skip to main content
POST
/
auth
/
signup-email
Sign up with email
curl --request POST \
  --url https://api.example.com/auth/signup-email \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "<string>",
  "password": "<string>",
  "name": "<string>"
}
'
{
  "token": "<string>",
  "message": "<string>"
}
Creates a new user account using an email and password. The user is registered in Firebase Authentication and then stored in MongoDB. Returns a JWT token on success.
This endpoint does not require authentication.

Request body

email
string
required
The user’s email address. Must be unique across all accounts — including those registered via Google.
password
string
required
The password for the new account. Passed to Firebase Authentication; Courser does not store it directly.
name
string
required
The user’s display name. Stored on the MongoDB user record.

Response

200 — Success

token
string
required
A signed JWT valid for 1000 days. Pass this value in the x-access'courser-auth-token header on authenticated requests.
message
string
required
Always "Login successful".

409 — Email already in use

message
string
"Email already in use"

500 — Error creating account

Returned when Firebase Authentication or the MongoDB save operation fails.
message
string
"Error creating account"

Example

curl --request POST \
  --url http://localhost:8000/auth/signup-email \
  --header 'Content-Type: application/json' \
  --data '{
    "email": "[email protected]",
    "password": "securepassword123",
    "name": "Dr. Jane Smith"
  }'
200
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "message": "Login successful"
}
409
{
  "message": "Email already in use"
}
500
{
  "message": "Error creating account"
}

Build docs developers (and LLMs) love