All URIs are relative to https://app.launchdarkly.com
| Method | HTTP request | Description |
|---|---|---|
| deleteApprovalRequest | DELETE /api/v2/approval-requests/{id} | Delete approval request |
| deleteApprovalRequestForFlag | DELETE /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id} | Delete approval request for a flag |
| getApprovalForFlag | GET /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id} | Get approval request for a flag |
| getApprovalRequest | GET /api/v2/approval-requests/{id} | Get approval request |
| getApprovalRequests | GET /api/v2/approval-requests | List approval requests |
| getApprovalsForFlag | GET /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests | List approval requests for a flag |
| postApprovalRequest | POST /api/v2/approval-requests | Create approval request |
| postApprovalRequestApply | POST /api/v2/approval-requests/{id}/apply | Apply approval request |
| postApprovalRequestApplyForFlag | POST /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}/apply | Apply approval request for a flag |
| postApprovalRequestForFlag | POST /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests | Create approval request for a flag |
| postApprovalRequestReview | POST /api/v2/approval-requests/{id}/reviews | Review approval request |
| postApprovalRequestReviewForFlag | POST /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}/reviews | Review approval request for a flag |
| postFlagCopyConfigApprovalRequest | POST /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests-flag-copy | Create approval request to copy flag configurations across environments |
deleteApprovalRequest(id)
Delete approval request
Delete an approval request.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.ApprovalsApi();
let id = "id_example"; // String | The approval request ID
apiInstance.deleteApprovalRequest(id, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | The approval request ID |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
deleteApprovalRequestForFlag(projectKey, featureFlagKey, environmentKey, id)
Delete approval request for a flag
Delete an approval request for a feature flag.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.ApprovalsApi();
let projectKey = "projectKey_example"; // String | The project key
let featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
let environmentKey = "environmentKey_example"; // String | The environment key
let id = "id_example"; // String | The feature flag approval request ID
apiInstance.deleteApprovalRequestForFlag(projectKey, featureFlagKey, environmentKey, id, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| projectKey | String | The project key | |
| featureFlagKey | String | The feature flag key | |
| environmentKey | String | The environment key | |
| id | String | The feature flag approval request ID |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
FlagConfigApprovalRequestResponse getApprovalForFlag(projectKey, featureFlagKey, environmentKey, id)
Get approval request for a flag
Get a single approval request for a feature flag.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.ApprovalsApi();
let projectKey = "projectKey_example"; // String | The project key
let featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
let environmentKey = "environmentKey_example"; // String | The environment key
let id = "id_example"; // String | The feature flag approval request ID
apiInstance.getApprovalForFlag(projectKey, featureFlagKey, environmentKey, id, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| projectKey | String | The project key | |
| featureFlagKey | String | The feature flag key | |
| environmentKey | String | The environment key | |
| id | String | The feature flag approval request ID |
FlagConfigApprovalRequestResponse
- Content-Type: Not defined
- Accept: application/json
ExpandableApprovalRequestResponse getApprovalRequest(id, opts)
Get approval request
Get an approval request by approval request ID. ### Expanding approval response LaunchDarkly supports the `expand` query param to include additional fields in the response, with the following fields: - `environments` includes the environments the approval request relates to - `flag` includes the flag the approval request belongs to - `project` includes the project the approval request belongs to - `resource` includes details on the resource (flag or segment) the approval request relates to For example, `expand=project,flag` includes the `project` and `flag` fields in the response.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.ApprovalsApi();
let id = "id_example"; // String | The approval request ID
let opts = {
'expand': "expand_example" // String | A comma-separated list of fields to expand in the response. Supported fields are explained above.
};
apiInstance.getApprovalRequest(id, opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | The approval request ID | |
| expand | String | A comma-separated list of fields to expand in the response. Supported fields are explained above. | [optional] |
ExpandableApprovalRequestResponse
- Content-Type: Not defined
- Accept: application/json
ExpandableApprovalRequestsResponse getApprovalRequests(opts)
List approval requests
Get all approval requests. ### Filtering approvals LaunchDarkly supports the `filter` query param for filtering, with the following fields: - `notifyMemberIds` filters for only approvals that are assigned to a member in the specified list. For example: `filter=notifyMemberIds anyOf ["memberId1", "memberId2"]`. - `requestorId` filters for only approvals that correspond to the ID of the member who requested the approval. For example: `filter=requestorId equals 457034721476302714390214`. - `resourceId` filters for only approvals that correspond to the the specified resource identifier. For example: `filter=resourceId equals proj/my-project:env/my-environment:flag/my-flag`. - `resourceKind` filters for only approvals that correspond to the specified resource kind. For example: `filter=resourceKind equals flag`. Currently, `flag`, `segment`, and `aiConfig` resource kinds are supported. - `reviewStatus` filters for only approvals which correspond to the review status in the specified list. The possible values are `approved`, `declined`, and `pending`. For example: `filter=reviewStatus anyOf ["pending", "approved"]`. - `status` filters for only approvals which correspond to the status in the specified list. The possible values are `pending`, `scheduled`, `failed`, and `completed`. For example: `filter=status anyOf ["pending", "scheduled"]`. You can also apply multiple filters at once. For example, setting `filter=projectKey equals my-project, reviewStatus anyOf ["pending","approved"]` matches approval requests which correspond to the `my-project` project key, and a review status of either `pending` or `approved`. ### Expanding approval response LaunchDarkly supports the `expand` query param to include additional fields in the response, with the following fields: - `flag` includes the flag the approval request belongs to - `project` includes the project the approval request belongs to - `environments` includes the environments the approval request relates to For example, `expand=project,flag` includes the `project` and `flag` fields in the response.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.ApprovalsApi();
let opts = {
'filter': "filter_example", // String | A comma-separated list of filters. Each filter is of the form `field operator value`. Supported fields are explained above.
'expand': "expand_example", // String | A comma-separated list of fields to expand in the response. Supported fields are explained above.
'limit': 789, // Number | The number of approvals to return. Defaults to 20. Maximum limit is 200.
'offset': 789 // Number | Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.
};
apiInstance.getApprovalRequests(opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| filter | String | A comma-separated list of filters. Each filter is of the form `field operator value`. Supported fields are explained above. | [optional] |
| expand | String | A comma-separated list of fields to expand in the response. Supported fields are explained above. | [optional] |
| limit | Number | The number of approvals to return. Defaults to 20. Maximum limit is 200. | [optional] |
| offset | Number | Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. | [optional] |
ExpandableApprovalRequestsResponse
- Content-Type: Not defined
- Accept: application/json
FlagConfigApprovalRequestsResponse getApprovalsForFlag(projectKey, featureFlagKey, environmentKey)
List approval requests for a flag
Get all approval requests for a feature flag.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.ApprovalsApi();
let projectKey = "projectKey_example"; // String | The project key
let featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
let environmentKey = "environmentKey_example"; // String | The environment key
apiInstance.getApprovalsForFlag(projectKey, featureFlagKey, environmentKey, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| projectKey | String | The project key | |
| featureFlagKey | String | The feature flag key | |
| environmentKey | String | The environment key |
FlagConfigApprovalRequestsResponse
- Content-Type: Not defined
- Accept: application/json
ApprovalRequestResponse postApprovalRequest(createApprovalRequestRequest)
Create approval request
Create an approval request. This endpoint requires a list of `instructions`, in semantic patch format, that will be applied when the approval request is approved and applied. ### Flags If you are creating an approval request for a flag, you can use the following `instructions`: - `addVariation` - `removeVariation` - `updateVariation` - `updateDefaultVariation` For details on using these instructions, read Update feature flag. To create an approval for a flag specific to an environment, use Create approval request for a flag. ### AI Configs If you are creating an approval request for an AI Config, you can use the semantic patch instructions listed under Update AI Config targeting. ### Segments If you are creating an approval request for a segment, you can use the semantic patch instructions listed under Patch segment.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.ApprovalsApi();
let createApprovalRequestRequest = new LaunchDarklyApi.CreateApprovalRequestRequest(); // CreateApprovalRequestRequest |
apiInstance.postApprovalRequest(createApprovalRequestRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| createApprovalRequestRequest | CreateApprovalRequestRequest |
- Content-Type: application/json
- Accept: application/json
ApprovalRequestResponse postApprovalRequestApply(id, postApprovalRequestApplyRequest)
Apply approval request
Apply an approval request that has been approved. This endpoint works with any approval requests.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.ApprovalsApi();
let id = "id_example"; // String | The approval request ID
let postApprovalRequestApplyRequest = new LaunchDarklyApi.PostApprovalRequestApplyRequest(); // PostApprovalRequestApplyRequest |
apiInstance.postApprovalRequestApply(id, postApprovalRequestApplyRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | The approval request ID | |
| postApprovalRequestApplyRequest | PostApprovalRequestApplyRequest |
- Content-Type: application/json
- Accept: application/json
FlagConfigApprovalRequestResponse postApprovalRequestApplyForFlag(projectKey, featureFlagKey, environmentKey, id, postApprovalRequestApplyRequest)
Apply approval request for a flag
Apply an approval request that has been approved. This endpoint requires a feature flag key, and can only be used for applying approval requests on flags.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.ApprovalsApi();
let projectKey = "projectKey_example"; // String | The project key
let featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
let environmentKey = "environmentKey_example"; // String | The environment key
let id = "id_example"; // String | The feature flag approval request ID
let postApprovalRequestApplyRequest = new LaunchDarklyApi.PostApprovalRequestApplyRequest(); // PostApprovalRequestApplyRequest |
apiInstance.postApprovalRequestApplyForFlag(projectKey, featureFlagKey, environmentKey, id, postApprovalRequestApplyRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| projectKey | String | The project key | |
| featureFlagKey | String | The feature flag key | |
| environmentKey | String | The environment key | |
| id | String | The feature flag approval request ID | |
| postApprovalRequestApplyRequest | PostApprovalRequestApplyRequest |
FlagConfigApprovalRequestResponse
- Content-Type: application/json
- Accept: application/json
FlagConfigApprovalRequestResponse postApprovalRequestForFlag(projectKey, featureFlagKey, environmentKey, createFlagConfigApprovalRequestRequest)
Create approval request for a flag
Create an approval request for a feature flag.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.ApprovalsApi();
let projectKey = "projectKey_example"; // String | The project key
let featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
let environmentKey = "environmentKey_example"; // String | The environment key
let createFlagConfigApprovalRequestRequest = new LaunchDarklyApi.CreateFlagConfigApprovalRequestRequest(); // CreateFlagConfigApprovalRequestRequest |
apiInstance.postApprovalRequestForFlag(projectKey, featureFlagKey, environmentKey, createFlagConfigApprovalRequestRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| projectKey | String | The project key | |
| featureFlagKey | String | The feature flag key | |
| environmentKey | String | The environment key | |
| createFlagConfigApprovalRequestRequest | CreateFlagConfigApprovalRequestRequest |
FlagConfigApprovalRequestResponse
- Content-Type: application/json
- Accept: application/json
ApprovalRequestResponse postApprovalRequestReview(id, postApprovalRequestReviewRequest)
Review approval request
Review an approval request by approving or denying changes.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.ApprovalsApi();
let id = "id_example"; // String | The approval request ID
let postApprovalRequestReviewRequest = new LaunchDarklyApi.PostApprovalRequestReviewRequest(); // PostApprovalRequestReviewRequest |
apiInstance.postApprovalRequestReview(id, postApprovalRequestReviewRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | The approval request ID | |
| postApprovalRequestReviewRequest | PostApprovalRequestReviewRequest |
- Content-Type: application/json
- Accept: application/json
FlagConfigApprovalRequestResponse postApprovalRequestReviewForFlag(projectKey, featureFlagKey, environmentKey, id, postApprovalRequestReviewRequest)
Review approval request for a flag
Review an approval request by approving or denying changes.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.ApprovalsApi();
let projectKey = "projectKey_example"; // String | The project key
let featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
let environmentKey = "environmentKey_example"; // String | The environment key
let id = "id_example"; // String | The feature flag approval request ID
let postApprovalRequestReviewRequest = new LaunchDarklyApi.PostApprovalRequestReviewRequest(); // PostApprovalRequestReviewRequest |
apiInstance.postApprovalRequestReviewForFlag(projectKey, featureFlagKey, environmentKey, id, postApprovalRequestReviewRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| projectKey | String | The project key | |
| featureFlagKey | String | The feature flag key | |
| environmentKey | String | The environment key | |
| id | String | The feature flag approval request ID | |
| postApprovalRequestReviewRequest | PostApprovalRequestReviewRequest |
FlagConfigApprovalRequestResponse
- Content-Type: application/json
- Accept: application/json
FlagConfigApprovalRequestResponse postFlagCopyConfigApprovalRequest(projectKey, featureFlagKey, environmentKey, createCopyFlagConfigApprovalRequestRequest)
Create approval request to copy flag configurations across environments
Create an approval request to copy a feature flag's configuration across environments.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.ApprovalsApi();
let projectKey = "projectKey_example"; // String | The project key
let featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
let environmentKey = "environmentKey_example"; // String | The environment key for the target environment
let createCopyFlagConfigApprovalRequestRequest = new LaunchDarklyApi.CreateCopyFlagConfigApprovalRequestRequest(); // CreateCopyFlagConfigApprovalRequestRequest |
apiInstance.postFlagCopyConfigApprovalRequest(projectKey, featureFlagKey, environmentKey, createCopyFlagConfigApprovalRequestRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| projectKey | String | The project key | |
| featureFlagKey | String | The feature flag key | |
| environmentKey | String | The environment key for the target environment | |
| createCopyFlagConfigApprovalRequestRequest | CreateCopyFlagConfigApprovalRequestRequest |
FlagConfigApprovalRequestResponse
- Content-Type: application/json
- Accept: application/json