All URIs are relative to https://app.launchdarkly.com
| Method | HTTP request | Description |
|---|---|---|
| getAllHoldouts | GET /api/v2/projects/{projectKey}/environments/{environmentKey}/holdouts | Get all holdouts |
| getHoldout | GET /api/v2/projects/{projectKey}/environments/{environmentKey}/holdouts/{holdoutKey} | Get holdout |
| getHoldoutById | GET /api/v2/projects/{projectKey}/environments/{environmentKey}/holdouts/id/{holdoutId} | Get Holdout by Id |
| patchHoldout | PATCH /api/v2/projects/{projectKey}/environments/{environmentKey}/holdouts/{holdoutKey} | Patch holdout |
| postHoldout | POST /api/v2/projects/{projectKey}/environments/{environmentKey}/holdouts | Create holdout |
HoldoutsCollectionRep getAllHoldouts(projectKey, environmentKey, opts)
Get all holdouts
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.HoldoutsBetaApi();
let projectKey = "projectKey_example"; // String | The project key
let environmentKey = "environmentKey_example"; // String | The environment key
let opts = {
'limit': 789, // Number | The number of holdouts to return in the response. Defaults to 20
'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.getAllHoldouts(projectKey, environmentKey, opts, (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 | |
| environmentKey | String | The environment key | |
| limit | Number | The number of holdouts to return in the response. Defaults to 20 | [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] |
- Content-Type: Not defined
- Accept: application/json
HoldoutDetailRep getHoldout(projectKey, environmentKey, holdoutKey, opts)
Get holdout
Get details about a holdout. ### Expanding the holdout response LaunchDarkly supports the following fields for expanding the "Get holdout" response. By default, these fields are not included in the response. To expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields: - `draftIteration` includes the iteration which has not been started yet, if any, for this holdout. - `previousIterations` includes all iterations prior to the current iteration, for this holdout. By default only the current iteration is included in the response. - `rel-draftIteration` includes the iteration which has not been started yet, if any, for the experiments related to this holdout. - `rel-metrics` includes metrics for experiments related to this holdout. - `rel-previousIterations` includes all iterations prior to the current iteration, for the experiments related to this holdout. - `rel-secondaryMetrics` includes secondary metrics for experiments related to this holdout. - `rel-treatments` includes all treatment and parameter details for experiments related to this holdout. - `secondaryMetrics` includes secondary metrics for this holdout. By default only the primary metric is included in the response. - `treatments` includes all treatment and parameter details for this holdout. By default treatment data is not included in the response. For example, `expand=draftIteration,rel-draftIteration` includes the `draftIteration` and `rel-draftIteration` fields in the response. If fields that you request with the `expand` query parameter are empty, they are not included 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.HoldoutsBetaApi();
let projectKey = "projectKey_example"; // String | The project key
let environmentKey = "environmentKey_example"; // String | The environment key
let holdoutKey = "holdoutKey_example"; // String | The holdout experiment key
let opts = {
'expand': "expand_example" // String | A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above. Holdout experiment expansion fields have no prefix. Related experiment expansion fields have `rel-` as a prefix.
};
apiInstance.getHoldout(projectKey, environmentKey, holdoutKey, opts, (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 | |
| environmentKey | String | The environment key | |
| holdoutKey | String | The holdout experiment key | |
| expand | String | A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above. Holdout experiment expansion fields have no prefix. Related experiment expansion fields have `rel-` as a prefix. | [optional] |
- Content-Type: Not defined
- Accept: application/json
HoldoutRep getHoldoutById(projectKey, environmentKey, holdoutId)
Get Holdout by Id
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.HoldoutsBetaApi();
let projectKey = "projectKey_example"; // String | The project key
let environmentKey = "environmentKey_example"; // String | The environment key
let holdoutId = "holdoutId_example"; // String | The holdout experiment ID
apiInstance.getHoldoutById(projectKey, environmentKey, holdoutId, (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 | |
| environmentKey | String | The environment key | |
| holdoutId | String | The holdout experiment ID |
- Content-Type: Not defined
- Accept: application/json
HoldoutRep patchHoldout(projectKey, environmentKey, holdoutKey, holdoutPatchInput)
Patch holdout
Updates an existing holdout, and returns the updated holdout. Updating holdouts uses the semantic patch format. To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read Updates using semantic patch. ### Instructions Semantic patch requests support the following `kind` instructions for updating holdouts. <details> <summary>Click to expand instructions for <strong>updating holdouts</strong></summary> #### endHoldout Ends a holdout. ##### Parameters None. Here's an example: ```json { "comment": "Optional comment describing why the holdout is ending", "instructions": [{ "kind": "endHoldout" }] } ``` #### removeExperiment Removes an experiment from a holdout. ##### Parameters - `value`: The key of the experiment to remove Here's an example: ```json { "comment": "Optional comment describing the change", "instructions": [{ "kind": "removeExperiment", "value": "experiment-key" }] } ``` #### updateDescription Updates the description of the holdout. ##### Parameters - `value`: The new description. Here's an example: ```json { "comment": "Optional comment describing the update", "instructions": [{ "kind": "updateDescription", "value": "Updated holdout description" }] } ``` #### updateName Updates the name of the holdout. ##### Parameters - `value`: The new name. Here's an example: ```json { "comment": "Optional comment describing the update", "instructions": [{ "kind": "updateName", "value": "Updated holdout name" }] } ``` </details>
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.HoldoutsBetaApi();
let projectKey = "projectKey_example"; // String | The project key
let environmentKey = "environmentKey_example"; // String | The environment key
let holdoutKey = "holdoutKey_example"; // String | The holdout key
let holdoutPatchInput = {"comment":"Optional comment describing the update","instructions":[{"kind":"updateName","value":"Updated holdout name"}]}; // HoldoutPatchInput |
apiInstance.patchHoldout(projectKey, environmentKey, holdoutKey, holdoutPatchInput, (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 | |
| environmentKey | String | The environment key | |
| holdoutKey | String | The holdout key | |
| holdoutPatchInput | HoldoutPatchInput |
- Content-Type: application/json
- Accept: application/json
HoldoutRep postHoldout(projectKey, environmentKey, holdoutPostRequest)
Create holdout
Create a new holdout in the specified project.
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.HoldoutsBetaApi();
let projectKey = "projectKey_example"; // String | The project key
let environmentKey = "environmentKey_example"; // String | The environment key
let holdoutPostRequest = new LaunchDarklyApi.HoldoutPostRequest(); // HoldoutPostRequest |
apiInstance.postHoldout(projectKey, environmentKey, holdoutPostRequest, (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 | |
| environmentKey | String | The environment key | |
| holdoutPostRequest | HoldoutPostRequest |
- Content-Type: application/json
- Accept: application/json