Skip to content

Feature flags

Feature flags in the management API. 4 endpoints.

Read the guideOpenAPI 3.1 document

Try it settings

https://api.bifrostorbit.com/cms/manage/v1

The management API takes a management token, which is secret and acts as a person, so nothing here is sent from the docs.

Try it sends each request straight from your browser to the API. The key stays in this page's memory: it is never saved, never sent to docs.bifrostorbit.com and gone when you leave or reload the page. Only reads are run; anything that changes data is described and never sent.

Every flag in every environment

GET/organisations/{organisationId}/spaces/{spaceId}/flagsKey required

Every flag in every environment. Permission: environment:read.

Parameters

  • organisationIdstringpath, required

    The organisation's id, from the Management tokens page.

  • spaceIdstringpath, required

    The space's id.

Responses

  • 200OK{ names, environments: [{ id, name, flags }] }.
    • dataobject

      Fields of data
      • namesstring[]

        Every flag's name.

      • environmentsobject[]

        Fields of environments
        • idstring

          An id.

        • namestring

        • flagsmap of boolean

          Whether each flag is on here.

  • 401UnauthorisedNo token, or a token that is unknown, expired or revoked, or whose person no longer has access.
    • errorobject

      Fields of error
      • codestring

        One of bad_request, unauthorized, forbidden, not_found, created_in_orbit, conflict, validation_failed, internal_error, unavailable.
      • messagestring

        Follows Accept-Language when CMS Orbit has the language.

      • detailsanysometimes

        When there is more to read. On 422, issues: each field that failed, with path, message and code. On a field value that breaks the content type's rules, a list of { path, message }. On a version conflict, currentVersion, expected and received.

  • 403ForbiddenLacks environment:read.
    • errorobject

      Fields of error
      • codestring

        One of bad_request, unauthorized, forbidden, not_found, created_in_orbit, conflict, validation_failed, internal_error, unavailable.
      • messagestring

        Follows Accept-Language when CMS Orbit has the language.

      • detailsanysometimes

        When there is more to read. On 422, issues: each field that failed, with path, message and code. On a field value that breaks the content type's rules, a list of { path, message }. On a version conflict, currentVersion, expected and received.

  • 404Not foundNo such space, or it's in another organisation.
    • errorobject

      Fields of error
      • codestring

        One of bad_request, unauthorized, forbidden, not_found, created_in_orbit, conflict, validation_failed, internal_error, unavailable.
      • messagestring

        Follows Accept-Language when CMS Orbit has the language.

      • detailsanysometimes

        When there is more to read. On 422, issues: each field that failed, with path, message and code. On a field value that breaks the content type's rules, a list of { path, message }. On a version conflict, currentVersion, expected and received.

  • 500Server errorSomething went wrong on our side. Try again in a moment.
    • errorobject

      Fields of error
      • codestring

        One of bad_request, unauthorized, forbidden, not_found, created_in_orbit, conflict, validation_failed, internal_error, unavailable.
      • messagestring

        Follows Accept-Language when CMS Orbit has the language.

      • detailsanysometimes

        When there is more to read. On 422, issues: each field that failed, with path, message and code. On a field value that breaks the content type's rules, a list of { path, message }. On a version conflict, currentVersion, expected and received.

Shell
curl 'https://api.bifrostorbit.com/cms/manage/v1/organisations/6650f1c2a9e4b1d2c3f40a01/spaces/6650f1c2a9e4b1d2c3f40a02/flags' \  -H 'Authorization: Bearer cms_mt_…'

Try it

Management tokens are secret and act as a person, so nothing is sent from the docs.

Example answer

200 OKJSON
{  "data": {    "names": [      "Lofoten sea kayaking"    ],    "environments": [      {        "id": "6650f1c2a9e4b1d2c3f40a40",        "name": "Lofoten sea kayaking",        "flags": {}      }    ]  }}

Adds a flag, off everywhere: { "name": "winter-sale" }

POST/organisations/{organisationId}/spaces/{spaceId}/flagsKey required

Adds a flag, off everywhere: { "name": "winter-sale" }. Permission: environment:manage.

