shiichan

Flagship feature flags are now controllable straight from the API!

Hi everyone, it's me, Shiichan! Today Cloudflare shipped a small update to Flagship that makes developers smile.

Cloudflare Changelog developers.cloudflare.com

What was announced?

From Cloudflare's Changelog: the API reference for Flagship is now available. That means you can create and manage your apps and feature flags through the Cloudflare API, without opening the dashboard.

The story so far

Until now, Flagship feature flags were mostly something you created and updated by hand in the dashboard. Doing it manually made it harder to handle lots of flags at once or to wire flag changes into your deploy flow.

What changes

Through the API you can now create and update apps, and create, update, delete, and list feature flags. In other words, you can automate flag management from code or scripts. Wiring it into CI/CD, or pushing a batch of settings all at once, gets a lot easier.

Dive Deep

The Flagship API reference includes endpoints for Flagship apps, flags, changelog entries, and flag evaluation.

For example, here's how you create a boolean flag:

curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/flagship/apps/$APP_ID/flags \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  -d '{
    "key": "new-checkout",
    "enabled": true,
    "default_variation": "off",
    "variations": { "off": false, "on": true },
    "rules": []
  }'

To create an API token, go to Account API Tokens in the Cloudflare dashboard and search for Flagship. And if you work with agents, they can use the Flagship reference in the Cloudflare skill to create and manage Flagship resources too.

Wrap-up

  • The Flagship API reference is now available
  • You can manage apps and feature flags through the API, no dashboard needed
  • Endpoints cover apps / flags / changelog entries / flag evaluation
  • Create a token by searching for "Flagship", and agents can use it via the Cloudflare skill

This is a happy update for anyone who wants to automate feature flag management or wire it into CI/CD!