Skip to content
cloudhostDocs
API reference

Feature flags

Flags per project with boolean, string, number and JSON values, variants per environment and preview branch, targeting rules, sticky percentage rollouts, a kill switch and history with rollback. Read inside a function as env.FLAGS, or over REST with a read-only token.

GET/v1/functions/{name}/flags

List flags#

The project's flags with a summary per environment (on or killed, the default value, rule count, rollout percentage) and the plan's limits.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Response

200FlagList

  • flagsFlagListItem[]
    • keystring
    • typestring

      one of boolean, string, number, json

    • descriptionstring
    • created_atstring (date-time)
    • updated_atstring (date-time)
    • created_bystring | null
    • updated_bystring | null
    • environmentsobject
    • branchesinteger

      preview-branch overrides

  • limitsFlagLimits
    • planstring
    • flagsinteger

      Hobby 10, Pro 500, Enterprise 5000

    • flags_usedinteger
    • rules_per_configinteger
    • branch_overridesinteger
    • read_tokensinteger
    • read_requests_per_secondinteger

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/functions/my-api/flags" \
  -H "Authorization: Bearer $KEY"
POST/v1/functions/{name}/flags

Create a flag#

Create a flag: key, type (boolean, string, number or json), optional description, and value (the default for every environment), config (a whole config for every environment) or environments (a config per environment). The plan caps the number of flags per project.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Request bodyapplication/json

  • keystringrequired

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$

  • typestringrequired

    one of boolean, string, number, json

  • descriptionstring

    up to 500 characters

  • valueany

    a value of the flag's type: boolean, string, number or any JSON (up to 2 KiB)

  • configFlagConfig
  • environmentsobject

Response

201Flag

  • keystring
  • typestring

    one of boolean, string, number, json

  • descriptionstring
  • versioninteger

    the latest history version

  • created_atstring (date-time)
  • updated_atstring (date-time)
  • created_bystring | null
  • updated_bystring | null
  • environmentsobject
  • branchesmap of FlagConfig

    preview branch label -> config

  • changedstring[]

    after a change: the places that changed

Errors

StatusDescription
400flag_bad_key, flag_bad_type, flag_bad_value, flag_bad_rule, flag_bad_rollout, flag_bad_config
401unauthorized: missing, invalid, expired or revoked credential
404not_found
409flag_exists, flag_limit
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/functions/my-api/flags" \
  -H "Authorization: Bearer $KEY" \
  -d '{"key":"STRIPE_KEY","type":"boolean"}'
GET/v1/functions/{name}/flags/{key}

One flag#

The whole flag: the config of every environment and its preview-branch overrides, and its history version. ?branch= adds that branch's label and override.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

  • branchstringquery

    a git branch: adds branch and branch_config

Response

200FlagDetail

  • keystring
  • typestring

    one of boolean, string, number, json

  • descriptionstring
  • versioninteger

    the latest history version

  • created_atstring (date-time)
  • updated_atstring (date-time)
  • created_bystring | null
  • updated_bystring | null
  • environmentsobject
  • branchesmap of FlagConfig

    preview branch label -> config

  • changedstring[]

    after a change: the places that changed

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/functions/my-api/flags/STRIPE_KEY" \
  -H "Authorization: Bearer $KEY"
DELETE/v1/functions/{name}/flags/{key}

Delete a flag#

Delete a flag. Its history stays, so a rollback can bring it back. Code that reads it gets its own default.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

Response

200object

  • keystring
  • deletedboolean
  • versioninteger

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X DELETE "https://api.ibel.ai/v1/functions/my-api/flags/STRIPE_KEY" \
  -H "Authorization: Bearer $KEY"
PATCH/v1/functions/{name}/flags/{key}

Change a flag's description#

Body {description}. Recorded in the history.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

Request bodyapplication/json

  • descriptionstringrequired

    up to 500 characters

Response

200FlagDetail

  • keystring
  • typestring

    one of boolean, string, number, json

  • descriptionstring
  • versioninteger

    the latest history version

  • created_atstring (date-time)
  • updated_atstring (date-time)
  • created_bystring | null
  • updated_bystring | null
  • environmentsobject
  • branchesmap of FlagConfig

    preview branch label -> config

  • changedstring[]

    after a change: the places that changed

Errors

StatusDescription
400flag_bad_description
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X PATCH "https://api.ibel.ai/v1/functions/my-api/flags/STRIPE_KEY" \
  -H "Authorization: Bearer $KEY" \
  -d '{"description":"…"}'
PUT/v1/functions/{name}/flags/{key}/environments/{env}

Replace one environment's config#

The body is the whole config (see FlagConfig); fields left out go back to their defaults (enabled, the type's zero value, no rules, no rollout). Takes effect on running deployments within seconds, without a restart, except for development, which no deployment reads (it is read over the REST path with a development token).

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

  • envstringpathrequired

    the environment

    one of production, preview, development

Request bodyapplication/json

One environment's (or branch's) config. Evaluation order: enabled: false serves off_value (the kill switch); otherwise the first rule whose conditions all match (and, with a percentage, whose bucket falls inside it); then the rollout; then value.

  • enabledboolean

    false is the kill switch

    default true

  • valueany

    a value of the flag's type: boolean, string, number or any JSON (up to 2 KiB)

  • off_valueany

    a value of the flag's type: boolean, string, number or any JSON (up to 2 KiB)

  • rulesFlagRule[]

    checked in order; at most 5 on Hobby, 50 on Pro

  • rolloutFlagRollout | null

Response

200FlagDetail

  • keystring
  • typestring

    one of boolean, string, number, json

  • descriptionstring
  • versioninteger

    the latest history version

  • created_atstring (date-time)
  • updated_atstring (date-time)
  • created_bystring | null
  • updated_bystring | null
  • environmentsobject
  • branchesmap of FlagConfig

    preview branch label -> config

  • changedstring[]

    after a change: the places that changed

Errors

StatusDescription
400flag_bad_environment, flag_bad_value, flag_bad_rule, flag_bad_rollout, flag_bad_percentage, flag_bad_config
401unauthorized: missing, invalid, expired or revoked credential
404not_found
409flag_limit (too many rules for the plan)
500internal: an unexpected failure

