AB Tasty Flags API

Feature flag operations

Documentation

Specifications

Code Examples

Schemas & Data

📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/ab-tasty/refs/heads/main/json-schema/decision-api-campaign-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/ab-tasty/refs/heads/main/json-schema/decision-api-campaign-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/ab-tasty/refs/heads/main/json-schema/decision-api-flag-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/ab-tasty/refs/heads/main/json-schema/decision-api-flags-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/ab-tasty/refs/heads/main/json-schema/decision-api-activation-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/ab-tasty/refs/heads/main/json-schema/decision-api-flag-metadata-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/ab-tasty/refs/heads/main/json-schema/decision-api-campaign-response-normal-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/ab-tasty/refs/heads/main/json-schema/decision-api-campaign-response-simple-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/ab-tasty/refs/heads/main/json-schema/decision-api-campaign-response-full-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/ab-tasty/refs/heads/main/json-schema/decision-api-batch-activation-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/ab-tasty/refs/heads/main/json-schema/decision-api-batch-activation-item-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/ab-tasty/refs/heads/main/json-schema/decision-api-campaign-variation-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/ab-tasty/refs/heads/main/json-schema/decision-api-single-campaign-request-schema.json

Other Resources

OpenAPI Specification

ab-tasty-flags-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: AB Tasty Decision Activate Flags API
  version: 2.0.0
  description: The AB Tasty Decision API is a server-side service that evaluates a visitors context against your active experiments, personalizations, and feature flags, then returns a deterministic decision which campaigns the user qualifies for, the selected variation, and any variables or content to render. It centralizes targeting, traffic allocation, and bucketing so you can power A/B tests, gradual rollouts, and personalized experiences from backends, mobile apps, or edge workers while keeping user exposure consistent. You pass identifiers and attributes at request time, use the response to render the experience, and pair it with event tracking for measurement...
  contact:
    name: Flagship Support
    url: https://www.flagship.io
servers:
- url: https://decision.flagship.io/v2
  description: Production server
security:
- ApiKeyAuth: []
tags:
- name: Flags
  description: Feature flag operations
paths:
  /{environmentId}/flags:
    post:
      tags:
      - Flags
      summary: AB Tasty Post Environment Flags
      description: 'Returns the list of flags with values, campaign, and variation associated.

        Has the same behavior as /campaigns endpoint but with a different response format.

        '
      operationId: postEnvironmentidFlags
      parameters:
      - $ref: '#/components/parameters/EnvironmentId'
      - name: exposeAllKeys
        in: query
        description: If true, all flag keys (even flag keys with null values) will be returned
        required: false
        schema:
          type: boolean
          default: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlagsResponse'
              example:
                feature_new_checkout:
                  value: true
                  metadata:
                    campaignId: campaign_abc
                    campaignName: New Checkout Experiment
                    slug: null
                    type: ab
                    variationGroupId: vg_123
                    variationGroupName: Variation Group A
                    variationId: var_456
                    variationName: Treatment
                    reference: false
                button_color:
                  value: blue
                  metadata:
                    campaignId: campaign_def
                    campaignName: Button Color Test
                    slug: button-test
                    type: ab
                    variationGroupId: vg_789
                    variationGroupName: Color Variants
                    variationId: var_012
                    variationName: Blue Variant
                    reference: false
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '429':
          $ref: '#/components/responses/RateLimitError'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  responses:
    UnauthorizedError:
      description: Authentication information is missing or invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Invalid API key
            code: UNAUTHORIZED
    RateLimitError:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Rate limit exceeded. Maximum 200 req/s with burst of 600 req/s
            code: RATE_LIMIT_EXCEEDED
  schemas:
    Error:
      type: object
      properties:
        message:
          type: string
          description: Error message
        code:
          type: string
          description: Error code
    FlagMetadata:
      type: object
      properties:
        campaignId:
          type: string
          description: Campaign ID
          example: campaign_abc
        campaignName:
          type: string
          description: Campaign name
          example: New Checkout Experiment
        slug:
          type: string
          nullable: true
          description: Campaign slug (if configured)
          example: checkout-exp
        type:
          type: string
          description: Campaign type
          example: ab
        variationGroupId:
          type: string
          description: Variation group ID
          example: vg_123
        variationGroupName:
          type: string
          description: Variation group name
          example: Variation Group A
        variationId:
          type: string
          description: Variation ID
          example: var_456
        variationName:
          type: string
          description: Variation name
          example: Treatment
        reference:
          type: boolean
          description: Indicates if the variation is a reference variation
          example: false
    CampaignRequest:
      type: object
      required:
      - visitor_id
      properties:
        visitor_id:
          type: string
          description: Unique identifier for the application user or website visitor
          example: user123
        anonymous_id:
          type: string
          description: Identifier for anonymous visitors (e.g., session ID)
          example: session_xyz
        context:
          type: object
          description: JSON object of key-value pairs describing the user and device context
          additionalProperties: true
          example:
            device: mobile
            platform: ios
            subscription_level: premium
        visitor_consent:
          type: boolean
          description: Determines if visitor has consented to GDPR rules
          default: true
        trigger_hit:
          type: boolean
          description: Determines whether a CAMPAIGN hit should be automatically sent
          default: true
        decision_group:
          type: string
          nullable: true
          description: Groups visitors to receive the same variation assignment
          example: VIP_users
    Flag:
      type: object
      properties:
        value:
          oneOf:
          - type: object
          - type: string
          - type: number
          - type: boolean
          description: Value of the flag
        metadata:
          $ref: '#/components/schemas/FlagMetadata'
    FlagsResponse:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/Flag'
      description: Object with flag keys as properties
  parameters:
    EnvironmentId:
      name: environmentId
      in: path
      required: true
      description: Identifies your account and environment (preprod or prod)
      schema:
        type: string
      example: env_abc123
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication. Can be found in Flagship Platform under Parameters / Environment & Security