Skip to content
FlagSwiftDocs

API Keys

Create, rotate and revoke the keys your apps and automation use.

What this page is for#

API keys let SDKs and scripts talk to FlagSwift. Each key belongs to one project and can be limited to one environment. There are client, server and admin keys, and the page lists your projects, each with how many keys it has of each type, how many are active or revoked and when a key was last used. Open a project to see its keys in three sections: client, server and admin.

In the console it lives at /api-keys. You see it in the sidebar when your role has api_keys.read.

What you can do#

  • Create a key

    Name it, choose a type, a project, an optional environment and an expiry.

  • Copy the secret

    The full key is shown once when it is created. Admins can copy it later when key storage is enabled.

  • Rotate a key

    Create a new key and keep the old one working for a chosen time, from revoking it immediately up to 7 days. 24 hours is recommended. The dialog describes what will happen, and turns red when the old key stops at once.

  • Revoke a key

    The key stops working at once and cannot be restored. A dialog asks you to confirm and stays open until it is done.

  • Open a project

    Click a project to see its keys in a Client keys, Server keys and Admin keys section. Each section has its own count, empty message and pages of 10, and a button that starts a new key of that type in this project.

  • Find a project or a key

    On the overview, search projects by name. Inside a project, search keys and filter by status and environment; the filters apply to every section.

  • Read the key counts

    A row of cards shows Active, Total keys (with the client, server and admin split), Expiring soon (active keys ending within 30 days), Expired and Revoked. Every key is counted once: a revoked key is Revoked even if it has also expired, and Expiring soon is part of Active. Inside a project the cards count that project only.

  • Audit revoked and expired keys

    Click the Expired or Revoked card to open a read-only table at /api-keys/expired or /api-keys/revoked. It shows the key name, its prefix and last four characters (never the secret), type, project, environment, who created it and when, last used, expiry, when it was revoked or expired with days since, and who revoked it. Search, filter by project, type and date, sort any column, page through 10 at a time, open the key's audit trail, and export the rows you see as a CSV.

Good to know#

  • Seeing the page needs api_keys.read. Creating needs api_keys.create, revoking needs api_keys.revoke and copying a stored key needs api_keys.reveal.
  • Client keys are for browsers and mobile apps and return only on or off results for one user. Server keys are for your backend and must stay secret. Admin keys are for automation that manages flags and must never go in an app.
  • Status filters are Active, Expiring soon, Expired, Revoked and All statuses. It opens on Active.
  • Admin keys are listed only to people who can copy keys (admins). Everyone else sees client and server keys only.
  • Keys for an archived project are switched off.
  • The Expired and Revoked pages need the same api_keys.read permission as the key list, and show the same key types (admin keys only to admins). Revoked and expired keys are kept, not deleted. Keys revoked before the console recorded who revoked them show Not recorded in the Revoked by column.