Superflag Flags API
The Flags API from Superflag — 2 operation(s) for flags.
The Flags API from Superflag — 2 operation(s) for flags.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/superflag-sh:superflag-sh-flags-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Superflag control-plane evaluation and advanced…
version: 1.0.0
description: 'Public Superflag HTTP API. Discovery documents at /openapi.json and /api/v1/contract do not require auth. Delivery and management routes require Authorization: Bearer with a cli_, admin_, sdk_, or pub_ credential. See https://superflag.sh/docs/api-reference/overview.'
servers:
- url: https://superflag.sh
description: Production
tags:
- name: Flags
paths:
/api/v1/flags/bulk:
patch:
operationId: atomicBulkApply
security:
- BearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/BulkApplyRequest'
responses:
'200':
description: Atomic apply or idempotent replay with version, change id, and replay metadata
content:
application/json:
schema:
$ref: '#/components/schemas/BulkApplyResponse'
'401':
description: Unauthorized bearer or API key
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'409':
description: Version or idempotency conflict
description: Atomic Bulk Apply
tags:
- Flags
summary: Atomic bulk apply
x-summary-source: derived
/api/v1/flags:
get:
operationId: listFlags
description: List legacy flags for one environment.
security:
- BearerAuth: []
parameters:
- name: appId
in: query
required: true
schema:
type: string
minLength: 1
maxLength: 128
- name: env
in: query
required: true
schema:
type: string
minLength: 1
maxLength: 128
responses:
'200':
description: Flag DTOs and the current config version
content:
application/json:
schema:
$ref: '#/components/schemas/FlagListResponse'
'400':
description: Missing appId or env
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'401':
description: Missing bearer, or a credential that is not cli_/admin_. sdk_/pub_ cannot list flags.
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'403':
description: Caller cannot access this app
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'404':
description: Environment not found
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
tags:
- Flags
summary: List flags
x-summary-source: derived
patch:
operationId: upsertFlag
description: Create, update, upsert, or toggle one legacy flag. New flags require type and value. Rollout and variants are mutually exclusive.
security:
- BearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/FlagPatchRequest'
responses:
'200':
description: Updated flag, version, and change id
content:
application/json:
schema:
$ref: '#/components/schemas/FlagMutationResponse'
'400':
description: Invalid flag patch
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'401':
description: Missing bearer, or a credential that is not cli_/admin_.
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'403':
description: Caller cannot access this app
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'404':
description: Flag or environment not found
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'409':
description: Concurrent flag mutation
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'429':
description: Flag quota exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
tags:
- Flags
summary: Upsert flag
x-summary-source: derived
delete:
operationId: deleteFlag
description: Delete one legacy flag by key.
security:
- BearerAuth: []
parameters:
- name: appId
in: query
required: true
schema:
type: string
minLength: 1
maxLength: 128
- name: env
in: query
required: true
schema:
type: string
minLength: 1
maxLength: 128
- name: key
in: query
required: true
schema:
type: string
minLength: 1
responses:
'200':
description: Deleted flag version and change id
content:
application/json:
schema:
$ref: '#/components/schemas/FlagDeleteResponse'
'400':
description: Missing appId, env, or key
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'401':
description: Missing bearer, or a credential that is not cli_/admin_.
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'403':
description: Caller cannot access this app
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'404':
description: Flag not found
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
tags:
- Flags
summary: Delete flag
x-summary-source: derived
components:
schemas:
AdvancedFlagResource:
type: object
additionalProperties: false
required:
- type
- description
- tags
- owner
- lifecycle
- enabled
- variations
- offVariation
- fallthrough
properties:
type:
type: string
enum:
- boolean
- string
- number
- object
description:
type: string
minLength: 1
tags:
type: array
items:
type: string
owner:
type: string
minLength: 1
lifecycle:
type: string
enum:
- draft
- active
- deprecated
- archived
enabled:
type: boolean
variations:
type: object
additionalProperties: true
offVariation:
type: string
fallthrough:
$ref: '#/components/schemas/Serve'
prerequisites:
type: array
items:
type: object
rules:
type: array
items:
type: object
required:
- id
- when
- serve
properties:
id:
type: string
when:
$ref: '#/components/schemas/TargetingExpression'
serve:
$ref: '#/components/schemas/Serve'
schedule:
$ref: '#/components/schemas/Schedule'
unallocated:
type: string
enum:
- continue
- 'off'
description: Absent or continue keeps today's fallthrough. off serves the flag off variation when a valid bucket misses a rollout or progressive allocation.
schedule:
$ref: '#/components/schemas/Schedule'
visibility:
type: string
enum:
- server
- client
metadata:
type: object
additionalProperties: true
AdvancedConfigurationDocument:
type: object
additionalProperties: false
required:
- schemaVersion
- flags
properties:
schemaVersion:
const: 1
source:
type: object
required:
- app
- environment
properties:
app:
type: string
environment:
type: string
configVersion:
type: integer
minimum: 0
flags:
type: object
additionalProperties:
$ref: '#/components/schemas/AdvancedFlagResource'
segments:
type: object
additionalProperties:
$ref: '#/components/schemas/AdvancedSegmentResource'
metadata:
type: object
additionalProperties: true
BulkApplyRequest:
type: object
required:
- appId
- env
- ifVersion
- idempotencyKey
properties:
appId:
type: string
minLength: 1
env:
type: string
minLength: 1
updates:
type: array
maxItems: 500
advancedConfig:
$ref: '#/components/schemas/AdvancedConfigurationDocument'
privacy:
type: object
properties:
allowedContextAttributes:
type: array
items:
type: string
ifVersion:
type: integer
minimum: 0
idempotencyKey:
type: string
minLength: 16
maxLength: 128
BulkApplyReplay:
type: object
additionalProperties: false
required:
- idempotencyKey
- requestHash
- replayed
- versionBefore
- versionAfter
properties:
idempotencyKey:
$ref: '#/components/schemas/IdempotencyKey'
requestHash:
type: string
minLength: 1
replayed:
type: boolean
versionBefore:
type: integer
minimum: 0
versionAfter:
type: integer
minimum: 0
BulkApplyResponse:
type: object
additionalProperties: false
required:
- apiVersion
- success
- updated
- version
- replay
- changeId
properties:
apiVersion:
const: 1
success:
const: true
updated:
type: integer
minimum: 0
version:
type: integer
minimum: 0
replay:
$ref: '#/components/schemas/BulkApplyReplay'
changeId:
type: string
minLength: 1
FlagPatchRequest:
type: object
additionalProperties: false
required:
- appId
- env
- key
properties:
appId:
type: string
minLength: 1
env:
type: string
minLength: 1
key:
type: string
minLength: 1
mode:
enum:
- create
- update
- upsert
default: upsert
toggle:
type: boolean
default: false
type:
enum:
- bool
- string
- number
- json
value:
oneOf:
- type: string
- type: number
- type: boolean
- type: array
items: {}
- type: object
additionalProperties: true
rollout:
oneOf:
- type: object
additionalProperties: false
required:
- percentage
properties:
percentage:
type: number
minimum: 0
maximum: 100
- type: 'null'
variants:
oneOf:
- type: array
minItems: 1
items:
type: object
required:
- value
- weight
properties:
value:
oneOf:
- type: string
- type: number
- type: boolean
- type: array
items: {}
- type: object
additionalProperties: true
weight:
type: number
minimum: 0
maximum: 100
name:
type: string
- type: 'null'
clientEnabled:
type:
- boolean
- 'null'
TargetingExpression:
type: object
description: Recursive all, any, not, match, segment, or flag targeting expression
required:
- op
properties:
op:
type: string
enum:
- all
- any
- not
- match
- segment
- flag
expressions:
type: array
items:
$ref: '#/components/schemas/TargetingExpression'
expression:
$ref: '#/components/schemas/TargetingExpression'
attribute:
type: string
operator:
type: string
value: {}
segment:
type: string
flag:
type: string
equals:
type: boolean
negate:
type: boolean
FlagListResponse:
type: object
additionalProperties: false
required:
- apiVersion
- flags
- version
properties:
apiVersion:
const: 1
flags:
type: array
items:
$ref: '#/components/schemas/FlagDto'
version:
type: integer
minimum: 0
WeightedVariation:
type: object
additionalProperties: false
required:
- variation
- weight
properties:
variation:
type: string
minLength: 1
weight:
type: integer
minimum: 0
maximum: 100000
FlagDto:
type: object
additionalProperties: false
required:
- key
- type
- value
- createdAt
- updatedAt
properties:
key:
type: string
minLength: 1
type:
enum:
- bool
- string
- number
- json
value:
oneOf:
- type: string
- type: number
- type: boolean
- type: array
items: {}
- type: object
additionalProperties: true
rollout:
type: object
additionalProperties: false
required:
- percentage
properties:
percentage:
type: number
minimum: 0
maximum: 100
variants:
type: array
items:
type: object
additionalProperties: false
required:
- value
- weight
properties:
value:
oneOf:
- type: string
- type: number
- type: boolean
- type: array
items: {}
- type: object
additionalProperties: true
weight:
type: number
minimum: 0
maximum: 100
name:
type: string
minLength: 1
clientEnabled:
type: boolean
createdAt:
$ref: '#/components/schemas/IsoTimestamp'
updatedAt:
$ref: '#/components/schemas/IsoTimestamp'
FlagMutationResponse:
type: object
additionalProperties: false
required:
- apiVersion
- success
- version
- changeId
- flag
properties:
apiVersion:
const: 1
success:
const: true
version:
type: integer
minimum: 0
changeId:
type: string
minLength: 1
flag:
$ref: '#/components/schemas/FlagDto'
IsoTimestamp:
type: string
format: date-time
Serve:
oneOf:
- type: object
additionalProperties: false
required:
- variation
properties:
variation:
type: string
minLength: 1
- type: object
additionalProperties: false
required:
- rollout
properties:
rollout:
$ref: '#/components/schemas/Rollout'
- type: object
additionalProperties: false
required:
- progressive
properties:
progressive:
type: object
additionalProperties: false
required:
- start
- end
- from
- to
properties:
start:
type: string
format: date-time
end:
type: string
format: date-time
from:
$ref: '#/components/schemas/Rollout'
to:
$ref: '#/components/schemas/Rollout'
AdvancedSegmentResource:
type: object
additionalProperties: false
properties:
included:
type: array
items:
type: string
excluded:
type: array
items:
type: string
rules:
type: array
items:
$ref: '#/components/schemas/TargetingExpression'
schedule:
$ref: '#/components/schemas/Schedule'
visibility:
type: string
enum:
- server
- client
description:
type: string
FlagDeleteResponse:
type: object
additionalProperties: false
required:
- apiVersion
- success
- version
- changeId
properties:
apiVersion:
const: 1
success:
const: true
version:
type: integer
minimum: 0
changeId:
type: string
minLength: 1
Rollout:
type: object
additionalProperties: false
required:
- variations
properties:
variations:
type: array
minItems: 1
items:
$ref: '#/components/schemas/WeightedVariation'
bucketBy:
type: string
minLength: 1
salt:
type: string
IdempotencyKey:
type: string
minLength: 16
maxLength: 128
pattern: ^[A-Za-z0-9._:-]+$
ApiError:
type: object
additionalProperties: false
required:
- error
properties:
apiVersion:
type: integer
const: 1
code:
type: string
message:
type: string
resolution:
type: string
error:
oneOf:
- type: string
- type: object
required:
- code
- message
properties:
code:
type: string
message:
type: string
resolution:
type: string
retryable:
type: boolean
metadata:
type: object
Schedule:
type: object
additionalProperties: false
properties:
start:
type: string
format: date-time
end:
type: string
format: date-time
securitySchemes:
BearerAuth:
type: http
scheme: bearer
ApiKeyAuth:
type: apiKey
in: header
name: X-API-Key