Authentication Endpoints

POST /auth/register

Register a new user.

{
  "email": "user@example.com",
  "password": "securepassword",
  "name": "John Doe"
}

Response (201):

{
  "id": "user_123",
  "email": "user@example.com",
  "name": "John Doe"
}

POST /auth/login

Login and get access token.

{
  "email": "user@example.com",
  "password": "securepassword"
}

Response (200):

{
  "access_token": "eyJhbGciOiJIUzI1NiIs...",
  "token_type": "bearer",
  "expires_in": 86400
}

POST /auth/logout

Logout and invalidate token.

Headers: Authorization: Bearer <jwt>

Programmatic Access (API Keys)

For server-side integrations or automation scripts, you can use API Keys. Unlike the short-lived JWT tokens used in the dashboard, API Keys are permanent (until revoked) and identified by an x-api-key header.

Headers: x-api-key: chat_...

Example Usage

curl -X POST https://api.yoursite.com/projects/{id}/ingestion/url   -H "x-api-key: chat_your_key_here"   -H "Content-Type: application/json"   -d '{"url": "https://docs.example.com"}'