CloudBees Target groups API

Define reusable sets of targeting conditions for feature flags. Specify rules once (such as matching users by role, region, or custom property) and apply them across multiple flags. Changes to a target group propagate automatically to every flag that references it.

Business capability
Feature Flag Management BC-4210.50

Operations 8

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 /v2/applications/{applicationId}/target-groups List target groups in an application · List target groups #
Ask an LLM
“Which target groups are defined in my application?”
“What audiences have I set up for flag targeting?”
Tell an agent
List the target groups in application {applicationId}.
Show all audience groups defined in app {applicationId}.
POST /v2/applications/{applicationId}/target-groups Create a target group · Create a target group #
Ask an LLM
“How do I create a target group of beta users to target flags at?”
“Can a target group be defined by conditions on user properties?”
Tell an agent
Create a target group named {name} in application {applicationId}.
Add target group {name} to app {applicationId} with conditions {conditions}.
GET /v2/applications/{applicationId}/target-groups/by-name/{name} Look up a target group by name · Get a target group by name #
Ask an LLM
“Can I fetch a target group if I only know its name?”
“What conditions does the target group called 'beta-testers' use?”
Tell an agent
Find the target group named {name} in application {applicationId}.
Look up target group {name} by name in app {applicationId}.
GET /v2/applications/{applicationId}/target-groups/with-flags-usage List target groups with the flags using them · List target groups with flag usage #
Ask an LLM
“Which flags use each of my target groups?”
“Can I list target groups together with the feature flags that reference them?”
Tell an agent
List target groups in app {applicationId} along with the flags that use each.
Show every target group and its referencing flags for application {applicationId}.
GET /v2/applications/{applicationId}/target-groups/{id} Get a target group by ID · Get a target group #
Ask an LLM
“How do I retrieve a target group when I have its ID?”
“What description and conditions does a given target group ID have?”
Tell an agent
Get target group {id} in application {applicationId}.
Show the details of target group ID {id} in app {applicationId}.
PUT /v2/applications/{applicationId}/target-groups/{id} Update a target group · Update a target group #
Ask an LLM
“How do I change the conditions of an existing target group?”
“Can I rename a target group?”
Tell an agent
Update the conditions of target group {id} in app {applicationId} to {conditions}.
Rename existing target group {id} in application {applicationId} to {name}.
DELETE /v2/applications/{applicationId}/target-groups/{id} Delete a target group · Delete a target group #
Ask an LLM
“How do I permanently delete a target group?”
“Can a deleted target group be restored?”
Tell an agent destructive · confirm first
Delete target group {id} from application {applicationId}.
Permanently remove target group {id} in app {applicationId}.
GET /v2/applications/{applicationId}/target-groups/{id}/flag-usage-per-environment See which flags use a target group, by environment · List flag usage per environment for a target group #
Ask an LLM
“Which feature flags reference one target group in each environment?”
“Is a specific target group still used by flags in production?”
Tell an agent
Show which flags use target group {id} in each environment of app {applicationId}.
List per-environment flag usage of target group {id} in application {applicationId}.

Documentation

Specifications

Schemas & Data

Other Resources

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/cloudbees:cloudbees-target-groups-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

cloudbees-target-groups-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: CloudBees Unify API (Current) Target groups API
  version: 1.0.0
  description: API documentation for CloudBees Unify's current, stable endpoints.
servers:
- url: https://api.cloudbees.io
  description: CloudBees Unify Production API
security:
- BearerAuth: []
tags:
- name: Target Groups
  description: 'Define reusable sets of targeting conditions for feature flags. Specify rules once (such as matching users by role, region, or custom property) and apply them across multiple flags.

    Changes to a target group propagate automatically to every flag that references it.'
