Flag triggers

Create flag trigger

POST
/api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}

Create a new flag trigger.

Authorization

ApiKey read, write
Authorization<token>

In: header

Scope: read, write

Path Parameters

projectKey*string

The project key

Formatstring
environmentKey*string

The environment key

Formatstring
featureFlagKey*string

The feature flag key

Formatstring

Request Body

application/json

comment?string

Optional comment describing the trigger

instructions?array<>

The action to perform when triggering. This should be an array with a single object that looks like {"kind": "flag_action"}. Supported flag actions are turnFlagOn and turnFlagOff.

integrationKey*string

The unique identifier of the integration for your trigger. Use generic-trigger for integrations not explicitly supported.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v2/flags/string/string/triggers/string" \  -H "Content-Type: application/json" \  -d '{    "integrationKey": "generic-trigger"  }'
{  "_id": "12ab3c45de678910abc12345",  "_version": 1,  "_creationDate": "1654104600000",  "_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,  "_status": "active",  "_lastFailedAt": "1654114600000",  "_integrationKey": "generic-trigger",  "instructions": "[ { \"kind\": \"turnFlagOn\" }]",  "_lastTriggeredAt": "1654114600000",  "_recentTriggerBodies": [    {      "timestamp": "1654104600000",      "jsonBody": {        "property1": null,        "property2": null      }    }  ],  "_triggerCount": 3,  "triggerURL": "string",  "_links": {    "property1": {      "href": "string",      "type": "string"    },    "property2": {      "href": "string",      "type": "string"    }  }}