Authentication
Authenticate requests using API keys. Include your key in the Authorization header as a Bearer token.
Examples in:
POST
/api/v1/auth/tokenExchange API key for a short-lived access token (1 hour TTL).
Request Body
{
"api_key": "cb_live_abc123..."
}Response
{
"token": "eyJhbG...",
"expires_in": 3600,
"token_type": "Bearer"
}Code Example (cURL)
curl -X POST "https://api.commbridge.com/api/v1/auth/token" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "api_key": "cb_live_abc123..."}'GET
/api/v1/auth/meGet the authenticated user's profile and company information.
Response
{
"id": "uuid",
"email": "[email protected]",
"company": {
"id": "uuid",
"name": "Acme Trading",
"trust_tier": "gold",
"trust_score": 85
}
}Code Example (cURL)
curl -X GET "https://api.commbridge.com/api/v1/auth/me" \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json"
Rate Limiting
The CommBridge API uses token bucket rate limiting. When you exceed your rate limit, the API will return a 429 Too Many Requests response.
Free
100 requests/minute
Burst: 20 requests/second
Pro
1,000 requests/minute
Burst: 100 requests/second
Enterprise
10,000 requests/minute
Burst: 500 requests/second
Rate limit headers are included in every response: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
Error Codes
| Code | Status | Description |
|---|---|---|
| 400 | Bad Request | Invalid request parameters or body |
| 401 | Unauthorized | Missing or invalid API key / token |
| 403 | Forbidden | Insufficient permissions for this action |
| 404 | Not Found | Requested resource does not exist |
| 409 | Conflict | Resource state conflict (e.g., duplicate) |
| 422 | Unprocessable | Validation error on request body |
| 429 | Rate Limited | Too many requests, slow down |
| 500 | Server Error | Internal error, contact support |