API Reference8 min read

API Authentication & Keys

How to authenticate with the Carfluence API using JWT tokens or API keys, including scopes and rate limits.

APIauthenticationJWTAPI keyssecuritytokens

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/v1

Method 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:

ScopeDescription
inventory:readRead vehicle inventory
inventory:writeCreate/update inventory records
dealers:readRead dealer information
dealers:writeCreate/update dealers
integrations:readView integration configs
integrations:writeManage integrations
rules:readView transformation rules
rules:writeCreate/update rules
adminFull 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

StatusMeaning
401Missing or invalid authentication
403Authenticated but insufficient permissions/scopes
429Rate limit exceeded
Last updated: December 20, 2025