Feature management API reference

2 minute read

The CloudBees Unify Feature Management API provides programmatic access to manage feature flags, target groups, and custom properties. Use this API to integrate feature management into CI/CD pipelines, automation scripts, and custom tooling.

Base URL

All API endpoints are relative to your CloudBees Unify instance:

https://api.cloudbees.io/v1

Authentication

All API requests require authentication using a bearer token. Include the token in the Authorization header, as follows:

curl -H "Authorization: Bearer YOUR_API_TOKEN" \ https://api.cloudbees.io/v2/applications/{applicationId}/flags

To obtain an API token:

  1. Navigate to your organization settings in CloudBees Unify.

  2. Select API tokens.

  3. Create a new token with appropriate permissions.

API overview

The Feature Management API is organized around the following core resources:

Resource Description

Flags

Create, read, update, and delete feature flags

Flag Configurations

Manage per-environment flag settings, conditions, and rollouts

Target Groups

Define reusable targeting rules for flag conditions

Custom Properties

Manage user properties used in targeting conditions

Common patterns

Path parameters

Most endpoints require an applicationId path parameter to identify the FM application:

/v2/applications/{applicationId}/flags /v2/applications/{applicationId}/target-groups /v2/applications/{applicationId}/custom-properties

Response format

All responses are returned as JSON. Successful responses include the following requested data:

{ "flags": [ { "id": "f7d3c8a1-4b2e-5f9a-b6c4-e1d8f3a7b5c2", "name": "default.newFeature", "description": "Enables new feature", "flagType": "Boolean" } ] }

Error responses

Errors return a standard error object with details:

{ "code": 3, "message": "Flag not found", "details": [] }

Common HTTP status codes:

Code Description

200

Success

400

Bad request - invalid parameters

401

Unauthorized - invalid or missing token

403

Forbidden - insufficient permissions

404

Not found - resource does not exist

500

Internal server error

Rate limiting

This API enforces rate limits to ensure fair usage. When you exceed the limit, you will receive a 429 Too Many Requests response. To handle rate limiting, implement exponential backoff in your client application by progressively increasing the wait time between retry attempts.

Pagination

List endpoints support pagination through query parameters:

Parameter Type Description

pageSize

integer

Maximum number of items to return (default: 100)

pageToken

string

Token for fetching the next page of results

Testing the API

See Testing the API for information on using Postman, curl, and other tools to test API endpoints.

Quick reference

Flag operations

Method Endpoint Description

GET

/v2/applications/{appId}/flags

List all flags

POST

/v2/applications/{appId}/flags

Create a new flag

GET

/v2/applications/{appId}/flags/{id}

Get a flag by ID

GET

/v2/applications/{appId}/flags/by-name/{name}

Get a flag by name

PUT

/v2/applications/{appId}/flags/{id}

Update a flag

DELETE

/v2/applications/{appId}/flags/{id}

Delete a flag

Flag configuration operations

Method Endpoint Description

GET

/v2/applications/{appId}/flags/{flagId}/configuration/environments/{envId}

Get flag configuration

PUT

/v2/applications/{appId}/flags/{flagId}/configuration/environments/{envId}

Update flag configuration

PATCH

/v2/applications/{appId}/flags/{flagId}/configuration/environments/{envId}

Partially update configuration

POST

/v2/applications/{appId}/flags/{flagId}/environment/{envId}/clone

Clone configuration to another environment

Target group operations

Method Endpoint Description

GET

/v2/applications/{appId}/target-groups

List all target groups

POST

/v2/applications/{appId}/target-groups

Create a target group

GET

/v2/applications/{appId}/target-groups/{id}

Get a target group by ID

PUT

/v2/applications/{appId}/target-groups/{id}

Update a target group

DELETE

/v2/applications/{appId}/target-groups/{id}

Delete a target group

Custom property operations

Method Endpoint Description

GET

/v2/applications/{appId}/custom-properties

List all custom properties

POST

/v2/applications/{appId}/custom-properties

Create a custom property

GET

/v2/applications/{appId}/custom-properties/{id}

Get a custom property by ID

PUT

/v2/applications/{appId}/custom-properties/{id}

Update a custom property

DELETE

/v2/applications/{appId}/custom-properties/{id}

Delete a custom property