Auth API
User registration and API key management
Auth API
Manage API keys. These endpoints handle self-service signup, key info retrieval, and full CRUD operations on API keys. Admin routes require the admin scope; the signup endpoint is public.
POST /v1/auth/signup
Create a free-tier API key (public, no auth required). Rate limited to 3 signups per IP per hour.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Your name (1–128 characters) |
email | string | No | Email address (for key ownership tracking) |
Request
curl -X POST https://api.marketintell.ai/v1/auth/signup \
-H "Content-Type: application/json" \
-d '{
"name": "Your Name",
"email": "[email protected]"
}'Response
{
"success": true,
"data": {
"key": "mi_k_abc123def456...",
"id": "clx...",
"name": "signup:Your Name",
"key_prefix": "mi_k_abc1...",
"scopes": ["read", "chat"],
"rate_limit": 10,
"tier": "free",
"daily_query_limit": 20,
"_message": "Save this API key — it will not be shown again."
}
}Save your API key immediately — it is only returned once at signup. Free-tier keys are limited to 20 queries/day and 10 requests/minute.
GET /v1/auth/me
Get the current API key's info and daily quota. Requires admin scope.
Request
curl https://api.marketintell.ai/v1/auth/me \
-H "X-API-Key: YOUR_API_KEY"Response
{
"success": true,
"data": {
"key": {
"id": "clx...",
"name": "signup:Your Name",
"key_prefix": "mi_k_abc1...",
"scopes": ["read", "chat"],
"rate_limit": 10,
"owner": "[email protected]",
"expires_at": null,
"last_used_at": "2025-01-15T14:30:00.000Z",
"is_active": true,
"created_at": "2025-01-15T10:00:00.000Z",
"tier": "free"
},
"quota": {
"tier": "free",
"daily_queries_used": 12,
"daily_queries_remaining": 8,
"daily_queries_limit": 20
}
}
}POST /v1/auth/keys
Create a new API key with specific scopes. Requires admin scope (unless in bootstrap mode — see below).
Bootstrap Mode
If no API keys exist in the database, the first key can be created without authentication. The first key is automatically granted admin scope regardless of what you request.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | A descriptive name (1–128 characters) |
scopes | string[] | No | Permission scopes (defaults to ["read"]) |
owner | string | No | Owner identifier (max 128 characters) |
rate_limit | number | No | Per-key rate limit override (requests/minute) |
expires_at | string | No | Expiration as ISO 8601 datetime |
Request
curl -X POST https://api.marketintell.ai/v1/auth/keys \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"name": "Read-only Dashboard",
"scopes": ["read", "chat"]
}'Response
{
"success": true,
"data": {
"key": "mi_k_xyz789...",
"id": "clx...",
"name": "Read-only Dashboard",
"key_prefix": "mi_k_xyz7...",
"scopes": ["read", "chat"],
"rate_limit": null,
"owner": null,
"expires_at": null,
"created_at": "2025-01-15T12:00:00.000Z"
}
}The full key value is only returned at creation time. Store it securely.
GET /v1/auth/keys
List all API keys (paginated). Requires admin scope.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number |
limit | number | 20 | Items per page (max 100) |
include_revoked | string | "false" | Include revoked keys ("true" / "false") |
owner | string | — | Filter by owner |
Request
curl "https://api.marketintell.ai/v1/auth/keys?page=1&limit=20" \
-H "X-API-Key: YOUR_API_KEY"Response
{
"success": true,
"data": {
"keys": [
{
"id": "clx...",
"name": "Default Admin",
"key_prefix": "mi_k_abc1...",
"scopes": ["admin"],
"rate_limit": null,
"owner": "[email protected]",
"expires_at": null,
"last_used_at": "2025-01-15T14:30:00.000Z",
"is_active": true,
"created_at": "2025-01-15T10:00:00.000Z",
"revoked_at": null
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1,
"total_pages": 1
}
}
}GET /v1/auth/keys/:id
Get details for a specific API key. Requires admin scope.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The key ID |
Request
curl https://api.marketintell.ai/v1/auth/keys/KEY_ID \
-H "X-API-Key: YOUR_API_KEY"Response
{
"success": true,
"data": {
"key": {
"id": "clx...",
"name": "Read-only Dashboard",
"key_prefix": "mi_k_xyz7...",
"scopes": ["read", "chat"],
"rate_limit": null,
"owner": null,
"expires_at": null,
"last_used_at": null,
"is_active": true,
"created_at": "2025-01-15T12:00:00.000Z",
"revoked_at": null
}
}
}PATCH /v1/auth/keys/:id
Update an API key's name, scopes, rate limit, or expiration. Requires admin scope.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The key ID |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | Updated name (1–128 characters) |
scopes | string[] | No | Updated scopes (at least one required if provided) |
rate_limit | number | null | No | Updated rate limit override (requests/minute) |
expires_at | string | null | No | Updated expiration (ISO 8601 datetime, or null to remove) |
Request
curl -X PATCH https://api.marketintell.ai/v1/auth/keys/KEY_ID \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"name": "Dashboard Key",
"scopes": ["read", "chat", "alpha"]
}'Response
{
"success": true,
"data": {
"key": {
"id": "clx...",
"name": "Dashboard Key",
"key_prefix": "mi_k_xyz7...",
"scopes": ["read", "chat", "alpha"],
"rate_limit": null,
"owner": null,
"expires_at": null,
"last_used_at": null,
"is_active": true,
"created_at": "2025-01-15T12:00:00.000Z",
"revoked_at": null
}
}
}DELETE /v1/auth/keys/:id
Revoke an API key. This immediately invalidates the key. Requires admin scope.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The key ID |
Request
curl -X DELETE https://api.marketintell.ai/v1/auth/keys/KEY_ID \
-H "X-API-Key: YOUR_API_KEY"Response
{
"success": true,
"data": {
"id": "clx...",
"revoked": true,
"message": "API key has been revoked"
}
}Revoking a key is permanent. Any service using this key will immediately lose access.
GET /v1/auth/keys/:id/usage
Get usage statistics for a specific API key. Requires admin scope.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The key ID |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
days | number | 30 | Number of days of history (max 365) |
Request
curl "https://api.marketintell.ai/v1/auth/keys/KEY_ID/usage?days=7" \
-H "X-API-Key: YOUR_API_KEY"Response
{
"success": true,
"data": {
"key_id": "clx...",
"key_name": "signup:Your Name",
"period_days": 7
}
}GET /v1/auth/usage
Get global usage summary across all API keys. Requires admin scope.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
days | number | 30 | Number of days of history (max 365) |
Request
curl "https://api.marketintell.ai/v1/auth/usage?days=30" \
-H "X-API-Key: YOUR_API_KEY"Response
{
"success": true,
"data": {
"period_days": 30
}
}Valid Scopes
| Scope | Description |
|---|---|
read | Read access to data endpoints |
write | Write/modify data |
admin | Full administrative access (required for key management) |
alpha | Access alpha signals and scans |
agents | Create and manage autonomous agents |
chat | Access to the Chat API |
webhooks | Manage webhook subscriptions |
Scopes by Tier
| Tier | Scopes | Rate Limit | Daily Queries |
|---|---|---|---|
| Free | read, chat | 10 req/min | 20 |
| Pro | read, chat, alpha, webhooks | 60 req/min | 500 |
| Enterprise | All scopes | 300 req/min | Unlimited |