Amplitude Flags API

Flag configuration retrieval for local evaluation

GitHub OpenAPI
Business capability
Feature Flag Management BC-4210.50

Operations 5

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /v1/flags Download all flag configurations for local evaluation · Amplitude Get Flag Configurations #
Ask an LLM
“How do I get every flag's variants and targeting rules to run local evaluation on the client?”
“Can I bootstrap an SDK with the full flag config before evaluating users?”
Tell an agent
Download all flag configurations for local evaluation.
Fetch the full flag config with variants and targeting rules.
GET /api/1/flags List all feature flags in the project · Amplitude List All Flags #
Ask an LLM
“Which feature flags are defined in my project?”
“Can I page through all flags with a cursor?”
Tell an agent
List all feature flags.
List {limit} flags starting at cursor {cursor}.
POST /api/1/flags Create a feature flag · Amplitude Create a Flag #
Ask an LLM
“How do I create a new feature flag with variants?”
“Can I choose the bucketing key for a flag?”
Tell an agent
Create a feature flag with key {key}.
Create flag {key} with variants {variants} and bucketing key {bucketingKey}.
GET /api/1/flags/{id} Get a feature flag by ID · Amplitude Get a Flag #
Ask an LLM
“What variants and targeting does a specific flag have?”
“Can I fetch one flag's full configuration by its ID?”
Tell an agent
Get feature flag {id}.
Show the variants and targeting of flag {id}.
PATCH /api/1/flags/{id} Update a feature flag · Amplitude Update a Flag #
Ask an LLM
“Can I turn a flag on or off?”
“How do I change the variants of an existing flag?”
Tell an agent
Update feature flag {id} to enabled {enabled}.
Set the variants of existing flag {id} to {variants}.

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/amplitude:amplitude-flags-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

amplitude-flags-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Amplitude Experiment Evaluation Flags API
  description: The Amplitude Experiment Evaluation API retrieves variant assignment data for users through remote evaluation. When called, it evaluates targeting rules and returns the assigned variant for each active experiment or feature flag. The API also tracks assignment events automatically in Amplitude Analytics. It is used by server-side applications that need to determine which experiment variant or feature flag value to serve to a given user in real time.
  version: '1'
  contact:
    name: Amplitude Support
    url: https://amplitude.com/contact
  termsOfService: https://amplitude.com/terms
servers:
- url: https://api.lab.amplitude.com
  description: Amplitude Experiment Evaluation Server
security:
- apiKeyAuth: []
tags:
- name: Flags
  description: Flag configuration retrieval for local evaluation
