API Authentication & Keys
The Carfluence API supports two authentication methods: JWT tokens for user sessions and API keys for programmatic access.
Base URL
https://app.carfluence.io/api/v1Method 1: JWT Token Authentication
Best for: Dashboard sessions, user-facing applications.
Login:
bash
POST /api/v1/auth/login
Content-Type: application/json
{
"email": "[email protected]",
"password": "your-password"
}Response:
json
{
"token": "eyJhbGciOiJSUzI1NiIs...",
"user": {
"id": "uuid",
"email": "[email protected]",
"name": "John Doe"
}
}Using the token:
bash
GET /api/v1/inventory
Authorization: Bearer eyJhbGciOiJSUzI1NiIs...Refresh an expired token:
bash
POST /api/v1/auth/refresh
Content-Type: application/json
{
"refreshToken": "your-refresh-token"
}Method 2: API Key Authentication
Best for: Server-to-server integrations, CI/CD, automated scripts.
Create an API key:
bash
POST /api/v1/api-keys
Authorization: Bearer <admin-jwt>
Content-Type: application/json
{
"name": "Partner Integration Key",
"scopes": ["inventory:read", "dealers:read"],
"rateLimitPerHour": 1000
}Available Scopes:
| Scope | Description |
|---|---|
inventory:read | Read vehicle inventory |
inventory:write | Create/update inventory records |
dealers:read | Read dealer information |
dealers:write | Create/update dealers |
integrations:read | View integration configs |
integrations:write | Manage integrations |
rules:read | View transformation rules |
rules:write | Create/update rules |
admin | Full administrative access |
Using an API key:
bash
GET /api/v1/inventory
X-API-Key: cf_live_abc123def456...Rate Limiting
- •Default: 1000 requests per hour per key
- •Configurable per API key at creation time
- •Rate limit headers included in every response:
- •
X-RateLimit-Limit: Your limit - •
X-RateLimit-Remaining: Requests remaining - •
X-RateLimit-Reset: Unix timestamp when the window resets
Error Responses
| Status | Meaning |
|---|---|
401 | Missing or invalid authentication |
403 | Authenticated but insufficient permissions/scopes |
429 | Rate limit exceeded |