Skip to content
This repository was archived by the owner on Feb 3, 2026. It is now read-only.

Latest commit

 

History

History
294 lines (207 loc) · 13.6 KB

File metadata and controls

294 lines (207 loc) · 13.6 KB

LaunchDarklyApi.HoldoutsBetaApi

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

getAllHoldouts

HoldoutsCollectionRep getAllHoldouts(projectKey, environmentKey, opts)

Get all holdouts

Example

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);
  }
});

Parameters

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]

Return type

HoldoutsCollectionRep

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getHoldout

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.

Example

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);
  }
});

Parameters

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]

Return type

HoldoutDetailRep

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getHoldoutById

HoldoutRep getHoldoutById(projectKey, environmentKey, holdoutId)

Get Holdout by Id

Example

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);
  }
});

Parameters

Name Type Description Notes
projectKey String The project key
environmentKey String The environment key
holdoutId String The holdout experiment ID

Return type

HoldoutRep

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

patchHoldout

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 { &quot;comment&quot;: &quot;Optional comment describing why the holdout is ending&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;endHoldout&quot; }] } ``` #### removeExperiment Removes an experiment from a holdout. ##### Parameters - `value`: The key of the experiment to remove Here's an example: ```json { &quot;comment&quot;: &quot;Optional comment describing the change&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;removeExperiment&quot;, &quot;value&quot;: &quot;experiment-key&quot; }] } ``` #### updateDescription Updates the description of the holdout. ##### Parameters - `value`: The new description. Here's an example: ```json { &quot;comment&quot;: &quot;Optional comment describing the update&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;updateDescription&quot;, &quot;value&quot;: &quot;Updated holdout description&quot; }] } ``` #### updateName Updates the name of the holdout. ##### Parameters - `value`: The new name. Here's an example: ```json { &quot;comment&quot;: &quot;Optional comment describing the update&quot;, &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;updateName&quot;, &quot;value&quot;: &quot;Updated holdout name&quot; }] } ``` </details>

Example

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);
  }
});

Parameters

Name Type Description Notes
projectKey String The project key
environmentKey String The environment key
holdoutKey String The holdout key
holdoutPatchInput HoldoutPatchInput

Return type

HoldoutRep

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

postHoldout

HoldoutRep postHoldout(projectKey, environmentKey, holdoutPostRequest)

Create holdout

Create a new holdout in the specified project.

Example

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);
  }
});

Parameters

Name Type Description Notes
projectKey String The project key
environmentKey String The environment key
holdoutPostRequest HoldoutPostRequest

Return type

HoldoutRep

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json