Parameters

  • organisationIdstringpath, required

    The organisation's id, from the Management tokens page.

  • spaceIdstringpath, required

    The space's id.

  • Idempotency-Keystringheader

    Optional. A unique value, such as a UUID, that makes a retry safe: the same key with the same request within 24 hours returns the first answer again, with Idempotent-Replayed: true, instead of making the change twice. The same key with a different request gets 422; while the first request is still running, 409. Only successful answers are kept.

    Up to 255 characters.

Request body

  • namestringrequired

    Lowercase letters, digits and hyphens, up to 48 characters, such as winter-sale.

Responses

  • 200OKThe table.
    • dataobject

      Fields of data
      • namesstring[]

        Every flag's name.

      • environmentsobject[]

        Fields of environments
        • idstring

          An id.

        • namestring

        • flagsmap of boolean

          Whether each flag is on here.

  • 400Bad requestThe body isn't valid JSON. Or not a valid name, or the name is used.
    • errorobject

      Fields of error
      • codestring

        One of bad_request, unauthorized, forbidden, not_found, created_in_orbit, conflict, validation_failed, internal_error, unavailable.
      • messagestring

        Follows Accept-Language when CMS Orbit has the language.

      • detailsanysometimes

        When there is more to read. On 422, issues: each field that failed, with path, message and code. On a field value that breaks the content type's rules, a list of { path, message }. On a version conflict, currentVersion, expected and received.

  • 401UnauthorisedNo token, or a token that is unknown, expired or revoked, or whose person no longer has access.
    • errorobject

      Fields of error
      • codestring

        One of bad_request, unauthorized, forbidden, not_found, created_in_orbit, conflict, validation_failed, internal_error, unavailable.
      • messagestring

        Follows Accept-Language when CMS Orbit has the language.

      • detailsanysometimes

        When there is more to read. On 422, issues: each field that failed, with path, message and code. On a field value that breaks the content type's rules, a list of { path, message }. On a version conflict, currentVersion, expected and received.

  • 403ForbiddenLacks environment:manage, or the token is read only.
    • errorobject

      Fields of error
      • codestring

        One of bad_request, unauthorized, forbidden, not_found, created_in_orbit, conflict, validation_failed, internal_error, unavailable.
      • messagestring

        Follows Accept-Language when CMS Orbit has the language.

      • detailsanysometimes

        When there is more to read. On 422, issues: each field that failed, with path, message and code. On a field value that breaks the content type's rules, a list of { path, message }. On a version conflict, currentVersion, expected and received.

  • 404Not foundNo such space, or it's in another organisation.
    • errorobject

      Fields of error
      • codestring

        One of bad_request, unauthorized, forbidden, not_found, created_in_orbit, conflict, validation_failed, internal_error, unavailable.
      • messagestring

        Follows Accept-Language when CMS Orbit has the language.

      • detailsanysometimes

        When there is more to read. On 422, issues: each field that failed, with path, message and code. On a field value that breaks the content type's rules, a list of { path, message }. On a version conflict, currentVersion, expected and received.

  • 500Server errorSomething went wrong on our side. Try again in a moment.
    • errorobject

      Fields of error
      • codestring

        One of bad_request, unauthorized, forbidden, not_found, created_in_orbit, conflict, validation_failed, internal_error, unavailable.
      • messagestring

        Follows Accept-Language when CMS Orbit has the language.

      • detailsanysometimes

        When there is more to read. On 422, issues: each field that failed, with path, message and code. On a field value that breaks the content type's rules, a list of { path, message }. On a version conflict, currentVersion, expected and received.

Shell
curl -X POST 'https://api.bifrostorbit.com/cms/manage/v1/organisations/6650f1c2a9e4b1d2c3f40a01/spaces/6650f1c2a9e4b1d2c3f40a02/flags' \  -H 'Authorization: Bearer cms_mt_…' \  -H 'Content-Type: application/json' \  -d '{"name":"winter-sale"}'

Try it

Management tokens are secret and act as a person, so nothing is sent from the docs.

Example answer

200 OKJSON
{  "data": {    "names": [      "Lofoten sea kayaking"    ],    "environments": [      {        "id": "6650f1c2a9e4b1d2c3f40a40",        "name": "Lofoten sea kayaking",        "flags": {}      }    ]  }}

Removes it

DELETE/organisations/{organisationId}/spaces/{spaceId}/flags/{name}Key required

