Sign-Up Endpoint
Overview
This endpoint allows new users to create an account. It validates the input, checks for existing users, creates a new user, and initiates a session.
Request Details
HTTP Method
POST
Route
/api/auth/sign-up
Headers
Header | Value | Required | Description |
---|---|---|---|
Content-Type | application/json | Yes | Indicates JSON request body |
Query Parameters
No query parameters required.
Request Body
Field | Type | Required | Description | Constraints |
---|---|---|---|---|
string | Yes | User's email address | Must be a valid email format | |
password | string | Yes | User's password | Non-empty string |
TypeScript Interface
interface SignUpRequest {
email: string
password: string
}
interface SignUpResponse {
user: {
id: string
primary_email: string
}
loggedInAt: string
}
Python Model
from pydantic import BaseModel, EmailStr
from datetime import datetime
class SignUpRequest(BaseModel):
email: EmailStr
password: str
class UserInfo(BaseModel):
id: str
primary_email: EmailStr
class SignUpResponse(BaseModel):
user: UserInfo
loggedInAt: datetime
cURL Example
curl -X POST https://neptun-webui.vercel.app/api/auth/sign-up \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "yourpassword"
}'