Bucket Apps API

The Apps API from Bucket — 9 operation(s) for apps.

OpenAPI Specification

bucket-apps-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Reflag Management Apps API
  version: 3.0.1
  description: Feature flag Management API
  contact:
    name: Reflag Support
    url: https://reflag.com/support
  license:
    name: Proprietary
    url: https://reflag.com/
servers:
- url: https://app.reflag.com/api
  description: Production server
security:
- APIKey: []
tags:
- name: Apps
paths:
  /apps/{appId}:
    get:
      summary: Get details of an application
      description: Retrieve a specific application by its identifier
      operationId: getApp
      parameters:
      - in: path
        name: appId
        schema:
          $ref: '#/components/schemas/appId'
        required: true
        description: App identifier
      responses:
        '200':
          description: Requested resource retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/app'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Requested resource, or its parent, not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Apps
  /apps:
    get:
      summary: List of applications
      description: Retrieve all accessible applications
      operationId: listApps
      parameters:
      - in: query
        name: orgId
        schema:
          $ref: '#/components/schemas/orgId'
      responses:
        '200':
          description: Requested resource retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/appHeaderCollection'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Requested resource, or its parent, not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Apps
  /apps/{appId}/environments:
    get:
      summary: List environments for application
      description: Retrieve all environments for a specific application
      operationId: listEnvironments
      parameters:
      - in: path
        name: appId
        schema:
          $ref: '#/components/schemas/appId'
        required: true
        description: App identifier
      - in: query
        name: sortOrder
        schema:
          $ref: '#/components/schemas/sortOrder'
        description: Sort order applied to the sorting column
      - in: query
        name: sortBy
        schema:
          $ref: '#/components/schemas/environmentHeaderSortByColumn'
        description: The column to sort by
      responses:
        '200':
          description: Requested resource retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/environmentHeaderCollection'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Requested resource, or its parent, not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Apps
  /apps/{appId}/environments/{envId}:
    get:
      summary: Get environment details
      description: Retrieve details for a specific environment
      operationId: getEnvironment
      parameters:
      - in: path
        name: appId
        schema:
          $ref: '#/components/schemas/appId'
        required: true
        description: App identifier
      - in: path
        name: envId
        schema:
          $ref: '#/components/schemas/envId'
        required: true
        description: Environment identifier
      responses:
        '200':
          description: Requested resource retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/environment'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Requested resource, or its parent, not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Apps
  /apps/{appId}/flags:
    get:
      summary: List flags for application
      description: Retrieve all flags for a specific application
      operationId: listFlags
      parameters:
      - in: path
        name: appId
        schema:
          $ref: '#/components/schemas/appId'
        required: true
        description: App identifier
      responses:
        '200':
          description: Requested resource retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/flagHeaderCollection'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Requested resource, or its parent, not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Apps
    post:
      summary: Create a flag
      description: Create a new flag in the application. Returns the created flag details.
      operationId: createFlag
      parameters:
      - in: path
        name: appId
        schema:
          $ref: '#/components/schemas/appId'
        required: true
        description: App identifier
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                key:
                  description: Key of the flag
                  type: string
                  minLength: 1
                name:
                  description: Name of the flag
                  type: string
                  minLength: 1
                description:
                  description: Description of the flag
                  anyOf:
                  - type: string
                    maxLength: 8192
                  - type: 'null'
                stageId:
                  description: Stage ID of the flag
                  type: string
                  minLength: 14
                  maxLength: 14
                ownerUserId:
                  anyOf:
                  - type: string
                  - type: 'null'
                permanent:
                  default: false
                  type: boolean
                secret:
                  description: Whether the flag is secret
                  type: boolean
              required:
              - key
              - name
              additionalProperties: false
      responses:
        '200':
          description: Requested resource retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  flag:
                    type: object
                    properties:
                      id:
                        $ref: '#/components/schemas/flagId'
                      key:
                        $ref: '#/components/schemas/flagKey'
                      name:
                        description: Flag name
                        type: string
                        minLength: 1
                        maxLength: 255
                      description:
                        description: Flag description
                        type: string
                      stage:
                        $ref: '#/components/schemas/stageHeader'
                      owner:
                        $ref: '#/components/schemas/reflagUserHeader'
                      archived:
                        description: Whether the flag is archived
                        type: boolean
                      stale:
                        description: Whether the flag is stale
                        type: boolean
                      permanent:
                        description: Whether the flag is permanent
                        type: boolean
                      createdAt:
                        description: Timestamp when the flag was created
                        type: string
                      rolledOutToEveryoneAt:
                        description: Timestamp when the flag was rolled out to everyone
                        type: string
                      codeRefsCleanedUp:
                        description: Whether code references for this flag have been cleaned up
                        type: boolean
                      codeRefsMarkedCleanUserName:
                        description: Name of the user who marked code references as cleaned up
                        type: string
                      codeRefsMarkedCleanAt:
                        description: Timestamp when code references were marked as cleaned up
                        type: string
                      lastCheckAt:
                        description: Timestamp when the flag was last checked
                        type: string
                      noRecentChecks:
                        description: Whether the flag has no recent access checks
                        type: boolean
                      lastTrackAt:
                        description: Timestamp when the flag was last tracked
                        type: string
                      parentFlagId:
                        description: Parent flag ID
                        type: string
                    required:
                    - id
                    - key
                    - name
                    - archived
                    - stale
                    - permanent
                    - codeRefsCleanedUp
                    - noRecentChecks
                    additionalProperties: false
                required:
                - flag
                additionalProperties: false
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Requested resource, or its parent, not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Apps
  /apps/{appId}/flags/{flagId}:
    patch:
      summary: Update a flag
      description: Update an existing flag
      operationId: updateFlag
      parameters:
      - in: path
        name: appId
        schema:
          $ref: '#/components/schemas/appId'
        required: true
        description: App identifier
      - in: path
        name: flagId
        schema:
          $ref: '#/components/schemas/flagId'
        required: true
        description: Flag ID
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  description: Name of the flag
                  type: string
                  minLength: 1
                description:
                  description: Description of the flag
                  anyOf:
                  - type: string
                    maxLength: 8192
                  - type: 'null'
                ownerUserId:
                  anyOf:
                  - type: string
                  - type: 'null'
                permanent:
                  type: boolean
                secret:
                  description: Whether the flag is secret
                  type: boolean
                isArchived:
                  type: boolean
                stageId:
                  description: Stage ID of the flag
                  type: string
                  minLength: 14
                  maxLength: 14
              additionalProperties: false
      responses:
        '200':
          description: Requested resource retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  flag:
                    type: object
                    properties:
                      id:
                        $ref: '#/components/schemas/flagId'
                      key:
                        $ref: '#/components/schemas/flagKey'
                      name:
                        description: Flag name
                        type: string
                        minLength: 1
                        maxLength: 255
                      description:
                        description: Flag description
                        type: string
                      stage:
                        $ref: '#/components/schemas/stageHeader'
                      owner:
                        $ref: '#/components/schemas/reflagUserHeader'
                      archived:
                        description: Whether the flag is archived
                        type: boolean
                      stale:
                        description: Whether the flag is stale
                        type: boolean
                      permanent:
                        description: Whether the flag is permanent
                        type: boolean
                      createdAt:
                        description: Timestamp when the flag was created
                        type: string
                      rolledOutToEveryoneAt:
                        description: Timestamp when the flag was rolled out to everyone
                        type: string
                      codeRefsCleanedUp:
                        description: Whether code references for this flag have been cleaned up
                        type: boolean
                      codeRefsMarkedCleanUserName:
                        description: Name of the user who marked code references as cleaned up
                        type: string
                      codeRefsMarkedCleanAt:
                        description: Timestamp when code references were marked as cleaned up
                        type: string
                      lastCheckAt:
                        description: Timestamp when the flag was last checked
                        type: string
                      noRecentChecks:
                        description: Whether the flag has no recent access checks
                        type: boolean
                      lastTrackAt:
                        description: Timestamp when the flag was last tracked
                        type: string
                      parentFlagId:
                        description: Parent flag ID
                        type: string
                    required:
                    - id
                    - key
                    - name
                    - archived
                    - stale
                    - permanent
                    - codeRefsCleanedUp
                    - noRecentChecks
                    additionalProperties: false
                required:
                - flag
                additionalProperties: false
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Requested resource, or its parent, not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Apps
  /apps/{appId}/flags/{flagKey}/targeting/{envId}:
    get:
      summary: Get flag targeting for an environment
      description: Retrieve targeting for a flag in an environment
      operationId: getFlagTargeting
      parameters:
      - in: path
        name: appId
        schema:
          $ref: '#/components/schemas/appId'
        required: true
        description: App identifier
      - in: path
        name: flagKey
        schema:
          $ref: '#/components/schemas/flagKey'
        required: true
        description: Unique flag key
      - in: path
        name: envId
        schema:
          $ref: '#/components/schemas/envId'
        required: true
        description: Environment identifier
      responses:
        '200':
          description: Requested resource retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/flagTargeting'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Requested resource, or its parent, not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Apps
  /apps/{appId}/envs/{envId}/companies/{companyId}/flags:
    get:
      summary: Get flags for a company
      description: Retrieve all flags with their targeting status for a specific company
      operationId: getCompanyFlags
      parameters:
      - in: path
        name: appId
        schema:
          $ref: '#/components/schemas/appId'
        required: true
        description: App identifier
      - in: path
        name: envId
        schema:
          $ref: '#/components/schemas/envId'
        required: true
        description: Environment identifier
      - in: path
        name: companyId
        schema:
          $ref: '#/components/schemas/companyId'
        required: true
        description: Company ID within your application
      responses:
        '200':
          description: Requested resource retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/entityFlagsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Requested resource, or its parent, not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Apps
    patch:
      summary: Update flag targeting for a company
      description: Update specific targeting for flags for a company in an environment
      operationId: updateCompanyFlags
      parameters:
      - in: path
        name: appId
        schema:
          $ref: '#/components/schemas/appId'
        required: true
        description: App identifier
      - in: path
        name: envId
        schema:
          $ref: '#/components/schemas/envId'
        required: true
        description: Environment identifier
      - in: path
        name: companyId
        schema:
          $ref: '#/components/schemas/companyId'
        required: true
        description: Company ID within your application
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/updateEntityFlagsBody'
      responses:
        '200':
          description: Requested resource retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/entityFlagsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Requested resource, or its parent, not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Apps
  /apps/{appId}/envs/{envId}/users/{userId}/flags:
    get:
      summary: Get flags for a user
      description: Retrieve all flags with their targeting status for a specific user
      operationId: getUserFlags
      parameters:
      - in: path
        name: appId
        schema:
          $ref: '#/components/schemas/appId'
        required: true
        description: App identifier
      - in: path
        name: envId
        schema:
          $ref: '#/components/schemas/envId'
        required: true
        description: Environment identifier
      - in: path
        name: userId
        schema:
          $ref: '#/components/schemas/userId'
        required: true
        description: User ID within your application
      responses:
        '200':
          description: Requested resource retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/entityFlagsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Requested resource, or its parent, not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Apps
    patch:
      summary: Update flag targeting for a user
      description: Update specific targeting for flags for a user in an environment
      operationId: updateUserFlags
      parameters:
      - in: path
        name: appId
        schema:
          $ref: '#/components/schemas/appId'
        required: true
        description: App identifier
      - in: path
        name: envId
        schema:
          $ref: '#/components/schemas/envId'
        required: true
        description: Environment identifier
      - in: path
        name: userId
        schema:
          $ref: '#/components/schemas/userId'
        required: true
        description: User ID within your application
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/updateEntityFlagsBody'
      responses:
        '200':
          description: Requested resource retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/entityFlagsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Requested resource, or its parent, not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Apps
