Skip to Content
API ReferenceAuthentication

Authentication

Register

Create a new account.

POST /api/v1/auth/register

Body:

{ "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/login

Body:

{ "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-verification

Body:

{ "email": "user@example.com" }

Verify Email

GET /api/v1/auth/verify?token=VERIFICATION_TOKEN

OAuth Login

Redirect users to these URLs to start OAuth flow:

GET /api/v1/auth/github/login GET /api/v1/auth/google/login

The callback URLs handle the exchange automatically:

GET /api/v1/auth/github/callback GET /api/v1/auth/google/callback

Get Current User

Get the authenticated user’s profile.

GET /api/v1/auth/me Authorization: Bearer TOKEN

Response: 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 TOKEN

You must delete all projects, databases, and storage buckets before deleting your account.