v5

latestOpenAPI 3.0.3Apache 2.0raw.githubusercontent.com2026-02-283466592.5 MB
Flag triggers

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 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:

{
  "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:

{
  "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:

{
  "instructions": [{ "kind": "disableTrigger" }]
}

enableTrigger

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

Here's an example:

{
  "instructions": [{ "kind": "enableTrigger" }]
}
</details>
patch/api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}/{id}

Path parameters

projectKeystring string required

The project key

The project key

environmentKeystring string required

The environment key

The environment key

featureFlagKeystring string required

The feature flag key

The feature flag key

idstring string required

The flag trigger ID

The flag trigger ID

Request body

commentstring

Optional comment describing the update

instructionsInstruction[]

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

Example request

{
  "comment": "optional comment",
  "instructions": [
    {
      "kind": "disableTrigger"
    }
  ]
}

Response

Flag trigger response

_idstring
_versioninteger

The flag trigger version

_creationDateinteger
_maintainerIdstring

The ID of the flag trigger maintainer

enabledboolean

Whether the flag trigger is currently enabled

_integrationKeystring

The unique identifier of the integration for your trigger

instructionsInstruction[]
_lastTriggeredAtinteger
_triggerCountinteger

Number of times the trigger has been executed

triggerURLstring

The unguessable URL for this flag trigger

_linksobject

The location and content type of related resources

Example response

{
  "_version": 1,
  "_maintainerId": "12ab3c45de678910abc12345",
  "_maintainer": {
    "_links": {
      "self": {
        "href": "/api/v2/members/569f183514f4432160000007",
        "type": "application/json"
      }
    },
    "_id": "569f183514f4432160000007",
    "firstName": "Ariel",
    "lastName": "Flores",
    "role": "admin",
    "email": "ariel@acme.com"
  },
  "enabled": true,
  "_integrationKey": "generic-trigger",
  "_triggerCount": 3
}