components:
  schemas:
    environment:
      description: Environment details
      type: object
      properties:
        id:
          $ref: '#/components/schemas/envId'
        name:
          description: Environment name
          type: string
        isProduction:
          description: Whether the environment is a production environment
          type: boolean
        order:
          description: Environment order in the app (zero-indexed)
          type: integer
        flagStateVersion:
          description: Environment version incremented when flag state changes
          type: integer
        sdkAccess:
          description: SDK access details
          type: object
          properties:
            publishableKey:
              description: Publishable key
              type: string
              minLength: 1
              maxLength: 36
            secretKey:
              description: Secret key
              type: string
              minLength: 1
              maxLength: 36
          required:
          - publishableKey
          - secretKey
          additionalProperties: false
      required:
      - id
      - name
      - isProduction
      - order
      - flagStateVersion
      - sdkAccess
      additionalProperties: false
    flagHeaderCollection:
      description: Collection response containing flags
      type: object
      properties:
        data:
          description: Page of the collection of flags
          type: array
          items:
            $ref: '#/components/schemas/flagHeader'
        totalCount:
          description: Total number of flags in collection
          type: integer
        pageSize:
          description: Page size
          type: integer
        pageIndex:
          description: Page index
          type: integer
        sortBy:
          description: Sort by
          type: string
          enum:
          - name
          - key
          - stage
          - autoFeedbackSurveysEnabled
          - createdAt
          - rolledOutToEveryoneAt
          - environmentStatus
          - owner
          - lastCheck
          - lastTrack
          - stale
          - archivingChecks
        sortOrder:
          description: Sort order
          $ref: '#/components/schemas/sortOrder'
      required:
      - data
      - totalCount
      - pageSize
      - pageIndex
      - sortBy
      - sortOrder
      additionalProperties: false
    ErrorResponse:
      description: The error response, including individual issues, if applicable
      type: object
      properties:
        error:
          description: The error
          type: object
          properties:
            code:
              description: Error code
              type: string
              enum:
              - invalid_request
              - not_found
              - not_possible
              - not_allowed
              - not_available
              - unknown_error
              - unauthorized
              - unauthenticated
            message:
              description: Human readable error message
              type: string
          required:
          - code
          - message
          additionalProperties: false
        issues:
          description: Individual validation issues, if applicable
          type: object
          propertyNames:
            description: The field that has the issue (uses dot notation). Empty string if the issue is at the root.
            type: string
          additionalProperties:
            description: Error messages for this field
            type: array
            items:
              description: The error message
              type: string
      required:
      - error
      additionalProperties: false
    flagId:
      description: Flag ID
      type: string
      minLength: 1
    stageId:
      description: Stage identifier
      type: string
      minLength: 1
    segmentId:
      description: Segment identifier
      type: string
      minLength: 1
    flagTargeting:
      description: Flag targeting information and its audience
      type: object
      properties:
        flagKey:
          $ref: '#/components/schemas/flagKey'
        version:
          $ref: '#/components/schemas/flagVersion'
        updatedAt:
          description: Last time the targeting was updated
          type: string
          format: date-time
          pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        specificTargets:
          description: The flag targeting for each value
          type: object
          propertyNames:
            $ref: '#/components/schemas/flagValue'
          additionalProperties:
            $ref: '#/components/schemas/flagValueTargeting'
      required:
      - flagKey
      - version
      - updatedAt
      - specificTargets
      additionalProperties: false
    environmentHeaderCollection:
      description: Collection of Basic enviro

# --- truncated at 32 KB (45 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/bucket/refs/heads/main/openapi/bucket-apps-api-openapi.yml