Superflag Insights API
The Insights API from Superflag — 2 operation(s) for insights.
The Insights API from Superflag — 2 operation(s) for insights.
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-insights-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: Insights
paths:
/api/v1/insights/query:
post:
operationId: queryFeatureInsights
security:
- BearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
additionalProperties: false
required:
- appId
- env
- from
- to
- grain
- measures
properties:
appId:
type: string
env:
type: string
from:
type: string
format: date-time
to:
type: string
format: date-time
grain:
type: string
enum:
- hour
- day
dimensions:
type: array
maxItems: 3
items:
type: string
measures:
type: array
minItems: 1
maxItems: 10
items:
type: string
filters:
type: object
additionalProperties: false
format:
type: string
enum:
- json
- csv
- ndjson
default: json
deadlineAt:
type: integer
minimum: 1
description: Absolute Unix-ms execution deadline. Clamped to the versioned wall-clock budget. Distinct from scan and cardinality bounds.
cursor:
type: string
maxLength: 8192
description: Opaque server resume token (`ia1_<hex>`). Tenant, key fingerprint, and Convex scan state are stored server-side.
parameters:
- name: X-Superflag-Deadline
in: header
required: false
schema:
type: integer
minimum: 1
description: Absolute Unix-ms deadline. Combined with body deadlineAt using the earlier instant.
responses:
'200':
description: Bounded aggregate insight rows with freshness, versions, approximation, query cost, and execution deadline metadata
'401':
description: Unauthorized bearer or API key
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'408':
description: 'query_deadline_exceeded: page-boundary stop. error.metadata includes retryable, remediation, cursor, execution (deadline/elapsed/remaining/pages), partial (scan_incomplete, rowsAvailable=false; partial.scannedBuckets is cumulative, same as queryCost.totalScannedBuckets), and queryCost (scannedBuckets this request; resumedScannedBuckets prior; totalScannedBuckets cumulative). Rate quota is charged. No orphaned backend work.'
'409':
description: 'insight_cursor_expired: the 15-minute resume TTL elapsed. Start a new query. Distinct from a stolen or mismatched cursor (400 validation_error).'
'429':
description: Query cost, cardinality, or per-authority rate limit
description: Query Feature Insights
tags:
- Insights
summary: Query feature insights
x-summary-source: derived
/api/v1/insights/events:
post:
operationId: queryInsightEvents
security:
- BearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
additionalProperties: false
required:
- appId
- env
- from
- to
- kinds
properties:
appId:
type: string
env:
type: string
from:
type: string
format: date-time
to:
type: string
format: date-time
kinds:
type: array
minItems: 1
maxItems: 4
items:
type: string
enum:
- decision
- assignment
- exposure
- outcome
filters:
type: object
additionalProperties: false
limit:
type: integer
minimum: 1
maximum: 100
default: 100
cursor:
type: string
maxLength: 8192
description: Opaque server resume token (`ie1_<hex>`). Legacy unprefixed Convex cursors are accepted once for HAPPY-332, then wrapped into a key-bound ie1_ page (scannedEvents starts at 0). Responses never echo the raw Convex cursor. Expired tokens return 409 insight_cursor_expired.
deadlineAt:
type: integer
minimum: 1
description: Absolute Unix-ms execution deadline. Clamped to the versioned wall-clock budget. Distinct from scan and cardinality bounds.
format:
type: string
enum:
- json
- csv
- ndjson
default: json
parameters:
- name: X-Superflag-Deadline
in: header
required: false
schema:
type: integer
minimum: 1
description: Absolute Unix-ms deadline. Combined with body deadlineAt using the earlier instant.
responses:
'200':
description: Redacted event page with opaque checkpoint, freshness, query cost, and execution deadline metadata
'401':
description: Unauthorized bearer or API key
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'408':
description: 'query_deadline_exceeded: page-boundary stop before the next event page. error.metadata includes retryable, remediation, cursor (always a versioned ie1_ token; a legacy unprefixed Convex cursor is accepted once then wrapped into a key-bound page), execution, partial (partial.scannedEvents is cumulative, same as queryCost.totalScannedEvents), and queryCost (scannedEvents this request; resumedScannedEvents prior; totalScannedEvents cumulative). Rate quota is charged. No orphaned backend work.'
'409':
description: 'insight_cursor_expired: the 15-minute resume TTL elapsed. Start a new query. Distinct from a stolen or mismatched cursor (400 validation_error).'
'429':
description: Per-authority event query rate limit
description: Query Insight Events
tags:
- Insights
summary: Query insight events
x-summary-source: derived
components:
schemas:
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
securitySchemes:
BearerAuth:
type: http
scheme: bearer
ApiKeyAuth:
type: apiKey
in: header
name: X-API-Key