paths:
  /v2/applications/{applicationId}/target-groups:
    get:
      tags:
      - Target Groups
      operationId: TargetGroupApi_ListTargetGroups
      parameters:
      - name: applicationId
        in: path
        description: Unique identifier of the application whose target groups are to be listed.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.TargetGroup.ListTargetGroupsResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.rpc.Status'
      summary: List target groups
      description: Returns all target groups within the specified application.
    post:
      tags:
      - Target Groups
      operationId: TargetGroupApi_AddTargetGroup
      parameters:
      - name: applicationId
        in: path
        description: Unique identifier of the application in which to create the target group.
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/api.TargetGroup.TargetGroup'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.TargetGroup.AddTargetGroupResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.rpc.Status'
      summary: Create a target group
      description: Creates a new target group within the specified application. Target groups define conditions used to target feature flags at specific users or contexts.
  /v2/applications/{applicationId}/target-groups/by-name/{name}:
    get:
      tags:
      - Target Groups
      operationId: TargetGroupApi_GetTargetGroupByName
      parameters:
      - name: applicationId
        in: path
        description: Unique identifier of the application that owns the target group.
        required: true
        schema:
          type: string
      - name: name
        in: path
        description: Name of the target group to retrieve.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.TargetGroup.GetTargetGroupResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.rpc.Status'
      summary: Get a target group by name
      description: Returns the target group matching the specified name within the application.
  /v2/applications/{applicationId}/target-groups/with-flags-usage:
    get:
      tags:
      - Target Groups
      operationId: TargetGroupApi_ListTargetGroupsWithFlagsUsage
      parameters:
      - name: applicationId
        in: path
        description: Unique identifier of the application whose target groups are to be listed.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.TargetGroup.ListTargetGroupsWithFlagsUsageResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.rpc.Status'
      summary: List target groups with flag usage
      description: Returns all target groups within the specified application, each including the feature flags that reference it.
  /v2/applications/{applicationId}/target-groups/{id}:
    get:
      tags:
      - Target Groups
      operationId: TargetGroupApi_GetTargetGroup
      parameters:
      - name: applicationId
        in: path
        description: Unique identifier of the application that owns the target group.
        required: true
        schema:
          type: string
      - name: id
        in: path
        description: Unique identifier of the target group to retrieve.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.TargetGroup.GetTargetGroupResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.rpc.Status'
      summary: Get a target group
      description: Returns the target group matching the specified identifier within the application.
    put:
      tags:
      - Target Groups
      operationId: TargetGroupApi_UpdateTargetGroup
      parameters:
      - name: applicationId
        in: path
        description: Unique identifier of the application that owns the target group.
        required: true
        schema:
          type: string
      - name: id
        in: path
        description: Unique identifier of the target group to update.
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/api.TargetGroup.TargetGroup'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.TargetGroup.UpdateTargetGroupResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.rpc.Status'
      summary: Update a target group
      description: Replaces the configuration of the specified target group within the application. All fields in the request body replace the current values.
    delete:
      tags:
      - Target Groups
      operationId: TargetGroupApi_DeleteTargetGroup
      parameters:
      - name: applicationId
        in: path
        description: Unique identifier of the application that owns the target group.
        required: true
        schema:
          type: string
      - name: id
        in: path
        description: Unique identifier of the target group to delete.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content: {}
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.rpc.Status'
      summary: Delete a target group
      description: Permanently deletes the specified target group from the application. This action cannot be undone.
  /v2/applications/{applicationId}/target-groups/{id}/flag-usage-per-environment:
    get:
      tags:
      - Target Groups
      operationId: TargetGroupApi_GetTargetGroupFlagUsagePerEnvironment
      parameters:
      - name: applicationId
        in: path
        description: Unique identifier of the application that owns the target group.
        required: true
        schema:
          type: string
      - name: id
        in: path
        description: Unique identifier of the target group to retrieve.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.TargetGroup.GetTargetGroupFlagsUsagePerEnvironmentResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.rpc.Status'
      summary: List flag usage per environment for a target group
      description: Returns the feature flags that reference the specified target group, grouped by environment.
