# List flag triggers

GET https://app.launchdarkly.com/api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}

Get a list of all flag triggers.

Reference: https://launchdarkly.com/docs/api/flag-triggers/get-trigger-workflows

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: LaunchDarkly REST API
  version: 1.0.0
paths:
  /api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}:
    get:
      operationId: get-trigger-workflows
      summary: List flag triggers
      description: Get a list of all flag triggers.
      tags:
        - subpackage_flagTriggers
      parameters:
        - name: projectKey
          in: path
          description: The project key
          required: true
          schema:
            type: string
            format: string
        - name: environmentKey
          in: path
          description: The environment key
          required: true
          schema:
            type: string
            format: string
        - name: featureFlagKey
          in: path
          description: The feature flag key
          required: true
          schema:
            type: string
            format: string
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Flag trigger collection response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TriggerWorkflowCollectionRep'
        '401':
          description: Invalid access token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorRep'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenErrorRep'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitedErrorRep'
servers:
  - url: https://app.launchdarkly.com
  - url: https://app.launchdarkly.us
components:
  schemas:
    FeatureWorkflowId:
      type: string
      title: FeatureWorkflowId
    UnixMillis:
      type: integer
      format: int64
      title: UnixMillis
    Link:
      type: object
      properties:
        href:
          type: string
          description: The URL of the link
        type:
          type: string
          description: The type of the link
      title: Link
    MemberSummary:
      type: object
      properties:
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Link'
          description: The location and content type of related resources
        _id:
          type: string
          description: The member's ID
        firstName:
          type: string
          description: The member's first name
        lastName:
          type: string
          description: The member's last name
        role:
          type: string
          description: >-
            The member's base role. If the member has no additional roles, this
            role will be in effect.
        email:
          type: string
          description: The member's email address
      required:
        - _links
        - _id
        - role
        - email
      title: MemberSummary
    Instruction:
      type: object
      additionalProperties:
        description: Any type
      title: Instruction
    Instructions:
      type: array
      items:
        $ref: '#/components/schemas/Instruction'
      title: Instructions
    RecentTriggerBody:
      type: object
      properties:
        timestamp:
          $ref: '#/components/schemas/UnixMillis'
          description: Timestamp of the incoming trigger webhook
        jsonBody:
          type: object
          additionalProperties:
            description: Any type
          description: >-
            The marshalled JSON request body for the incoming trigger webhook.
            If this is empty or contains invalid JSON, the timestamp is recorded
            but this field will be empty.
      title: RecentTriggerBody
    TriggerWorkflowRep:
      type: object
      properties:
        _id:
          $ref: '#/components/schemas/FeatureWorkflowId'
          description: The ID of this flag trigger
        _version:
          type: integer
          description: The flag trigger version
        _creationDate:
          $ref: '#/components/schemas/UnixMillis'
          description: Timestamp of when the flag trigger was created
        _maintainerId:
          type: string
          description: The ID of the flag trigger maintainer
        _maintainer:
          $ref: '#/components/schemas/MemberSummary'
          description: Details on the member who maintains this flag trigger
        enabled:
          type: boolean
          description: Whether the flag trigger is currently enabled
        _integrationKey:
          type: string
          description: The unique identifier of the integration for your trigger
        instructions:
          $ref: '#/components/schemas/Instructions'
          description: Details on the action to perform when triggering
        _lastTriggeredAt:
          $ref: '#/components/schemas/UnixMillis'
          description: Timestamp of when the trigger was most recently executed
        _recentTriggerBodies:
          type: array
          items:
            $ref: '#/components/schemas/RecentTriggerBody'
          description: Details on recent flag trigger requests.
        _triggerCount:
          type: integer
          description: Number of times the trigger has been executed
        triggerURL:
          type: string
          description: The unguessable URL for this flag trigger
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Link'
          description: The location and content type of related resources
      title: TriggerWorkflowRep
    TriggerWorkflowCollectionRep:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/TriggerWorkflowRep'
          description: An array of flag triggers
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Link'
          description: The location and content type of related resources
      title: TriggerWorkflowCollectionRep
    UnauthorizedErrorRep:
      type: object
      properties:
        code:
          type: string
          description: Specific error code encountered
        message:
          type: string
          description: Description of the error
      required:
        - code
        - message
      title: UnauthorizedErrorRep
    ForbiddenErrorRep:
      type: object
      properties:
        code:
          type: string
          description: Specific error code encountered
        message:
          type: string
          description: Description of the error
      required:
        - code
        - message
      title: ForbiddenErrorRep
    RateLimitedErrorRep:
      type: object
      properties:
        code:
          type: string
          description: Specific error code encountered
        message:
          type: string
          description: Description of the error
      required:
        - code
        - message
      title: RateLimitedErrorRep
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization

```

## SDK Code Examples

```python
import requests

url = "https://app.launchdarkly.com/api/v2/flags/projectKey/featureFlagKey/triggers/environmentKey"

headers = {"Authorization": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://app.launchdarkly.com/api/v2/flags/projectKey/featureFlagKey/triggers/environmentKey';
const options = {method: 'GET', headers: {Authorization: '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://app.launchdarkly.com/api/v2/flags/projectKey/featureFlagKey/triggers/environmentKey"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://app.launchdarkly.com/api/v2/flags/projectKey/featureFlagKey/triggers/environmentKey")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://app.launchdarkly.com/api/v2/flags/projectKey/featureFlagKey/triggers/environmentKey")
  .header("Authorization", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://app.launchdarkly.com/api/v2/flags/projectKey/featureFlagKey/triggers/environmentKey', [
  'headers' => [
    'Authorization' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://app.launchdarkly.com/api/v2/flags/projectKey/featureFlagKey/triggers/environmentKey");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://app.launchdarkly.com/api/v2/flags/projectKey/featureFlagKey/triggers/environmentKey")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```