Removes it. Permission: environment:manage.

Parameters

  • organisationIdstringpath, required

    The organisation's id, from the Management tokens page.

  • spaceIdstringpath, required

    The space's id.

  • namestringpath, required

    The flag's name, such as winter-sale.

Responses

  • 200OKThe table.
    • dataobject

      Fields of data
      • namesstring[]

        Every flag's name.

      • environmentsobject[]

        Fields of environments
        • idstring

          An id.

        • namestring

        • flagsmap of boolean

          Whether each flag is on here.

  • 401UnauthorisedNo token, or a token that is unknown, expired or revoked, or whose person no longer has access.
    • errorobject

      Fields of error
      • codestring

        One of bad_request, unauthorized, forbidden, not_found, created_in_orbit, conflict, validation_failed, internal_error, unavailable.
      • messagestring

        Follows Accept-Language when CMS Orbit has the language.

      • detailsanysometimes

        When there is more to read. On 422, issues: each field that failed, with path, message and code. On a field value that breaks the content type's rules, a list of { path, message }. On a version conflict, currentVersion, expected and received.

  • 403ForbiddenLacks environment:manage, or the token is read only.
    • errorobject

      Fields of error
      • codestring

        One of bad_request, unauthorized, forbidden, not_found, created_in_orbit, conflict, validation_failed, internal_error, unavailable.
      • messagestring

        Follows Accept-Language when CMS Orbit has the language.

      • detailsanysometimes

        When there is more to read. On 422, issues: each field that failed, with path, message and code. On a field value that breaks the content type's rules, a list of { path, message }. On a version conflict, currentVersion, expected and received.

  • 404Not foundNo such flag, or it's in another organisation.
    • errorobject

      Fields of error
      • codestring

        One of bad_request, unauthorized, forbidden, not_found, created_in_orbit, conflict, validation_failed, internal_error, unavailable.
      • messagestring

        Follows Accept-Language when CMS Orbit has the language.

      • detailsanysometimes

        When there is more to read. On 422, issues: each field that failed, with path, message and code. On a field value that breaks the content type's rules, a list of { path, message }. On a version conflict, currentVersion, expected and received.

  • 500Server errorSomething went wrong on our side. Try again in a moment.
    • errorobject

      Fields of error
      • codestring

        One of bad_request, unauthorized, forbidden, not_found, created_in_orbit, conflict, validation_failed, internal_error, unavailable.
      • messagestring

        Follows Accept-Language when CMS Orbit has the language.

      • detailsanysometimes

        When there is more to read. On 422, issues: each field that failed, with path, message and code. On a field value that breaks the content type's rules, a list of { path, message }. On a version conflict, currentVersion, expected and received.

Shell
curl -X DELETE 'https://api.bifrostorbit.com/cms/manage/v1/organisations/6650f1c2a9e4b1d2c3f40a01/spaces/6650f1c2a9e4b1d2c3f40a02/flags/winter-sale' \  -H 'Authorization: Bearer cms_mt_…'

Try it

Management tokens are secret and act as a person, so nothing is sent from the docs.

Example answer

200 OKJSON
{  "data": {    "names": [      "Lofoten sea kayaking"    ],    "environments": [      {        "id": "6650f1c2a9e4b1d2c3f40a40",        "name": "Lofoten sea kayaking",        "flags": {}      }    ]  }}

Turns it on or off: { "on": true }

PUT/organisations/{organisationId}/spaces/{spaceId}/flags/{name}/environments/{environmentId}Key required

Turns it on or off: { "on": true }. Permission: environment:manage.

Parameters

  • organisationIdstringpath, required

    The organisation's id, from the Management tokens page.

  • spaceIdstringpath, required

    The space's id.

  • namestringpath, required

    The flag's name, such as winter-sale.

  • environmentIdstringpath, required

    The environment's id.

  • Idempotency-Keystringheader

    Optional. A unique value, such as a UUID, that makes a retry safe: the same key with the same request within 24 hours returns the first answer again, with Idempotent-Replayed: true, instead of making the change twice. The same key with a different request gets 422; while the first request is still running, 409. Only successful answers are kept.

    Up to 255 characters.

Request body

  • onbooleanrequired

    Anything but true turns it off.

