Skip to content

Overview

The API everything in the console is built on, for scripts and pipelines too. It is served under /api/v1.

Every operation declares what it requires in x-permission: a permission of the catalog, which a caller holds in a project through the roles they were granted there, or one of public (anyone), member (any credential acting for a member) and instance_admin. An API token is further narrowed by its scopes: each permission falls under one scope, and a token exercises it only when it carries that scope. Operations marked x-session-required refuse every API token. Operations marked x-opens-session or x-json-only accept a body sent as application/json only (415 unsupported_media_type otherwise); operations marked x-checks-password accept a body of 8 KiB at most (413 request_too_large otherwise).

A script authenticates with an API token as a bearer; the console with the session cookie POST /auth/sign-in sets. When a request carries both, the token is judged and the cookie ignored. A request authenticated by the cookie, a read included, is refused cross_origin when the browser says it comes from another origin.

Errors are problem documents (RFC 9457) with a stable code. Every answer of this API carries Cache-Control: no-store (the change stream no-cache), whatever its status, since what it holds belongs to one caller and no shared cache may serve it to another. The SDK API’s ruleset is another document, with its own ETag and If-None-Match.

A JSON request body that is not an object, or leaves out a member its schema lists as required (or sets one to null that may not be), is refused 422 invalid with a violation of code required for each such member, by its pointer, before anything is read or changed: a missing boolean or list is never taken for false or empty. Members the schema does not name are accepted and ignored.

Every versioned entity (project, environment, unit type, attribute, flag definition, flag configuration and segment) carries a version, which counts its accepted changes from 1 and is answered as a strong ETag ("7") on every read of the entity and every write. A write changing or deleting one names the version it was based on in If-Match, quoted ("7") or bare (7): without it the write is refused 428 precondition_required, and when the entity moved on since, 412 version_mismatch with the version it has now in current_version, so two people editing the same entity never overwrite each other unseen. Both are judged after the request is validated. The kill switch and the writes of a single override need no If-Match, and still move the configuration’s version on. A write that changes nothing stores nothing, keeps the version, records nothing and answers the entity as it is.

In a protected environment, a write that would change what its SDKs receive, whatever entity it touches, is refused 403 change_request_required, judged after validation and If-Match; nothing of the write is kept, in any environment. The kill switch is the one exception.

Information

  • OpenAPI version: 3.0.3

An API token, fn_pat_… for a personal access token or fn_prj_… for a project token, in the Authorization header. A token in the query string is never read.

Security scheme type: http

The session cookie POST /auth/sign-in sets, for the console, named __Host-flagnetic_session where it is Secure and flagnetic_session otherwise. Ignored when an Authorization header is present.

Security scheme type: apiKey

Cookie parameter name: flagnetic_session