Feature Flags API

Endpoints for creating, reading, updating, and deleting feature flags per environment.

Base URL & auth

Base URL: https://api.koolbase.com/v1

Dashboard endpoints:
  Authorization: Bearer <dashboard_token>

SDK bootstrap (read-only, called by Flutter SDK on init):
  GET /sdk/bootstrap?key=pk_live_...

Endpoints

GET/v1/environments/{env_id}/flagsList all flags for an environment
POST/v1/environments/{env_id}/flagsCreate a new flag
PATCH/v1/environments/{env_id}/flags/{flag_id}Update a flag
DELETE/v1/environments/{env_id}/flags/{flag_id}Delete a flag

POST /v1/environments/{env_id}/flags

// Request
{
  "key": "new_checkout",
  "enabled": false,
  "rollout_percentage": 0,
  "description": "New checkout experience"
}

// Response 201
{
  "id": "uuid",
  "key": "new_checkout",
  "enabled": false,
  "rollout_percentage": 0,
  "description": "New checkout experience",
  "created_at": "2026-01-01T00:00:00Z",
  "updated_at": "2026-01-01T00:00:00Z"
}

PATCH /v1/environments/{env_id}/flags/{flag_id}

// Request — partial update
{
  "enabled": true,
  "rollout_percentage": 25
}

// Response 200 — full updated flag object

Bootstrap endpoint (SDK)

The Flutter SDK calls this single endpoint on init to fetch all flags, config, and version policy in one request:

GET /v1/sdk/bootstrap?key=pk_live_...

// Response 200
{
  "flags": {
    "new_checkout": true,
    "dark_mode": false
  },
  "config": {
    "api_base_url": "https://api.myapp.com",
    "timeout_seconds": 30
  },
  "version_policy": {
    "min_version": "2.1.0",
    "status": "force_update",
    "message": "Please update to continue.",
    "store_url": "https://apps.apple.com/..."
  }
}