Update flag trigger

PATCH
/api/v2/flags/:projectKey/:featureFlagKey/triggers/:environmentKey/:id

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.

Click to expand instructions for updating flag triggers

replaceTriggerActionInstructions

Removes the existing trigger action and replaces it with the new instructions.

Parameters
  • value: An array of the new kinds 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:

1{
2 "instructions": [
3 {
4 "kind": "replaceTriggerActionInstructions",
5 "value": [ {"kind": "turnFlagOff"} ]
6 }
7 ]
8}

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:

1{
2 "instructions": [{ "kind": "cycleTriggerUrl" }]
3}

disableTrigger

Disables the trigger. This saves the trigger configuration, but the trigger stops running. To re-enable, use enableTrigger.

Here’s an example:

1{
2 "instructions": [{ "kind": "disableTrigger" }]
3}

enableTrigger

Enables the trigger. If you previously disabled the trigger, it begins running again.

Here’s an example:

1{
2 "instructions": [{ "kind": "enableTrigger" }]
3}

Path parameters

projectKeystringRequired

The project key

environmentKeystringRequired

The environment key

featureFlagKeystringRequired

The feature flag key

idstringRequired

The flag trigger ID

Request

This endpoint expects an object.
commentstringOptional

Optional comment describing the update

instructionslist of maps from strings to anyOptional

The instructions to perform when updating. This should be an array with objects that look like <code>{“kind”: “trigger_action”}</code>.

Response

Flag trigger response

_idstringOptional

The ID of this flag trigger

_versionintegerOptional

The flag trigger version

_creationDatelongOptional

Timestamp of when the flag trigger was created

_maintainerIdstringOptional

The ID of the flag trigger maintainer

_maintainerobjectOptional

Details on the member who maintains this flag trigger

enabledbooleanOptional

Whether the flag trigger is currently enabled

_integrationKeystringOptional

The unique identifier of the integration for your trigger

instructionslist of maps from strings to anyOptional

Details on the action to perform when triggering

_lastTriggeredAtlongOptional

Timestamp of when the trigger was most recently executed

_recentTriggerBodieslist of objectsOptional

Details on recent flag trigger requests.

_triggerCountintegerOptional

Number of times the trigger has been executed

triggerURLstringOptional

The unguessable URL for this flag trigger

Errors

Built with