Authentication
Register
Create a new account.
POST /api/v1/auth/registerBody:
{
"email": "user@example.com",
"password": "securepassword",
"name": "John Doe"
}Response: 201
{
"message": "Registration successful. Check your email to verify your account."
}Login
Authenticate and receive a JWT token.
POST /api/v1/auth/loginBody:
{
"email": "user@example.com",
"password": "securepassword"
}Response: 200
{
"token": "eyJhbGciOiJIUzI1NiIs...",
"user": {
"id": "usr_abc123",
"email": "user@example.com",
"name": "John Doe",
"plan": "free",
"verified": true
}
}Resend Verification Email
POST /api/v1/auth/resend-verificationBody:
{
"email": "user@example.com"
}Verify Email
GET /api/v1/auth/verify?token=VERIFICATION_TOKENOAuth Login
Redirect users to these URLs to start OAuth flow:
GET /api/v1/auth/github/login
GET /api/v1/auth/google/loginThe callback URLs handle the exchange automatically:
GET /api/v1/auth/github/callback
GET /api/v1/auth/google/callbackGet Current User
Get the authenticated user’s profile.
GET /api/v1/auth/me
Authorization: Bearer TOKENResponse: 200
{
"id": "usr_abc123",
"email": "user@example.com",
"name": "John Doe",
"plan": "pro",
"verified": true,
"created_at": "2025-01-15T10:30:00Z"
}Delete Account
Permanently delete the authenticated user’s account. Fails if active resources exist.
DELETE /api/v1/auth/account
Authorization: Bearer TOKENYou must delete all projects, databases, and storage buckets before deleting your account.