Authentication
All API access is secured via JWT tokens or API keys.
Register
Create a new client account.
POST /api/auth/register
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Valid email address |
name | string | Yes | Client display name |
password | string | Yes | Minimum 8 characters |
Example
curl -X POST https://intelligence.cognitera.ai/api/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "john@example.com",
"name": "John Doe",
"password": "securepassword123"
}'
Response
{
"accessToken": "eyJhbGciOiJIUzI1NiIs...",
"client": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "john@example.com",
"name": "John Doe",
"role": "client"
}
}
Login
Authenticate and receive a JWT token.
POST /api/auth/login
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Your email address |
password | string | Yes | Your password |
Response
Same structure as Register.
Generate API Key
Create a persistent API key for programmatic access.
POST /api/auth/api-keys
Requires: Authorization: Bearer YOUR_JWT_TOKEN
Response
{
"apiKey": "ci_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
}
caution
Store your API key securely. It cannot be retrieved again once generated. Generating a new key invalidates the previous one.
Using Tokens
Include the JWT token in the Authorization header for all authenticated requests:
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
Tokens expire after 24 hours. Use the login endpoint to obtain a fresh token.