Example

curl -X PUT "https://api.ibel.ai/v1/functions/my-api/flags/STRIPE_KEY/environments/env" \
  -H "Authorization: Bearer $KEY" \
  -d '{"enabled":true,"value":null,"off_value":null,"rules":[{"id":"88e2fe1d-6d75-4de5-8c8f-27380ec66903","name":"my-api","clauses":[{"attribute":"…","op":"equals","values":[null]}],"value":null,"percentage":0}],"rollout":{"bucket_by":"…","salt":"…","variants":[{"value":null,"percentage":0}]}}'
PUT/v1/functions/{name}/flags/{key}/branches/{branch}

Give one preview branch its own config#

A preview of that branch uses this config as a whole instead of the preview environment's. Body: a FlagConfig.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

  • branchstringpathrequired

    a git branch name (its preview label is what is stored)

Request bodyapplication/json

One environment's (or branch's) config. Evaluation order: enabled: false serves off_value (the kill switch); otherwise the first rule whose conditions all match (and, with a percentage, whose bucket falls inside it); then the rollout; then value.

  • enabledboolean

    false is the kill switch

    default true

  • valueany

    a value of the flag's type: boolean, string, number or any JSON (up to 2 KiB)

  • off_valueany

    a value of the flag's type: boolean, string, number or any JSON (up to 2 KiB)

  • rulesFlagRule[]

    checked in order; at most 5 on Hobby, 50 on Pro

  • rolloutFlagRollout | null

Response

200FlagDetail

  • keystring
  • typestring

    one of boolean, string, number, json

  • descriptionstring
  • versioninteger

    the latest history version

  • created_atstring (date-time)
  • updated_atstring (date-time)
  • created_bystring | null
  • updated_bystring | null
  • environmentsobject
  • branchesmap of FlagConfig

    preview branch label -> config

  • changedstring[]

    after a change: the places that changed

Errors

StatusDescription
400flag_bad_branch, flag_bad_value, flag_bad_rule
401unauthorized: missing, invalid, expired or revoked credential
404not_found
409flag_limit
500internal: an unexpected failure

Example

curl -X PUT "https://api.ibel.ai/v1/functions/my-api/flags/STRIPE_KEY/branches/dev" \
  -H "Authorization: Bearer $KEY" \
  -d '{"enabled":true,"value":null,"off_value":null,"rules":[{"id":"88e2fe1d-6d75-4de5-8c8f-27380ec66903","name":"my-api","clauses":[{"attribute":"…","op":"equals","values":[null]}],"value":null,"percentage":0}],"rollout":{"bucket_by":"…","salt":"…","variants":[{"value":null,"percentage":0}]}}'
DELETE/v1/functions/{name}/flags/{key}/branches/{branch}

Remove a branch's own config#

The branch's previews follow the preview environment again.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

  • branchstringpathrequired

    a git branch name (its preview label is what is stored)

Response

200FlagDetail

  • keystring
  • typestring

    one of boolean, string, number, json

  • descriptionstring
  • versioninteger

    the latest history version

  • created_atstring (date-time)
  • updated_atstring (date-time)
  • created_bystring | null
  • updated_bystring | null
  • environmentsobject
  • branchesmap of FlagConfig

    preview branch label -> config

  • changedstring[]

    after a change: the places that changed

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X DELETE "https://api.ibel.ai/v1/functions/my-api/flags/STRIPE_KEY/branches/dev" \
  -H "Authorization: Bearer $KEY"
POST/v1/functions/{name}/flags/{key}/kill

Kill switch#

Turn the flag off in one environment or all: its off_value is served and rules and rollouts are ignored. preview includes every branch override. Reverse with revive. Recorded in the history.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

Request bodyapplication/json

  • environmentstring

    one of production, preview, development, all · default "all"

  • branchstring

    a preview branch (with environment preview or all)

Response

200FlagDetail

  • keystring
  • typestring

    one of boolean, string, number, json

  • descriptionstring
  • versioninteger

    the latest history version

  • created_atstring (date-time)
  • updated_atstring (date-time)
  • created_bystring | null
  • updated_bystring | null
  • environmentsobject
  • branchesmap of FlagConfig

    preview branch label -> config

  • changedstring[]

    after a change: the places that changed

Errors

StatusDescription
400flag_bad_environment, flag_bad_branch
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/functions/my-api/flags/STRIPE_KEY/kill" \
  -H "Authorization: Bearer $KEY" \
  -d '{"environment":"all","branch":"dev"}'
POST/v1/functions/{name}/flags/{key}/revive

Turn a killed flag back on#

The same body as kill.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

Request bodyapplication/json

  • environmentstring

    one of production, preview, development, all · default "all"

  • branchstring

    a preview branch (with environment preview or all)

Response

200FlagDetail

  • keystring
  • typestring

    one of boolean, string, number, json

  • descriptionstring
  • versioninteger

    the latest history version

  • created_atstring (date-time)
  • updated_atstring (date-time)
  • created_bystring | null
  • updated_bystring | null
  • environmentsobject
  • branchesmap of FlagConfig

    preview branch label -> config

  • changedstring[]

    after a change: the places that changed

Errors

StatusDescription
400flag_bad_environment, flag_bad_branch
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/functions/my-api/flags/STRIPE_KEY/revive" \
  -H "Authorization: Bearer $KEY" \
  -d '{"environment":"all","branch":"dev"}'
GET/v1/functions/{name}/flags/{key}/history

Who changed what#

The flag's history, newest first, kept after the flag is deleted. Each entry: version, action (create, update, kill, revive, rollback, delete), actor (an email or key name), at, changed (the places that differ from the entry before: an environment, branch:<label>, type, description) and the whole state after it.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

  • limitintegerquery

    1 to 200 (default 50)

    1–200

  • beforeintegerquery

    only versions below this one

Response

200FlagHistory

  • keystring
  • historyobject[]
    • versioninteger
    • actionstring

      one of create, update, kill, revive, rollback, delete

    • atstring (date-time)
    • actorstring | null
    • detailobject
    • changedstring[]
    • restorableboolean
    • stateobject | null

      the whole flag after the change; null for a deletion

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/functions/my-api/flags/STRIPE_KEY/history" \
  -H "Authorization: Bearer $KEY"
