List flag events
For the complete documentation index, see llms.txt. For the full documentation snapshot, see llms-full.txt.
Get a list of flag events
Expanding the flag event collection response
LaunchDarkly supports expanding the flag event collection response to include additional fields.
To expand the response, append the expand query parameter and include the following:
experimentsincludes details on all of the experiments run on each flag
For example, use ?expand=experiments to include the experiments field in the response. By default, this field is not included in the response.
curl --request GET \
--url https://app.launchdarkly.com/api/v2/engineering-insights/flag-events \
--header 'Authorization: <api-key>'import requests
url = "https://app.launchdarkly.com/api/v2/engineering-insights/flag-events"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://app.launchdarkly.com/api/v2/engineering-insights/flag-events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.launchdarkly.com/api/v2/engineering-insights/flag-events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.launchdarkly.com/api/v2/engineering-insights/flag-events"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.launchdarkly.com/api/v2/engineering-insights/flag-events")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/engineering-insights/flag-events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"totalCount": 1200,
"items": [
{
"id": "e3b2b0e0-9e9b-4c9a-8e9a-0e0e0e0e0e0e",
"projectId": "65baa44ecc4b5bce113bb4f7",
"projectKey": "default",
"flagKey": "enable-new-payment-method",
"eventType": "enabled_targeting",
"eventTime": "1616425200000",
"description": "Targeting rule enabled",
"impact": {
"size": "medium",
"percentage": 50,
"reason": "evaluations",
"evaluationsSummary": {
"variations": [
{
"value": "true",
"before": 1000,
"after": 500
}
]
}
},
"environmentId": "65baa44ecc4b5bce113bb4f7",
"environmentKey": "production",
"auditLogEntryId": "e3b2b0e0-9e9b-4c9a-8e9a-0e0e0e0e0e0e",
"member": {
"id": "65baa44ecc4b5bce113bb4f7",
"email": "test@launchdarkly.com",
"firstName": "<string>",
"lastName": "<string>"
},
"actions": [
"<string>"
],
"experiments": {
"totalCount": 1,
"items": [
{
"key": "experiment-1",
"name": "Experiment 1",
"iteration": {
"id": "65baa44ecc4b5bce113bb4f7",
"status": "running",
"startedAt": "1655314200000",
"endedAt": "1656610200000",
"_links": {}
},
"_links": {}
}
]
}
}
],
"_links": {
"next": {
"href": "/api/v2/engineering-insights/flag-events?after=a4290006-1fd1-4ca5-acf7-9f31fac61cf5",
"type": "application/json"
},
"self": {
"href": "/api/v2/engineering-insights/flag-events",
"type": "application/json"
}
}
}{
"code": "invalid_request",
"message": "validation failed",
"errors": [
{
"attribute": "projectKey",
"reason": "must be present"
}
]
}{
"code": "unauthorized",
"message": "Invalid access token"
}{
"code": "forbidden",
"message": "Forbidden. Access to the requested resource was denied."
}{
"code": "not_found",
"message": "Invalid resource identifier"
}{
"code": "rate_limited",
"message": "You've exceeded the API rate limit. Try again later."
}Authorizations
Query Parameters
The project key
The environment key
Comma separated list of application keys
Filter events by flag key
Filter events by impact size. A small impact created a less than 20% change in the proportion of end users receiving one or more flag variations. A medium impact created between a 20%-80% change. A large impact created a more than 80% change. Options: none, small, medium, large
Filter events to those associated with an experiment (true) or without an experiment (false)
Filter to include or exclude global events. Default value is include. Options: include, exclude
Expand properties in response. Options: experiments
The number of deployments to return. Default is 20. Maximum allowed is 100.
Unix timestamp in milliseconds. Default value is 7 days ago.
Unix timestamp in milliseconds. Default value is now.
Identifier used for pagination
Identifier used for pagination
Response
Flag event collection response
The total number of flag events
1200
A list of flag events
Show child attributes
Show child attributes
The location and content type of related resources
Show child attributes
Show child attributes
{
"next": {
"href": "/api/v2/engineering-insights/flag-events?after=a4290006-1fd1-4ca5-acf7-9f31fac61cf5",
"type": "application/json"
},
"self": {
"href": "/api/v2/engineering-insights/flag-events",
"type": "application/json"
}
}
curl --request GET \
--url https://app.launchdarkly.com/api/v2/engineering-insights/flag-events \
--header 'Authorization: <api-key>'import requests
url = "https://app.launchdarkly.com/api/v2/engineering-insights/flag-events"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://app.launchdarkly.com/api/v2/engineering-insights/flag-events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.launchdarkly.com/api/v2/engineering-insights/flag-events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.launchdarkly.com/api/v2/engineering-insights/flag-events"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.launchdarkly.com/api/v2/engineering-insights/flag-events")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/engineering-insights/flag-events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"totalCount": 1200,
"items": [
{
"id": "e3b2b0e0-9e9b-4c9a-8e9a-0e0e0e0e0e0e",
"projectId": "65baa44ecc4b5bce113bb4f7",
"projectKey": "default",
"flagKey": "enable-new-payment-method",
"eventType": "enabled_targeting",
"eventTime": "1616425200000",
"description": "Targeting rule enabled",
"impact": {
"size": "medium",
"percentage": 50,
"reason": "evaluations",
"evaluationsSummary": {
"variations": [
{
"value": "true",
"before": 1000,
"after": 500
}
]
}
},
"environmentId": "65baa44ecc4b5bce113bb4f7",
"environmentKey": "production",
"auditLogEntryId": "e3b2b0e0-9e9b-4c9a-8e9a-0e0e0e0e0e0e",
"member": {
"id": "65baa44ecc4b5bce113bb4f7",
"email": "test@launchdarkly.com",
"firstName": "<string>",
"lastName": "<string>"
},
"actions": [
"<string>"
],
"experiments": {
"totalCount": 1,
"items": [
{
"key": "experiment-1",
"name": "Experiment 1",
"iteration": {
"id": "65baa44ecc4b5bce113bb4f7",
"status": "running",
"startedAt": "1655314200000",
"endedAt": "1656610200000",
"_links": {}
},
"_links": {}
}
]
}
}
],
"_links": {
"next": {
"href": "/api/v2/engineering-insights/flag-events?after=a4290006-1fd1-4ca5-acf7-9f31fac61cf5",
"type": "application/json"
},
"self": {
"href": "/api/v2/engineering-insights/flag-events",
"type": "application/json"
}
}
}{
"code": "invalid_request",
"message": "validation failed",
"errors": [
{
"attribute": "projectKey",
"reason": "must be present"
}
]
}{
"code": "unauthorized",
"message": "Invalid access token"
}{
"code": "forbidden",
"message": "Forbidden. Access to the requested resource was denied."
}{
"code": "not_found",
"message": "Invalid resource identifier"
}{
"code": "rate_limited",
"message": "You've exceeded the API rate limit. Try again later."
}