Flipswitch

API Reference

Complete API reference for Flipswitch Admin and Flag APIs

API Reference

Flipswitch provides two main APIs:

Authentication

Admin API

The Admin API uses JWT Bearer tokens for authentication:

curl https://api.flipswitch.dev/api/admin/projects \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

To obtain a token, authenticate via the /api/v1/auth/login endpoint or through the dashboard.

Flag API

The Flag API uses API keys via the X-API-Key header:

curl -X POST https://api.flipswitch.dev/ofrep/v1/evaluate/flags/dark-mode \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"context": {"targetingKey": "user-123"}}'

API keys are generated per-environment in the dashboard.

Base URLs

EnvironmentURL
Productionhttps://api.flipswitch.dev
Self-hostedYour configured server URL

Rate Limits

APILimit
Admin API1000 requests/minute
Flag API10000 requests/minute

Rate limit headers are included in responses:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640000000

Error Responses

All errors follow a consistent format:

{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "Invalid flag key format",
    "details": {
      "field": "key",
      "constraint": "must be kebab-case"
    }
  }
}

Error Codes

CodeHTTP StatusDescription
INVALID_REQUEST400Malformed request or validation error
UNAUTHORIZED401Missing or invalid authentication
FORBIDDEN403Insufficient permissions
NOT_FOUND404Resource not found
CONFLICT409Resource already exists
RATE_LIMITED429Rate limit exceeded
INTERNAL_ERROR500Server error

On this page