Authentication

PrivaBase uses JWT Bearer tokens for user authentication and API keys for server-to-server access.

Auth Methods

MethodHeaderUse Case
JWT TokenAuthorization: Bearer <token>User sessions, dashboard
API KeyX-API-Key: <key>Server-to-server, automation

Endpoints (14)

POST /auth/signup
Create a new account. Also available at /auth/register.

Request Body

FieldTypeRequiredDescription
emailstringYesEmail address
passwordstringYesPassword (min 8 chars)
namestringNoDisplay name
curl -X POST https://api.privabase.com/api/v1/auth/signup \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com", "password": "SecurePass123!"}'

Response

{
  "success": true,
  "data": {
    "token": "eyJhbGciOi...",
    "user": { "id": "uuid", "email": "user@example.com" }
  }
}
POST /auth/login
Authenticate with email and password. Returns JWT token.

Request Body

FieldTypeRequired
emailstringYes
passwordstringYes
curl -X POST https://api.privabase.com/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com", "password": "SecurePass123!"}'
POST /auth/refresh
Refresh an expiring JWT token. Send the current token in the Authorization header.
curl -X POST https://api.privabase.com/api/v1/auth/refresh \
  -H "Authorization: Bearer YOUR_TOKEN"
POST /auth/logout
Invalidate the current session token.
curl -X POST https://api.privabase.com/api/v1/auth/logout \
  -H "Authorization: Bearer YOUR_TOKEN"
POST /auth/forgot-password
Send a password reset email.

Request Body

{ "email": "user@example.com" }
POST /auth/reset-password
Reset password using the token from the reset email.

Request Body

{ "token": "reset-token-from-email", "password": "NewSecurePass456!" }
GET /auth/verify-email
Verify email address. Called via the link in the verification email.

Query Parameters

ParamDescription
tokenVerification token from email
POST /auth/resend-verification ๐Ÿ”’
Resend the email verification link. Requires authentication.
GET /auth/account ๐Ÿ”’
Get current account details.
curl https://api.privabase.com/api/v1/auth/account \
  -H "Authorization: Bearer YOUR_TOKEN"
GET /auth/usage ๐Ÿ”’
Get API usage statistics for the current account.

API Keys

API keys are for server-to-server access. They don't expire but can be revoked.

POST /auth/api-keys ๐Ÿ”’
Create a new API key.

Request Body

{ "name": "Production Server" }

Response

{
  "success": true,
  "data": {
    "id": "key-uuid",
    "name": "Production Server",
    "key": "pb_live_abc123...",
    "createdAt": "2026-03-13T..."
  }
}
โš ๏ธ Save your key

The full API key is only shown once at creation. Store it securely.

GET /auth/api-keys ๐Ÿ”’
List all API keys for the current account.
DELETE /auth/api-keys/:id ๐Ÿ”’
Revoke an API key.
curl -X DELETE https://api.privabase.com/api/v1/auth/api-keys/key-uuid \
  -H "Authorization: Bearer YOUR_TOKEN"