paths:
  /v1/flags:
    get:
      operationId: getFlags
      summary: Amplitude Get Flag Configurations
      description: Download all flag configurations for local evaluation. This endpoint returns the full flag configuration including targeting rules, variants, and segment definitions. Useful for bootstrapping client-side local evaluation SDKs with initialFlags or running evaluation in edge environments.
      tags:
      - Flags
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                description: Array of flag configuration objects.
                items:
                  $ref: '#/components/schemas/FlagConfiguration'
              examples:
                getFlags200Example:
                  summary: Default getFlags 200 response
                  x-microcks-default: true
                  value:
                  - example_value
        '401':
          description: Unauthorized - invalid deployment key
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /api/1/flags:
    get:
      operationId: listFlags
      summary: Amplitude List All Flags
      description: Retrieve a list of all feature flags in the project. Returns flag metadata including status, variants, and deployment information.
      tags:
      - Flags
      parameters:
      - name: limit
        in: query
        description: The maximum number of flags to return.
        schema:
          type: integer
      - name: cursor
        in: query
        description: A cursor for pagination returned from a previous request.
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlagListResponse'
              examples:
                listFlags200Example:
                  summary: Default listFlags 200 response
                  x-microcks-default: true
                  value:
                    flags:
                    - example_value
                    nextCursor: example_value
        '401':
          description: Unauthorized
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      operationId: createFlag
      summary: Amplitude Create a Flag
      description: Create a new feature flag with the specified key, variants, and targeting configuration.
      tags:
      - Flags
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFlagRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Flag'
              examples:
                createFlag200Example:
                  summary: Default createFlag 200 response
                  x-microcks-default: true
                  value:
                    id: '500123'
                    projectId: '500123'
                    key: example_value
                    name: Example Name
                    description: Example description text
                    enabled: true
                    evaluationMode: local
                    bucketingKey: example_value
                    bucketingSalt: example_value
                    variants:
                    - example_value
                    deployments:
                    - example_value
                    segments:
                    - example_value
                    state: draft
        '400':
          description: Bad request - invalid flag configuration
        '401':
          description: Unauthorized
        '409':
          description: Flag key already exists
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /api/1/flags/{id}:
    get:
      operationId: getFlag
      summary: Amplitude Get a Flag
      description: Retrieve a single feature flag by its ID including full configuration details such as deployments, variants, and targeting segments.
      tags:
      - Flags
      parameters:
      - $ref: '#/components/parameters/flagId'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Flag'
              examples:
                getFlag200Example:
                  summary: Default getFlag 200 response
                  x-microcks-default: true
                  value:
                    id: '500123'
                    projectId: '500123'
                    key: example_value
                    name: Example Name
                    description: Example description text
                    enabled: true
                    evaluationMode: local
                    bucketingKey: example_value
                    bucketingSalt: example_value
                    variants:
                    - example_value
                    deployments:
                    - example_value
                    segments:
                    - example_value
                    state: draft
        '401':
          description: Unauthorized
        '404':
          description: Flag not found
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    patch:
      operationId: updateFlag
      summary: Amplitude Update a Flag
      description: Update an existing feature flag's configuration. Only the fields included in the request body are updated.
      tags:
      - Flags
      parameters:
      - $ref: '#/components/parameters/flagId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFlagRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Flag'
              examples:
                updateFlag200Example:
                  summary: Default updateFlag 200 response
                  x-microcks-default: true
                  value:
                    id: '500123'
                    projectId: '500123'
                    key: example_value
                    name: Example Name
                    description: Example description text
                    enabled: true
                    evaluationMode: local
                    bucketingKey: example_value
                    bucketingSalt: example_value
                    variants:
                    - example_value
                    deployments:
                    - example_value
                    segments:
                    - example_value
                    state: draft
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '404':
          description: Flag not found
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    FlagConfiguration:
      type: object
      properties:
        key:
          type: string
          description: The unique key identifying the flag.
        metadata:
          type: object
          description: Metadata about the flag configuration.
          properties:
            deployed:
              type: boolean
              description: Whether the flag is currently deployed.
            evaluationMode:
              type: string
              description: The evaluation mode, either local or remote.
            flagType:
              type: string
              description: The type of flag, such as experiment or release.
            flagVersion:
              type: integer
              description: The version of the flag configuration.
        segments:
          type: array
          description: Array of targeting segments for this flag.
          items:
            type: object
            properties:
              conditions:
                type: array
                description: Array of targeting conditions.
                items:
                  type: object
                  additionalProperties: true
              variant:
                type: string
                description: The variant key to assign when conditions are met.
        variants:
          type: object
          description: Map of variant keys to variant configuration objects.
          additionalProperties:
            type: object
            properties:
              key:
                type: string
                description: The variant key.
              payload:
                description: Optional payload for the variant.
    CreateFlagRequest:
      type: object
      required:
      - key
      properties:
        key:
          type: string
          description: The unique key for the flag.
        name:
          type: string
          description: The display name of the flag.
        description:
          type: string
          description: A description of the flag's purpose.
        variants:
          type: array
          description: Array of variant configurations.
          items:
            $ref: '#/components/schemas/VariantConfig'
        bucketingKey:
          type: string
          description: The property used for bucketing.
    FlagListResponse:
      type: object
      properties:
        flags:
          type: array
          description: Array of feature flag objects.
          items:
            $ref: '#/components/schemas/Flag'
        nextCursor:
          type: string
          description: A cursor for fetching the next page of results.
    VariantConfig:
      type: object
      properties:
        key:
          type: string
          description: The unique key for the variant.
        name:
          type: string
          description: The display name of the variant.
        payload:
          description: An optional JSON payload associated with the variant.
        description:
          type: string
          description: A description of what this variant does.
        rolloutWeight:
          type: integer
          description: The rollout weight as a percentage (0-100) controlling traffic allocation to this variant.
          minimum: 0
          maximum: 100
    UpdateFlagRequest:
      type: object
      properties:
        name:
          type: string
          description: The updated display name.
        description:
          type: string
          description: The updated description.
        enabled:
          type: boolean
          description: Whether the flag should be enabled.
        variants:
          type: array
          description: Updated variant configurations.
          items:
            $ref: '#/components/schemas/VariantConfig'
        segments:
          type: array
          description: Updated targeting segment configurations.
          items:
            $ref: '#/components/schemas/Segment'
    Flag:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the flag.
        projectId:
          type: string
          description: The project ID the flag belongs to.
        key:
          type: string
          description: The unique key used to reference the flag in code.
        name:
          type: string
          description: The display name of the flag.
        description:
          type: string
          description: A description of the flag's purpose.
        enabled:
          type: boolean
          description: Whether the flag is enabled.
        evaluationMode:
          type: string
          description: The evaluation mode, either local or remote.
          enum:
          - local
          - remote
        bucketingKey:
          type: string
          description: The property used for bucketing users into variants.
        bucketingSalt:
          type: string
          description: The salt used for hashing during bucketing.
        variants:
          type: array
          description: Array of variant configurations.
          items:
            $ref: '#/components/schemas/VariantConfig'
        deployments:
          type: array
          description: Array of deployment IDs the flag is deployed to.
          items:
            type: string
        segments:
          type: array
          description: Array of targeting segment configurations.
          items:
            $ref: '#/components/schemas/Segment'
        state:
          type: string
          description: The current state of the flag.
          enum:
          - draft
          - active
          - archived
    Segment:
      type: object
      properties:
        name:
          type: string
          description: The display name of the segment.
        conditions:
          type: array
          description: Array of targeting conditions that define this segment.
          items:
            type: object
            properties:
              type:
                type: string
                description: The condition type.
              prop:
                type: string
                description: The property to evaluate.
              op:
                type: string
                description: The comparison operator.
              values:
                type: array
                description: The values to compare against.
                items:
                  type: string
        variant:
          type: string
          description: The variant key to assign when this segment matches.
        percentage:
          type: integer
          description: The percentage of matching users to include (0-100).
          minimum: 0
          maximum: 100
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Pass your deployment key in the Authorization header with the prefix Api-Key, for example Api-Key YOUR_DEPLOYMENT_KEY.
    bearerAuth:
      type: http
      scheme: bearer
      description: Use a Management API key generated in the Experiment sidebar of the Amplitude UI. Pass it in the Authorization header as Bearer YOUR_MANAGEMENT_API_KEY.
  parameters:
    flagId:
      name: id
      in: path
      required: true
      description: The unique identifier of the feature flag.
      schema:
        type: string
externalDocs:
  description: Amplitude Experiment Evaluation API Documentation
  url: https://amplitude.com/docs/apis/experiment/experiment-evaluation-api