components:
  schemas:
    api.TargetGroup.FlagIdName:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the feature flag.
        name:
          type: string
          description: Display name of the feature flag.
        resourceId:
          type: string
          description: Unique identifier of the application that owns this feature flag.
    api.TargetGroup.GetTargetGroupResponse:
      type: object
      properties:
        targetGroup:
          allOf:
          - $ref: '#/components/schemas/api.TargetGroup.TargetGroup'
          description: The requested target group.
    api.TargetGroup.FlagUsageInEnvironment:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the feature flag.
        name:
          type: string
          description: Display name of the feature flag.
        enabled:
          type: boolean
          description: Whether the feature flag is enabled in this environment.
        resourceId:
          type: string
          description: Unique identifier of the application that owns this feature flag.
    google.rpc.Status:
      type: object
      properties:
        code:
          type: integer
          description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
          format: int32
        message:
          type: string
          description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
        details:
          type: array
          items:
            $ref: '#/components/schemas/google.protobuf.Any'
          description: A list of messages that carry the error details.  There is a common set of message types for APIs to use.
      description: 'The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).'
    api.TargetGroup.AddTargetGroupResponse:
      type: object
      properties:
        targetGroup:
          allOf:
          - $ref: '#/components/schemas/api.TargetGroup.TargetGroup'
          description: The created target group.
    google.protobuf.Any:
      type: object
      properties:
        '@type':
          type: string
          description: The type of the serialized message.
      additionalProperties: true
      description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message.
    api.TargetGroup.ListTargetGroupsWithFlagsUsageResponse:
      type: object
      properties:
        targetGroupsWithFlagUsage:
          type: array
          items:
            $ref: '#/components/schemas/api.TargetGroup.TargetGroupWithFlagsUsage'
          description: List of target groups in the application, each including the feature flags that reference it.
    api.TargetGroup.ListTargetGroupsResponse:
      type: object
      properties:
        targetGroups:
          type: array
          items:
            $ref: '#/components/schemas/api.TargetGroup.TargetGroup'
          description: List of target groups in the application.
    api.TargetGroup.GetTargetGroupFlagsUsagePerEnvironmentResponse:
      type: object
      properties:
        environments:
          type: array
          items:
            $ref: '#/components/schemas/api.TargetGroup.EnvironmentUsage'
          description: List of environments and the feature flags that reference the target group in each.
    api.TargetGroup.EnvironmentUsage:
      type: object
      properties:
        environmentId:
          type: string
          description: Unique identifier of the environment.
        flagUsage:
          type: array
          items:
            $ref: '#/components/schemas/api.TargetGroup.FlagUsageInEnvironment'
          description: Feature flags that reference the target group in this environment.
    api.TargetGroup.TargetGroup:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the target group.
        name:
          type: string
          description: Display name of the target group.
        description:
          type: string
          description: Human-readable description of the target group's purpose.
        conditions:
          type: object
          description: Targeting conditions that define which users or contexts match this group, expressed as a JSON structure.
        resourceId:
          type: string
          description: Unique identifier of the application that owns this target group.
        cascUrl:
          type: string
          description: Configuration as Code (CasC) URL for this target group.
    api.TargetGroup.TargetGroupWithFlagsUsage:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the target group.
        name:
          type: string
          description: Display name of the target group.
        flagUsage:
          type: array
          items:
            $ref: '#/components/schemas/api.TargetGroup.FlagIdName'
          description: Feature flags that reference this target group.
        updated:
          type: string
          description: The date and time at which the target group was last updated.
          format: date-time
        resourceId:
          type: string
          description: Unique identifier of the application that owns this target group.
        cascUrl:
          type: string
          description: Configuration as Code (CasC) URL for this target group.
    api.TargetGroup.UpdateTargetGroupResponse:
      type: object
      properties:
        targetGroup:
          allOf:
          - $ref: '#/components/schemas/api.TargetGroup.TargetGroup'
          description: The updated target group.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: CloudBees Unify API access token or personal access token
x-tagGroups:
- name: Unify core
  tags:
  - Components
  - Environments
  - Organizations
  - Teams
  - Users
- name: Feature management
  tags:
  - Flags
  - Flag configurations
  - Flag custom properties
  - Target groups
  - Flag lifecycle