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

Latest commit

 

History

History
298 lines (209 loc) · 11.4 KB

File metadata and controls

298 lines (209 loc) · 11.4 KB

LaunchDarklyApi.FlagTriggersApi

All URIs are relative to https://app.launchdarkly.com

Method HTTP request Description
createTriggerWorkflow POST /api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey} Create flag trigger
deleteTriggerWorkflow DELETE /api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}/{id} Delete flag trigger
getTriggerWorkflowById GET /api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}/{id} Get flag trigger by ID
getTriggerWorkflows GET /api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey} List flag triggers
patchTriggerWorkflow PATCH /api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}/{id} Update flag trigger

createTriggerWorkflow

TriggerWorkflowRep createTriggerWorkflow(projectKey, environmentKey, featureFlagKey, triggerPost)

Create flag trigger

Create a new flag trigger.

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.FlagTriggersApi();
let projectKey = "projectKey_example"; // String | The project key
let environmentKey = "environmentKey_example"; // String | The environment key
let featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
let triggerPost = new LaunchDarklyApi.TriggerPost(); // TriggerPost | 
apiInstance.createTriggerWorkflow(projectKey, environmentKey, featureFlagKey, triggerPost, (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
featureFlagKey String The feature flag key
triggerPost TriggerPost

Return type

TriggerWorkflowRep

Authorization

ApiKey

HTTP request headers

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

deleteTriggerWorkflow

deleteTriggerWorkflow(projectKey, environmentKey, featureFlagKey, id)

Delete flag trigger

Delete a flag trigger 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.FlagTriggersApi();
let projectKey = "projectKey_example"; // String | The project key
let environmentKey = "environmentKey_example"; // String | The environment key
let featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
let id = "id_example"; // String | The flag trigger ID
apiInstance.deleteTriggerWorkflow(projectKey, environmentKey, featureFlagKey, id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
});

Parameters

Name Type Description Notes
projectKey String The project key
environmentKey String The environment key
featureFlagKey String The feature flag key
id String The flag trigger ID

Return type

null (empty response body)

Authorization

ApiKey

HTTP request headers

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

getTriggerWorkflowById

TriggerWorkflowRep getTriggerWorkflowById(projectKey, featureFlagKey, environmentKey, id)

Get flag trigger by ID

Get a flag trigger 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.FlagTriggersApi();
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 flag trigger ID
apiInstance.getTriggerWorkflowById(projectKey, featureFlagKey, environmentKey, id, (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
featureFlagKey String The feature flag key
environmentKey String The environment key
id String The flag trigger ID

Return type

TriggerWorkflowRep

Authorization

ApiKey

HTTP request headers

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

getTriggerWorkflows

TriggerWorkflowCollectionRep getTriggerWorkflows(projectKey, environmentKey, featureFlagKey)

List flag triggers

Get a list of all flag triggers.

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.FlagTriggersApi();
let projectKey = "projectKey_example"; // String | The project key
let environmentKey = "environmentKey_example"; // String | The environment key
let featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
apiInstance.getTriggerWorkflows(projectKey, environmentKey, featureFlagKey, (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
featureFlagKey String The feature flag key

Return type

TriggerWorkflowCollectionRep

Authorization

ApiKey

HTTP request headers

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

patchTriggerWorkflow

TriggerWorkflowRep patchTriggerWorkflow(projectKey, environmentKey, featureFlagKey, id, flagTriggerInput)

Update flag trigger

Update a flag trigger. Updating a flag trigger 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 flag triggers. <details> <summary>Click to expand instructions for <strong>updating flag triggers</strong></summary> #### replaceTriggerActionInstructions Removes the existing trigger action and replaces it with the new instructions. ##### Parameters - `value`: An array of the new `kind`s of actions to perform when triggering. Supported flag actions are `turnFlagOn` and `turnFlagOff`. Here's an example that replaces the existing action with new instructions to turn flag targeting off: ```json { &quot;instructions&quot;: [ { &quot;kind&quot;: &quot;replaceTriggerActionInstructions&quot;, &quot;value&quot;: [ {&quot;kind&quot;: &quot;turnFlagOff&quot;} ] } ] } ``` #### cycleTriggerUrl Generates a new URL for this trigger. You must update any clients using the trigger to use this new URL. Here's an example: ```json { &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;cycleTriggerUrl&quot; }] } ``` #### disableTrigger Disables the trigger. This saves the trigger configuration, but the trigger stops running. To re-enable, use `enableTrigger`. Here's an example: ```json { &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;disableTrigger&quot; }] } ``` #### enableTrigger Enables the trigger. If you previously disabled the trigger, it begins running again. Here's an example: ```json { &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;enableTrigger&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.FlagTriggersApi();
let projectKey = "projectKey_example"; // String | The project key
let environmentKey = "environmentKey_example"; // String | The environment key
let featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
let id = "id_example"; // String | The flag trigger ID
let flagTriggerInput = new LaunchDarklyApi.FlagTriggerInput(); // FlagTriggerInput | 
apiInstance.patchTriggerWorkflow(projectKey, environmentKey, featureFlagKey, id, flagTriggerInput, (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
featureFlagKey String The feature flag key
id String The flag trigger ID
flagTriggerInput FlagTriggerInput

Return type

TriggerWorkflowRep

Authorization

ApiKey

HTTP request headers

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