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 |
TriggerWorkflowRep createTriggerWorkflow(projectKey, environmentKey, featureFlagKey, triggerPost)
Create flag trigger
Create a new flag trigger.
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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| projectKey | String | The project key | |
| environmentKey | String | The environment key | |
| featureFlagKey | String | The feature flag key | |
| triggerPost | TriggerPost |
- Content-Type: application/json
- Accept: application/json
deleteTriggerWorkflow(projectKey, environmentKey, featureFlagKey, id)
Delete flag trigger
Delete a flag trigger 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.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.');
}
});| 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 |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
TriggerWorkflowRep getTriggerWorkflowById(projectKey, featureFlagKey, environmentKey, id)
Get flag trigger by ID
Get a flag trigger 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.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);
}
});| 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 |
- Content-Type: Not defined
- Accept: application/json
TriggerWorkflowCollectionRep getTriggerWorkflows(projectKey, environmentKey, featureFlagKey)
List flag triggers
Get a list of all flag triggers.
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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| projectKey | String | The project key | |
| environmentKey | String | The environment key | |
| featureFlagKey | String | The feature flag key |
- Content-Type: Not defined
- Accept: application/json
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 { "instructions": [ { "kind": "replaceTriggerActionInstructions", "value": [ {"kind": "turnFlagOff"} ] } ] } ``` #### 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 { "instructions": [{ "kind": "cycleTriggerUrl" }] } ``` #### disableTrigger Disables the trigger. This saves the trigger configuration, but the trigger stops running. To re-enable, use `enableTrigger`. Here's an example: ```json { "instructions": [{ "kind": "disableTrigger" }] } ``` #### enableTrigger Enables the trigger. If you previously disabled the trigger, it begins running again. Here's an example: ```json { "instructions": [{ "kind": "enableTrigger" }] } ``` </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.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);
}
});| 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 |
- Content-Type: application/json
- Accept: application/json