POST/v1/functions/{name}/flags/{key}/rollback

Roll a flag back#

Restore the whole flag (every environment, branch overrides, description) as it was at a history version. Brings back a deleted flag. Recorded as a new rollback entry; when nothing differs, changed is empty and nothing is recorded.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

Request bodyapplication/json

  • versionintegerrequired

    at least 1

Response

200FlagDetail

  • keystring
  • typestring

    one of boolean, string, number, json

  • descriptionstring
  • versioninteger

    the latest history version

  • created_atstring (date-time)
  • updated_atstring (date-time)
  • created_bystring | null
  • updated_bystring | null
  • environmentsobject
  • branchesmap of FlagConfig

    preview branch label -> config

  • changedstring[]

    after a change: the places that changed

Errors

StatusDescription
400flag_bad_version, flag_bad_state (no longer fits today's rules)
401unauthorized: missing, invalid, expired or revoked credential
404not_found
409flag_not_restorable (a deletion entry), flag_limit
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/functions/my-api/flags/STRIPE_KEY/rollback" \
  -H "Authorization: Bearer $KEY" \
  -d '{"version":1}'
POST/v1/functions/{name}/flags/{key}/evaluate

Evaluate a flag for a context#

What a caller would get in an environment (and, for preview, branch), with the reason: off, rule (with the rule id), rollout (with the variant and bucket) or default.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

Request bodyapplication/json

  • environmentstring

    one of production, preview, development · default "production"

  • branchstring
  • contextobject

Response

200FlagEvaluation

  • keystring
  • valueanyrequired

    a value of the flag's type: boolean, string, number or any JSON (up to 2 KiB)

  • reasonstringrequired

    one of off, rule, rollout, default, missing

  • rulestring
  • variantinteger
  • bucketinteger

    0-9999

Errors

StatusDescription
400flag_bad_environment, flag_bad_context
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/functions/my-api/flags/STRIPE_KEY/evaluate" \
  -H "Authorization: Bearer $KEY" \
  -d '{"environment":"production","branch":"dev","context":{}}'
GET/v1/functions/{name}/flag-tokens

List read-only tokens#

Token ids, names, environments and prefixes; never the token itself.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Response

200FlagTokenList

  • tokensFlagToken[]
    • idstring (uuid)
    • namestring
    • environmentstring

      one of production, preview, development

    • prefixstring
    • created_atstring (date-time)
    • created_bystring | null
    • last_used_atstring (date-time) | null
  • maxinteger

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/functions/my-api/flag-tokens" \
  -H "Authorization: Bearer $KEY"
POST/v1/functions/{name}/flag-tokens

Create a read-only token#

A token for the REST read path (/v1/flags/read), bound to one environment. The token is in the answer once and never again. The plan caps tokens per project.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Request bodyapplication/json

  • environmentstring

    one of production, preview, development · default "production"

  • namestring

    up to 100 characters

Response

201FlagTokenCreated

  • idstring (uuid)
  • tokenstring

    chf_… shown once

  • environmentstring
  • namestring
  • notestring

Errors

StatusDescription
400flag_bad_environment, flag_bad_name
401unauthorized: missing, invalid, expired or revoked credential
404not_found
409flag_limit
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/functions/my-api/flag-tokens" \
  -H "Authorization: Bearer $KEY" \
  -d '{"environment":"production","name":"my-api"}'
DELETE/v1/functions/{name}/flag-tokens/{id}

Revoke a read-only token#

The token stops working within five seconds.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • idstring (uuid)pathrequired

    the token's id

Response

200object

  • idstring
  • revokedboolean

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X DELETE "https://api.ibel.ai/v1/functions/my-api/flag-tokens/88e2fe1d-6d75-4de5-8c8f-27380ec66903" \
  -H "Authorization: Bearer $KEY"
GET/v1/functions/{name}/segments

List segments#

The project's segments and the plan's cap.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Response

200FlagSegmentList

  • segmentsFlagSegmentSummary[]
    • keystring
    • descriptionstring
    • attributestring
    • includedinteger

      how many users are listed

    • excludedinteger
    • rulesinteger
    • used_bystring[]

      the flags whose rules use it

    • created_atstring
    • updated_atstring
    • updated_bystring
  • limitsobject
    • planstring
    • segmentsinteger

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/functions/my-api/segments" \
  -H "Authorization: Bearer $KEY"
POST/v1/functions/{name}/segments

Create a segment#

A reusable list of users for flag rules (in_segment).

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Request bodyapplication/json

  • keystring
  • descriptionstring
  • attributestring

    what the lists hold (default: the context's key)

  • includedstring[]
  • excludedstring[]
  • rulesobject[]

Response

201FlagSegment

  • keystring
  • descriptionstring
  • attributestring

    what the lists hold (default: the context's key)

  • includedstring[]
  • excludedstring[]
  • rulesobject[]

Errors

StatusDescription
400flag_bad_segment
401unauthorized: missing, invalid, expired or revoked credential
404not_found
409flag_exists, flag_limit
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/functions/my-api/segments" \
  -H "Authorization: Bearer $KEY" \
  -d '{"key":"STRIPE_KEY","description":"…","attribute":"…","included":["…"],"excluded":["…"],"rules":[{"clauses":[{}]}]}'
GET/v1/functions/{name}/segments/{key}

One segment#

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the segment's key

Response

200FlagSegmentDetail

  • segmentFlagSegment
    • keystring
    • descriptionstring
    • attributestring

      what the lists hold (default: the context's key)

    • includedstring[]
    • excludedstring[]
    • rulesobject[]
  • used_bystring[]

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/functions/my-api/segments/STRIPE_KEY" \
  -H "Authorization: Bearer $KEY"
PUT/v1/functions/{name}/segments/{key}

Replace a segment#

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the segment's key

Request bodyapplication/json

  • keystring
  • descriptionstring
  • attributestring

    what the lists hold (default: the context's key)

  • includedstring[]
  • excludedstring[]
  • rulesobject[]

Response

200FlagSegment

  • keystring
  • descriptionstring
  • attributestring

    what the lists hold (default: the context's key)

  • includedstring[]
  • excludedstring[]
  • rulesobject[]

Errors

StatusDescription
400flag_bad_segment
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X PUT "https://api.ibel.ai/v1/functions/my-api/segments/STRIPE_KEY" \
  -H "Authorization: Bearer $KEY" \
  -d '{"key":"STRIPE_KEY","description":"…","attribute":"…","included":["…"],"excluded":["…"],"rules":[{"clauses":[{}]}]}'
DELETE/v1/functions/{name}/segments/{key}

Delete a segment#

A segment a flag rule uses cannot be deleted.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the segment's key

Response

200Deleted

  • namestring
  • deletedbooleanrequired

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
409flag_segment_in_use
500internal: an unexpected failure

Example

curl -X DELETE "https://api.ibel.ai/v1/functions/my-api/segments/STRIPE_KEY" \
  -H "Authorization: Bearer $KEY"
PATCH/v1/functions/{name}/segments/{key}

Change a segment#

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the segment's key

Request bodyapplication/json

  • keystring
  • descriptionstring
  • attributestring

    what the lists hold (default: the context's key)

  • includedstring[]
  • excludedstring[]
  • rulesobject[]

Response

200FlagSegment

  • keystring
  • descriptionstring
  • attributestring

    what the lists hold (default: the context's key)

  • includedstring[]
  • excludedstring[]
  • rulesobject[]

Errors

StatusDescription
400flag_bad_segment
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X PATCH "https://api.ibel.ai/v1/functions/my-api/segments/STRIPE_KEY" \
  -H "Authorization: Bearer $KEY" \
  -d '{"key":"STRIPE_KEY","description":"…","attribute":"…","included":["…"],"excluded":["…"],"rules":[{"clauses":[{}]}]}'
GET/v1/functions/{name}/flag-keys

List flag keys#

Keys for OpenFeature (/ofrep/v1/…): ids, kinds, environments and prefixes; never the key.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Response

200FlagKeyList

  • keysFlagKeyInfo[]
    • idstring
    • namestring
    • kindstring
    • environmentstring
    • prefixstring
    • created_atstring
    • created_bystring

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/functions/my-api/flag-keys" \
  -H "Authorization: Bearer $KEY"
POST/v1/functions/{name}/flag-keys

Create a flag key#

A server key sees every flag of its environment; a browser key only the flags marked browser. The key is in the answer once.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Request bodyapplication/json

  • namestring

    up to 100 characters

  • kindstring

    one of server, browser · default "server"

  • environmentstring

    one of production, preview, development · default "production"

Response

201FlagKeyCreated

  • idstring
  • namestring
  • kindstring
  • environmentstring
  • prefixstring
  • created_atstring
  • created_bystring
  • keystring

    chf_… shown once

Errors

StatusDescription
400flag_bad_kind, flag_bad_environment, flag_bad_name
401unauthorized: missing, invalid, expired or revoked credential
404not_found
409flag_limit
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/functions/my-api/flag-keys" \
  -H "Authorization: Bearer $KEY" \
  -d '{"name":"my-api","kind":"server","environment":"production"}'
DELETE/v1/functions/{name}/flag-keys/{id}

Revoke a flag key#

The key stops working within five seconds.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • idstringpathrequired

    the key's id

Response

200Deleted

  • namestring
  • deletedbooleanrequired

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X DELETE "https://api.ibel.ai/v1/functions/my-api/flag-keys/88e2fe1d-6d75-4de5-8c8f-27380ec66903" \
  -H "Authorization: Bearer $KEY"
GET/v1/functions/{name}/flag-audit

Flag audit trail#

Who changed which flag, segment or key, newest first.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • beforestringquery

    an at from the last page

  • limitintegerquery

    1-200, default 50

Response

200FlagAudit

  • auditobject[]
    • atstring
    • actorstring
    • actionstring
    • targetstring
    • detailobject

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/functions/my-api/flag-audit" \
  -H "Authorization: Bearer $KEY"
GET/v1/functions/{name}/flag-usage

Flag requests per day#

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • daysintegerquery

    1-90, default 30

Response

200FlagUsage

  • daysobject[]
    • daystring
    • requestsinteger
  • totalinteger

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/functions/my-api/flag-usage" \
  -H "Authorization: Bearer $KEY"
GET/v1/apps/{name}/flags

List flags#

The project's flags with a summary per environment (on or killed, the default value, rule count, rollout percentage) and the plan's limits.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Response

200FlagList

  • flagsFlagListItem[]
    • keystring
    • typestring

      one of boolean, string, number, json

    • descriptionstring
    • created_atstring (date-time)
    • updated_atstring (date-time)
    • created_bystring | null
    • updated_bystring | null
    • environmentsobject
    • branchesinteger

      preview-branch overrides

  • limitsFlagLimits
    • planstring
    • flagsinteger

      Hobby 10, Pro 500, Enterprise 5000

    • flags_usedinteger
    • rules_per_configinteger
    • branch_overridesinteger
    • read_tokensinteger
    • read_requests_per_secondinteger

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/apps/my-api/flags" \
  -H "Authorization: Bearer $KEY"
POST/v1/apps/{name}/flags

Create a flag#

Create a flag: key, type (boolean, string, number or json), optional description, and value (the default for every environment), config (a whole config for every environment) or environments (a config per environment). The plan caps the number of flags per project.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Request bodyapplication/json

  • keystringrequired

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$

  • typestringrequired

    one of boolean, string, number, json

  • descriptionstring

    up to 500 characters

  • valueany

    a value of the flag's type: boolean, string, number or any JSON (up to 2 KiB)

  • configFlagConfig
  • environmentsobject

Response

201Flag

  • keystring
  • typestring

    one of boolean, string, number, json

  • descriptionstring
  • versioninteger

    the latest history version

  • created_atstring (date-time)
  • updated_atstring (date-time)
  • created_bystring | null
  • updated_bystring | null
  • environmentsobject
  • branchesmap of FlagConfig

    preview branch label -> config

  • changedstring[]

    after a change: the places that changed

Errors

StatusDescription
400flag_bad_key, flag_bad_type, flag_bad_value, flag_bad_rule, flag_bad_rollout, flag_bad_config
401unauthorized: missing, invalid, expired or revoked credential
404not_found
409flag_exists, flag_limit
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/apps/my-api/flags" \
  -H "Authorization: Bearer $KEY" \
  -d '{"key":"STRIPE_KEY","type":"boolean"}'
GET/v1/apps/{name}/flags/{key}

One flag#

The whole flag: the config of every environment and its preview-branch overrides, and its history version. ?branch= adds that branch's label and override.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

  • branchstringquery

    a git branch: adds branch and branch_config

Response

200FlagDetail

  • keystring
  • typestring

    one of boolean, string, number, json

  • descriptionstring
  • versioninteger

    the latest history version

  • created_atstring (date-time)
  • updated_atstring (date-time)
  • created_bystring | null
  • updated_bystring | null
  • environmentsobject
  • branchesmap of FlagConfig

    preview branch label -> config

  • changedstring[]

    after a change: the places that changed

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/apps/my-api/flags/STRIPE_KEY" \
  -H "Authorization: Bearer $KEY"
DELETE/v1/apps/{name}/flags/{key}

Delete a flag#

Delete a flag. Its history stays, so a rollback can bring it back. Code that reads it gets its own default.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

Response

200object

  • keystring
  • deletedboolean
  • versioninteger

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X DELETE "https://api.ibel.ai/v1/apps/my-api/flags/STRIPE_KEY" \
  -H "Authorization: Bearer $KEY"
PATCH/v1/apps/{name}/flags/{key}

Change a flag's description#

Body {description}. Recorded in the history.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

Request bodyapplication/json

  • descriptionstringrequired

    up to 500 characters

Response

200FlagDetail

  • keystring
  • typestring

    one of boolean, string, number, json

  • descriptionstring
  • versioninteger

    the latest history version

  • created_atstring (date-time)
  • updated_atstring (date-time)
  • created_bystring | null
  • updated_bystring | null
  • environmentsobject
  • branchesmap of FlagConfig

    preview branch label -> config

  • changedstring[]

    after a change: the places that changed

Errors

StatusDescription
400flag_bad_description
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X PATCH "https://api.ibel.ai/v1/apps/my-api/flags/STRIPE_KEY" \
  -H "Authorization: Bearer $KEY" \
  -d '{"description":"…"}'
PUT/v1/apps/{name}/flags/{key}/environments/{env}

Replace one environment's config#

The body is the whole config (see FlagConfig); fields left out go back to their defaults (enabled, the type's zero value, no rules, no rollout). Takes effect on running deployments within seconds, without a restart, except for development, which no deployment reads (it is read over the REST path with a development token).

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

  • envstringpathrequired

    the environment

    one of production, preview, development

Request bodyapplication/json

One environment's (or branch's) config. Evaluation order: enabled: false serves off_value (the kill switch); otherwise the first rule whose conditions all match (and, with a percentage, whose bucket falls inside it); then the rollout; then value.

  • enabledboolean

    false is the kill switch

    default true

  • valueany

    a value of the flag's type: boolean, string, number or any JSON (up to 2 KiB)

  • off_valueany

    a value of the flag's type: boolean, string, number or any JSON (up to 2 KiB)

  • rulesFlagRule[]

    checked in order; at most 5 on Hobby, 50 on Pro

  • rolloutFlagRollout | null

Response

200FlagDetail

  • keystring
  • typestring

    one of boolean, string, number, json

  • descriptionstring
  • versioninteger

    the latest history version

  • created_atstring (date-time)
  • updated_atstring (date-time)
  • created_bystring | null
  • updated_bystring | null
  • environmentsobject
  • branchesmap of FlagConfig

    preview branch label -> config

  • changedstring[]

    after a change: the places that changed

Errors

StatusDescription
400flag_bad_environment, flag_bad_value, flag_bad_rule, flag_bad_rollout, flag_bad_percentage, flag_bad_config
401unauthorized: missing, invalid, expired or revoked credential
404not_found
409flag_limit (too many rules for the plan)
500internal: an unexpected failure

Example

curl -X PUT "https://api.ibel.ai/v1/apps/my-api/flags/STRIPE_KEY/environments/env" \
  -H "Authorization: Bearer $KEY" \
  -d '{"enabled":true,"value":null,"off_value":null,"rules":[{"id":"88e2fe1d-6d75-4de5-8c8f-27380ec66903","name":"my-api","clauses":[{"attribute":"…","op":"equals","values":[null]}],"value":null,"percentage":0}],"rollout":{"bucket_by":"…","salt":"…","variants":[{"value":null,"percentage":0}]}}'
PUT/v1/apps/{name}/flags/{key}/branches/{branch}

Give one preview branch its own config#

A preview of that branch uses this config as a whole instead of the preview environment's. Body: a FlagConfig.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

  • branchstringpathrequired

    a git branch name (its preview label is what is stored)

Request bodyapplication/json

One environment's (or branch's) config. Evaluation order: enabled: false serves off_value (the kill switch); otherwise the first rule whose conditions all match (and, with a percentage, whose bucket falls inside it); then the rollout; then value.

  • enabledboolean

    false is the kill switch

    default true

  • valueany

    a value of the flag's type: boolean, string, number or any JSON (up to 2 KiB)

  • off_valueany

    a value of the flag's type: boolean, string, number or any JSON (up to 2 KiB)

  • rulesFlagRule[]

    checked in order; at most 5 on Hobby, 50 on Pro

  • rolloutFlagRollout | null

Response

200FlagDetail

  • keystring
  • typestring

    one of boolean, string, number, json

  • descriptionstring
  • versioninteger

    the latest history version

  • created_atstring (date-time)
  • updated_atstring (date-time)
  • created_bystring | null
  • updated_bystring | null
  • environmentsobject
  • branchesmap of FlagConfig

    preview branch label -> config

  • changedstring[]

    after a change: the places that changed

Errors

StatusDescription
400flag_bad_branch, flag_bad_value, flag_bad_rule
401unauthorized: missing, invalid, expired or revoked credential
404not_found
409flag_limit
500internal: an unexpected failure

Example

curl -X PUT "https://api.ibel.ai/v1/apps/my-api/flags/STRIPE_KEY/branches/dev" \
  -H "Authorization: Bearer $KEY" \
  -d '{"enabled":true,"value":null,"off_value":null,"rules":[{"id":"88e2fe1d-6d75-4de5-8c8f-27380ec66903","name":"my-api","clauses":[{"attribute":"…","op":"equals","values":[null]}],"value":null,"percentage":0}],"rollout":{"bucket_by":"…","salt":"…","variants":[{"value":null,"percentage":0}]}}'
DELETE/v1/apps/{name}/flags/{key}/branches/{branch}

Remove a branch's own config#

The branch's previews follow the preview environment again.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

  • branchstringpathrequired

    a git branch name (its preview label is what is stored)

Response

200FlagDetail

  • keystring
  • typestring

    one of boolean, string, number, json

  • descriptionstring
  • versioninteger

    the latest history version

  • created_atstring (date-time)
  • updated_atstring (date-time)
  • created_bystring | null
  • updated_bystring | null
  • environmentsobject
  • branchesmap of FlagConfig

    preview branch label -> config

  • changedstring[]

    after a change: the places that changed

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X DELETE "https://api.ibel.ai/v1/apps/my-api/flags/STRIPE_KEY/branches/dev" \
  -H "Authorization: Bearer $KEY"
POST/v1/apps/{name}/flags/{key}/kill

Kill switch#

Turn the flag off in one environment or all: its off_value is served and rules and rollouts are ignored. preview includes every branch override. Reverse with revive. Recorded in the history.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

Request bodyapplication/json

  • environmentstring

    one of production, preview, development, all · default "all"

  • branchstring

    a preview branch (with environment preview or all)

Response

200FlagDetail

  • keystring
  • typestring

    one of boolean, string, number, json

  • descriptionstring
  • versioninteger

    the latest history version

  • created_atstring (date-time)
  • updated_atstring (date-time)
  • created_bystring | null
  • updated_bystring | null
  • environmentsobject
  • branchesmap of FlagConfig

    preview branch label -> config

  • changedstring[]

    after a change: the places that changed

Errors

StatusDescription
400flag_bad_environment, flag_bad_branch
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/apps/my-api/flags/STRIPE_KEY/kill" \
  -H "Authorization: Bearer $KEY" \
  -d '{"environment":"all","branch":"dev"}'
POST/v1/apps/{name}/flags/{key}/revive

Turn a killed flag back on#

The same body as kill.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

Request bodyapplication/json

  • environmentstring

    one of production, preview, development, all · default "all"

  • branchstring

    a preview branch (with environment preview or all)

Response

200FlagDetail

  • keystring
  • typestring

    one of boolean, string, number, json

  • descriptionstring
  • versioninteger

    the latest history version

  • created_atstring (date-time)
  • updated_atstring (date-time)
  • created_bystring | null
  • updated_bystring | null
  • environmentsobject
  • branchesmap of FlagConfig

    preview branch label -> config

  • changedstring[]

    after a change: the places that changed

Errors

StatusDescription
400flag_bad_environment, flag_bad_branch
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/apps/my-api/flags/STRIPE_KEY/revive" \
  -H "Authorization: Bearer $KEY" \
  -d '{"environment":"all","branch":"dev"}'
GET/v1/apps/{name}/flags/{key}/history

Who changed what#

The flag's history, newest first, kept after the flag is deleted. Each entry: version, action (create, update, kill, revive, rollback, delete), actor (an email or key name), at, changed (the places that differ from the entry before: an environment, branch:<label>, type, description) and the whole state after it.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

  • limitintegerquery

    1 to 200 (default 50)

    1–200

  • beforeintegerquery

    only versions below this one

Response

200FlagHistory

  • keystring
  • historyobject[]
    • versioninteger
    • actionstring

      one of create, update, kill, revive, rollback, delete

    • atstring (date-time)
    • actorstring | null
    • detailobject
    • changedstring[]
    • restorableboolean
    • stateobject | null

      the whole flag after the change; null for a deletion

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/apps/my-api/flags/STRIPE_KEY/history" \
  -H "Authorization: Bearer $KEY"
POST/v1/apps/{name}/flags/{key}/rollback

Roll a flag back#

Restore the whole flag (every environment, branch overrides, description) as it was at a history version. Brings back a deleted flag. Recorded as a new rollback entry; when nothing differs, changed is empty and nothing is recorded.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

Request bodyapplication/json

  • versionintegerrequired

    at least 1

Response

200FlagDetail

  • keystring
  • typestring

    one of boolean, string, number, json

  • descriptionstring
  • versioninteger

    the latest history version

  • created_atstring (date-time)
  • updated_atstring (date-time)
  • created_bystring | null
  • updated_bystring | null
  • environmentsobject
  • branchesmap of FlagConfig

    preview branch label -> config

  • changedstring[]

    after a change: the places that changed

Errors

StatusDescription
400flag_bad_version, flag_bad_state (no longer fits today's rules)
401unauthorized: missing, invalid, expired or revoked credential
404not_found
409flag_not_restorable (a deletion entry), flag_limit
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/apps/my-api/flags/STRIPE_KEY/rollback" \
  -H "Authorization: Bearer $KEY" \
  -d '{"version":1}'
POST/v1/apps/{name}/flags/{key}/evaluate

Evaluate a flag for a context#

What a caller would get in an environment (and, for preview, branch), with the reason: off, rule (with the rule id), rollout (with the variant and bucket) or default.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the flag's key

    pattern ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ · up to 64 characters

Request bodyapplication/json

  • environmentstring

    one of production, preview, development · default "production"

  • branchstring
  • contextobject

Response

200FlagEvaluation

  • keystring
  • valueanyrequired

    a value of the flag's type: boolean, string, number or any JSON (up to 2 KiB)

  • reasonstringrequired

    one of off, rule, rollout, default, missing

  • rulestring
  • variantinteger
  • bucketinteger

    0-9999

Errors

StatusDescription
400flag_bad_environment, flag_bad_context
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/apps/my-api/flags/STRIPE_KEY/evaluate" \
  -H "Authorization: Bearer $KEY" \
  -d '{"environment":"production","branch":"dev","context":{}}'
GET/v1/apps/{name}/flag-tokens

List read-only tokens#

Token ids, names, environments and prefixes; never the token itself.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Response

200FlagTokenList

  • tokensFlagToken[]
    • idstring (uuid)
    • namestring
    • environmentstring

      one of production, preview, development

    • prefixstring
    • created_atstring (date-time)
    • created_bystring | null
    • last_used_atstring (date-time) | null
  • maxinteger

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/apps/my-api/flag-tokens" \
  -H "Authorization: Bearer $KEY"
POST/v1/apps/{name}/flag-tokens

Create a read-only token#

A token for the REST read path (/v1/flags/read), bound to one environment. The token is in the answer once and never again. The plan caps tokens per project.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Request bodyapplication/json

  • environmentstring

    one of production, preview, development · default "production"

  • namestring

    up to 100 characters

Response

201FlagTokenCreated

  • idstring (uuid)
  • tokenstring

    chf_… shown once

  • environmentstring
  • namestring
  • notestring

Errors

StatusDescription
400flag_bad_environment, flag_bad_name
401unauthorized: missing, invalid, expired or revoked credential
404not_found
409flag_limit
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/apps/my-api/flag-tokens" \
  -H "Authorization: Bearer $KEY" \
  -d '{"environment":"production","name":"my-api"}'
DELETE/v1/apps/{name}/flag-tokens/{id}

Revoke a read-only token#

The token stops working within five seconds.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • idstring (uuid)pathrequired

    the token's id

Response

200object

  • idstring
  • revokedboolean

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X DELETE "https://api.ibel.ai/v1/apps/my-api/flag-tokens/88e2fe1d-6d75-4de5-8c8f-27380ec66903" \
  -H "Authorization: Bearer $KEY"
GET/v1/apps/{name}/segments

List segments#

The project's segments and the plan's cap.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Response

200FlagSegmentList

  • segmentsFlagSegmentSummary[]
    • keystring
    • descriptionstring
    • attributestring
    • includedinteger

      how many users are listed

    • excludedinteger
    • rulesinteger
    • used_bystring[]

      the flags whose rules use it

    • created_atstring
    • updated_atstring
    • updated_bystring
  • limitsobject
    • planstring
    • segmentsinteger

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/apps/my-api/segments" \
  -H "Authorization: Bearer $KEY"
POST/v1/apps/{name}/segments

Create a segment#

A reusable list of users for flag rules (in_segment).

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Request bodyapplication/json

  • keystring
  • descriptionstring
  • attributestring

    what the lists hold (default: the context's key)

  • includedstring[]
  • excludedstring[]
  • rulesobject[]

Response

201FlagSegment

  • keystring
  • descriptionstring
  • attributestring

    what the lists hold (default: the context's key)

  • includedstring[]
  • excludedstring[]
  • rulesobject[]

Errors

StatusDescription
400flag_bad_segment
401unauthorized: missing, invalid, expired or revoked credential
404not_found
409flag_exists, flag_limit
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/apps/my-api/segments" \
  -H "Authorization: Bearer $KEY" \
  -d '{"key":"STRIPE_KEY","description":"…","attribute":"…","included":["…"],"excluded":["…"],"rules":[{"clauses":[{}]}]}'
GET/v1/apps/{name}/segments/{key}

One segment#

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the segment's key

Response

200FlagSegmentDetail

  • segmentFlagSegment
    • keystring
    • descriptionstring
    • attributestring

      what the lists hold (default: the context's key)

    • includedstring[]
    • excludedstring[]
    • rulesobject[]
  • used_bystring[]

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/apps/my-api/segments/STRIPE_KEY" \
  -H "Authorization: Bearer $KEY"
PUT/v1/apps/{name}/segments/{key}

Replace a segment#

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the segment's key

Request bodyapplication/json

  • keystring
  • descriptionstring
  • attributestring

    what the lists hold (default: the context's key)

  • includedstring[]
  • excludedstring[]
  • rulesobject[]

Response

200FlagSegment

  • keystring
  • descriptionstring
  • attributestring

    what the lists hold (default: the context's key)

  • includedstring[]
  • excludedstring[]
  • rulesobject[]

Errors

StatusDescription
400flag_bad_segment
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X PUT "https://api.ibel.ai/v1/apps/my-api/segments/STRIPE_KEY" \
  -H "Authorization: Bearer $KEY" \
  -d '{"key":"STRIPE_KEY","description":"…","attribute":"…","included":["…"],"excluded":["…"],"rules":[{"clauses":[{}]}]}'
DELETE/v1/apps/{name}/segments/{key}

Delete a segment#

A segment a flag rule uses cannot be deleted.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the segment's key

Response

200Deleted

  • namestring
  • deletedbooleanrequired

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
409flag_segment_in_use
500internal: an unexpected failure

Example

curl -X DELETE "https://api.ibel.ai/v1/apps/my-api/segments/STRIPE_KEY" \
  -H "Authorization: Bearer $KEY"
PATCH/v1/apps/{name}/segments/{key}

Change a segment#

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • keystringpathrequired

    the segment's key

Request bodyapplication/json

  • keystring
  • descriptionstring
  • attributestring

    what the lists hold (default: the context's key)

  • includedstring[]
  • excludedstring[]
  • rulesobject[]

Response

200FlagSegment

  • keystring
  • descriptionstring
  • attributestring

    what the lists hold (default: the context's key)

  • includedstring[]
  • excludedstring[]
  • rulesobject[]

Errors

StatusDescription
400flag_bad_segment
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X PATCH "https://api.ibel.ai/v1/apps/my-api/segments/STRIPE_KEY" \
  -H "Authorization: Bearer $KEY" \
  -d '{"key":"STRIPE_KEY","description":"…","attribute":"…","included":["…"],"excluded":["…"],"rules":[{"clauses":[{}]}]}'
GET/v1/apps/{name}/flag-keys

List flag keys#

Keys for OpenFeature (/ofrep/v1/…): ids, kinds, environments and prefixes; never the key.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Response

200FlagKeyList

  • keysFlagKeyInfo[]
    • idstring
    • namestring
    • kindstring
    • environmentstring
    • prefixstring
    • created_atstring
    • created_bystring

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/apps/my-api/flag-keys" \
  -H "Authorization: Bearer $KEY"
POST/v1/apps/{name}/flag-keys

Create a flag key#

A server key sees every flag of its environment; a browser key only the flags marked browser. The key is in the answer once.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Request bodyapplication/json

  • namestring

    up to 100 characters

  • kindstring

    one of server, browser · default "server"

  • environmentstring

    one of production, preview, development · default "production"

Response

201FlagKeyCreated

  • idstring
  • namestring
  • kindstring
  • environmentstring
  • prefixstring
  • created_atstring
  • created_bystring
  • keystring

    chf_… shown once

Errors

StatusDescription
400flag_bad_kind, flag_bad_environment, flag_bad_name
401unauthorized: missing, invalid, expired or revoked credential
404not_found
409flag_limit
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/apps/my-api/flag-keys" \
  -H "Authorization: Bearer $KEY" \
  -d '{"name":"my-api","kind":"server","environment":"production"}'
DELETE/v1/apps/{name}/flag-keys/{id}

Revoke a flag key#

The key stops working within five seconds.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • idstringpathrequired

    the key's id

Response

200Deleted

  • namestring
  • deletedbooleanrequired

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X DELETE "https://api.ibel.ai/v1/apps/my-api/flag-keys/88e2fe1d-6d75-4de5-8c8f-27380ec66903" \
  -H "Authorization: Bearer $KEY"
GET/v1/apps/{name}/flag-audit

Flag audit trail#

Who changed which flag, segment or key, newest first.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • beforestringquery

    an at from the last page

  • limitintegerquery

    1-200, default 50

Response

200FlagAudit

  • auditobject[]
    • atstring
    • actorstring
    • actionstring
    • targetstring
    • detailobject

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/apps/my-api/flag-audit" \
  -H "Authorization: Bearer $KEY"
GET/v1/apps/{name}/flag-usage

Flag requests per day#

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • daysintegerquery

    1-90, default 30

Response

200FlagUsage

  • daysobject[]
    • daystring
    • requestsinteger
  • totalinteger

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/apps/my-api/flag-usage" \
  -H "Authorization: Bearer $KEY"
GET/v1/flags/read

Read every flag (no context)#

Authorization: Bearer chf_… (a read-only token, not an API key). Every flag's value for the token's environment, evaluated with an empty context (so rules never match and rollouts fall to the default). Not cached: Cache-Control: no-store; cache the answer in your app for a few seconds.

Credential
An API key or a dashboard session
Roles
a read-only flags token

Parameters

  • keysstringquery

    a comma list of flag keys (default: all)

  • branchstringquery

    with a preview token: the git branch

Response

200FlagValues

  • environmentstring
  • flagsmap of any

Errors

StatusDescription
400flag_bad_keys, flag_bad_context
401unauthorized: missing, invalid, expired or revoked credential
429rate_limited: the plan's reads per second per token
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/flags/read" \
  -H "Authorization: Bearer $KEY"
POST/v1/flags/read

Evaluate flags for a context#

Authorization: Bearer chf_…. Each requested flag evaluated for context (for example {"key": "user-1", "plan": "pro"}), with the reason. The same rules and the same bucketing as env.FLAGS inside a function, so a user gets the same answer in both places. Targeting rules stay on our side.

Credential
An API key or a dashboard session
Roles
a read-only flags token

Request bodyapplication/json

  • contextobject
  • keysstring[]

    0–200 items

  • branchstring

Response

200FlagEvaluations

  • environmentstring
  • flagsmap of FlagEvaluation

Errors

StatusDescription
400flag_bad_keys, flag_bad_context
401unauthorized: missing, invalid, expired or revoked credential
429rate_limited: the plan's reads per second per token
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/flags/read" \
  -H "Authorization: Bearer $KEY" \
  -d '{"context":{},"keys":["…"],"branch":"dev"}'
POST/ofrep/v1/evaluate/flags/{key}

Evaluate one flag (OpenFeature)#

The OpenFeature remote evaluation protocol. An unknown flag, or one a browser key may not see, answers 404 with errorCode: FLAG_NOT_FOUND.

Credential
An API key or a dashboard session
Roles
a flag key

Parameters

  • keystringpathrequired

    the flag's key

Request bodyapplication/json

  • contextobject

    targetingKey and any attributes

Response

200OfrepEvaluation

  • keystring
  • valueany
  • reasonstring
  • variantstring
  • metadataobject

Errors

StatusDescription
401no or a wrong flag key
429past the plan's flag requests (Hobby: 100,000 a month); Retry-After

Example

curl -X POST "https://api.ibel.ai/ofrep/v1/evaluate/flags/STRIPE_KEY" \
  -H "Authorization: Bearer $KEY" \
  -d '{"context":{}}'
POST/ofrep/v1/evaluate/flags

Evaluate every flag (OpenFeature)#

Every flag the key may see, with an ETag; If-None-Match with it answers 304 when nothing changed.

Credential
An API key or a dashboard session
Roles
a flag key

Request bodyapplication/json

  • contextobject

    targetingKey and any attributes

Response

200OfrepBulk

  • flagsOfrepEvaluation[]
    • keystring
    • valueany
    • reasonstring
    • variantstring
    • metadataobject

Errors

StatusDescription
401no or a wrong flag key
429past the plan's flag requests (Hobby: 100,000 a month); Retry-After

Example

curl -X POST "https://api.ibel.ai/ofrep/v1/evaluate/flags" \
  -H "Authorization: Bearer $KEY" \
  -d '{"context":{}}'
GET/ofrep/v1/configuration

What the OpenFeature provider supports#

Cache and polling hints for OFREP providers.

Credential
An API key or a dashboard session
Roles
a flag key

Response

200OfrepConfiguration

  • namestring
  • capabilitiesobject

Errors

StatusDescription
401no or a wrong flag key
429past the plan's flag requests (Hobby: 100,000 a month); Retry-After

Example

curl "https://api.ibel.ai/ofrep/v1/configuration" \
  -H "Authorization: Bearer $KEY"