Responses

  • 200OKThe table.
    • dataobject

      Fields of data
      • namesstring[]

        Every flag's name.

      • environmentsobject[]

        Fields of environments
        • idstring

          An id.

        • namestring

        • flagsmap of boolean

          Whether each flag is on here.

  • 400Bad requestThe body isn't valid JSON.
    • errorobject

      Fields of error
      • codestring

        One of bad_request, unauthorized, forbidden, not_found, created_in_orbit, conflict, validation_failed, internal_error, unavailable.
      • messagestring

        Follows Accept-Language when CMS Orbit has the language.

      • detailsanysometimes

        When there is more to read. On 422, issues: each field that failed, with path, message and code. On a field value that breaks the content type's rules, a list of { path, message }. On a version conflict, currentVersion, expected and received.

  • 401UnauthorisedNo token, or a token that is unknown, expired or revoked, or whose person no longer has access.
    • errorobject

      Fields of error
      • codestring

        One of bad_request, unauthorized, forbidden, not_found, created_in_orbit, conflict, validation_failed, internal_error, unavailable.
      • messagestring

        Follows Accept-Language when CMS Orbit has the language.

      • detailsanysometimes

        When there is more to read. On 422, issues: each field that failed, with path, message and code. On a field value that breaks the content type's rules, a list of { path, message }. On a version conflict, currentVersion, expected and received.

  • 403ForbiddenLacks environment:manage, or the token is read only.
    • errorobject

      Fields of error
      • codestring

        One of bad_request, unauthorized, forbidden, not_found, created_in_orbit, conflict, validation_failed, internal_error, unavailable.
      • messagestring

        Follows Accept-Language when CMS Orbit has the language.

      • detailsanysometimes

        When there is more to read. On 422, issues: each field that failed, with path, message and code. On a field value that breaks the content type's rules, a list of { path, message }. On a version conflict, currentVersion, expected and received.

  • 404Not foundNo such environment, or it's in another organisation.
    • errorobject

      Fields of error
      • codestring

        One of bad_request, unauthorized, forbidden, not_found, created_in_orbit, conflict, validation_failed, internal_error, unavailable.
      • messagestring

        Follows Accept-Language when CMS Orbit has the language.

      • detailsanysometimes

        When there is more to read. On 422, issues: each field that failed, with path, message and code. On a field value that breaks the content type's rules, a list of { path, message }. On a version conflict, currentVersion, expected and received.

  • 500Server errorSomething went wrong on our side. Try again in a moment.
    • errorobject

      Fields of error
      • codestring

        One of bad_request, unauthorized, forbidden, not_found, created_in_orbit, conflict, validation_failed, internal_error, unavailable.
      • messagestring

        Follows Accept-Language when CMS Orbit has the language.

      • detailsanysometimes

        When there is more to read. On 422, issues: each field that failed, with path, message and code. On a field value that breaks the content type's rules, a list of { path, message }. On a version conflict, currentVersion, expected and received.

Shell
curl -X PUT 'https://api.bifrostorbit.com/cms/manage/v1/organisations/6650f1c2a9e4b1d2c3f40a01/spaces/6650f1c2a9e4b1d2c3f40a02/flags/winter-sale/environments/6650f1c2a9e4b1d2c3f40a13' \  -H 'Authorization: Bearer cms_mt_…' \  -H 'Content-Type: application/json' \  -d '{"on":true}'

Try it

Management tokens are secret and act as a person, so nothing is sent from the docs.

Example answer

200 OKJSON
{  "data": {    "names": [      "Lofoten sea kayaking"    ],    "environments": [      {        "id": "6650f1c2a9e4b1d2c3f40a40",        "name": "Lofoten sea kayaking",        "flags": {}      }    ]  }}

SchemasThe shapes the endpoints above answer with and take.

Error

Every error has this shape. Write code against code and the status, never the message.

  • errorobject

    Fields of error
    • codestring

      One of bad_request, unauthorized, forbidden, not_found, created_in_orbit, conflict, validation_failed, internal_error, unavailable.
    • messagestring

      Follows Accept-Language when CMS Orbit has the language.

    • detailsanysometimes

      When there is more to read. On 422, issues: each field that failed, with path, message and code. On a field value that breaks the content type's rules, a list of { path, message }. On a version conflict, currentVersion, expected and received.