Superflag Metrics API

The Metrics API from Superflag — 3 operation(s) for metrics.

GitHub OpenAPI

Operations 5

GET /api/v1/metrics List metrics #
POST /api/v1/metrics Create metric #
GET /api/v1/metrics/{id} Get metric #
GET /api/v1/metrics/{id}/revisions List metric revisions #
POST /api/v1/metrics/{id}/revisions Revise metric #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • 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.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/superflag-sh:superflag-sh-metrics-api"
All apis
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.

Get an API 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 Specification

superflag-sh-metrics-api-openapi.yml Raw ↑
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: Metrics
paths:
  /api/v1/metrics:
    get:
      operationId: listMetrics
      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: Environment metric heads
        '401':
          description: Unauthorized bearer or API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      description: List Metrics
      tags:
      - Metrics
      summary: List metrics
      x-summary-source: derived
    post:
      operationId: createMetric
      security:
      - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MetricCreateRequest'
      responses:
        '201':
          description: Created metric revision
        '401':
          description: Unauthorized bearer or API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '409':
          description: Key or idempotency conflict
      description: Create Metric
      tags:
      - Metrics
      summary: Create metric
      x-summary-source: derived
  /api/v1/metrics/{id}:
    get:
      operationId: getMetric
      security:
      - BearerAuth: []
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          minLength: 1
          maxLength: 128
      - 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: revision
        in: query
        required: false
        schema:
          type: integer
          minimum: 1
      responses:
        '200':
          description: Metric head or exact immutable revision
        '401':
          description: Unauthorized bearer or API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: Metric revision not found
      description: Get Metric
      tags:
      - Metrics
      summary: Get metric
      x-summary-source: derived
  /api/v1/metrics/{id}/revisions:
    get:
      operationId: listMetricRevisions
      security:
      - BearerAuth: []
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          minLength: 1
          maxLength: 128
      - 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: Complete immutable metric revision history
        '401':
          description: Unauthorized bearer or API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      description: List Metric Revisions
      tags:
      - Metrics
      summary: List metric revisions
      x-summary-source: derived
    post:
      operationId: reviseMetric
      security:
      - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MetricReviseRequest'
      responses:
        '200':
          description: Appended metric revision
        '401':
          description: Unauthorized bearer or API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '409':
          description: Metric revision CAS conflict
      description: Revise Metric
      tags:
      - Metrics
      summary: Revise metric
      x-summary-source: derived
components:
  schemas:
    MetricDefinition:
      type: object
      additionalProperties: false
      required:
      - schemaVersion
      - owner
      - eventKey
      - kind
      - visibility
      - randomizationUnit
      - desiredDirection
      - attributionWindowSeconds
      - filters
      properties:
        schemaVersion:
          const: 1
        name:
          type: string
          minLength: 1
          maxLength: 256
        description:
          type: string
          minLength: 1
          maxLength: 2000
        owner:
          type: string
          minLength: 1
          maxLength: 256
        eventKey:
          type: string
          minLength: 1
          maxLength: 128
        kind:
          enum:
          - conversion
          - count
          - sum
          - mean
          - ratio
        visibility:
          enum:
          - server
          - client
        randomizationUnit:
          type: object
          additionalProperties: false
          required:
          - kind
          properties:
            kind:
              const: subject
        desiredDirection:
          enum:
          - increase
          - decrease
        unit:
          type: string
          minLength: 1
          maxLength: 64
        attributionWindowSeconds:
          type: integer
          minimum: 1
          maximum: 604800
        filters:
          type: array
          maxItems: 20
          items:
            type: object
            additionalProperties: false
            required:
            - dimension
            - operator
            - values
            properties:
              dimension:
                type: string
                minLength: 1
                maxLength: 128
              operator:
                enum:
                - eq
                - in
              values:
                type: array
                minItems: 1
                maxItems: 20
                items:
                  type:
                  - string
                  - number
                  - boolean
        numerator:
          $ref: '#/components/schemas/MetricRevisionReference'
        denominator:
          $ref: '#/components/schemas/MetricRevisionReference'
    MetricRevisionReference:
      type: object
      additionalProperties: false
      required:
      - key
      - revision
      properties:
        key:
          type: string
          minLength: 1
          maxLength: 128
        revision:
          type: integer
          minimum: 1
    MetricReviseRequest:
      type: object
      additionalProperties: false
      required:
      - appId
      - env
      - metricRevision
      - definition
      - idempotencyKey
      properties:
        appId:
          type: string
        env:
          type: string
        metricRevision:
          type: integer
          minimum: 1
        definition:
          $ref: '#/components/schemas/MetricDefinition'
        idempotencyKey:
          type: string
          minLength: 16
          maxLength: 128
        source:
          enum:
          - cli
          - api
          - agent
          default: api
        reason:
          type: string
          maxLength: 1000
        dryRun:
          type: boolean
          default: false
    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
    MetricCreateRequest:
      type: object
      additionalProperties: false
      required:
      - appId
      - env
      - key
      - definition
      - idempotencyKey
      properties:
        appId:
          type: string
        env:
          type: string
        key:
          type: string
        definition:
          $ref: '#/components/schemas/MetricDefinition'
        idempotencyKey:
          type: string
          minLength: 16
          maxLength: 128
        source:
          enum:
          - cli
          - api
          - agent
          default: api
        reason:
          type: string
          maxLength: 1000
        dryRun:
          type: boolean
          default: false
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key