Skip to main content
The Flux API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes.

Base URL

https://api.flux.dev/v1

Authentication

The Flux API uses API keys to authenticate requests. Include your key in the Authorization header:
Authorization: Bearer sk_live_your_api_key
All API requests must be made over HTTPS. Requests over HTTP will fail.

Request Format

For POST and PUT requests, encode parameters as JSON:
curl -X POST https://api.flux.dev/v1/events \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"type": "user.signup", "data": {"userId": "123"}}'

Response Format

All responses return JSON. Successful responses include the requested resource:
{
  "id": "evt_1a2b3c4d",
  "type": "user.signup",
  "created": "2024-01-15T10:30:00Z",
  "data": {
    "userId": "123"
  }
}
List endpoints return paginated results:
{
  "data": [...],
  "hasMore": true,
  "nextCursor": "cur_abc123"
}

Errors

Errors return a consistent structure with an error code and message:
{
  "error": {
    "code": "invalid_request",
    "message": "The 'type' field is required",
    "param": "type"
  }
}

HTTP Status Codes

CodeDescription
200Success
201Created
400Bad Request — Invalid parameters
401Unauthorized — Invalid API key
404Not Found — Resource doesn’t exist
429Rate Limited — Too many requests
500Server Error — Something went wrong

Pagination

List endpoints support cursor-based pagination:
GET /v1/events?limit=50&cursor=cur_abc123
ParameterDescription
limitNumber of items to return (max 100)
cursorCursor for the next page

Rate Limiting

The API is rate limited based on your plan. When rate limited, you’ll receive a 429 response with a Retry-After header indicating when to retry.