Create Data Export destination
For the complete documentation index, see llms.txt. For the full documentation snapshot, see llms-full.txt.
Create a new Data Export destination.
In the config request body parameter, the fields required depend on the type of Data Export destination.
Click to expand config parameter details
Azure Event Hubs
To create a Data Export destination with a kind of azure-event-hubs, the config object requires the following fields:
namespace: The Event Hub Namespace namename: The Event Hub namepolicyName: The shared access signature policy name. You can find your policy name in the settings of your Azure Event Hubs Namespace.policyKey: The shared access signature key. You can find your policy key in the settings of your Azure Event Hubs Namespace.
Google Cloud Pub/Sub
To create a Data Export destination with a kind of google-pubsub, the config object requires the following fields:
project: The Google PubSub project ID for the project to publish totopic: The Google PubSub topic ID for the topic to publish to
Amazon Kinesis
To create a Data Export destination with a kind of kinesis, the config object requires the following fields:
region: The Kinesis stream’s AWS region keyroleArn: The Amazon Resource Name (ARN) of the AWS role that will be writing to KinesisstreamName: The name of the Kinesis stream that LaunchDarkly is sending events to. This is not the ARN of the stream.
mParticle
To create a Data Export destination with a kind of mparticle, the config object requires the following fields:
apiKey: The mParticle API keysecret: The mParticle API secretuserIdentity: The type of identifier you use to identify your end users in mParticleanonymousUserIdentity: The type of identifier you use to identify your anonymous end users in mParticle
Segment
To create a Data Export destination with a kind of segment, the config object requires the following fields:
writeKey: The Segment write key. This is used to authenticate LaunchDarkly’s calls to Segment.
Snowflake
To create a Data Export destination with a kind of snowflake-v2, the config object requires the following fields:
publicKey: ThepublicKeyis returned as part of the Generate Snowflake destination key pair response. It is thepublic_keyfield.snowflakeHostAddress: Your Snowflake account URL.
curl --request POST \
--url https://app.launchdarkly.com/api/v2/destinations/{projectKey}/{environmentKey} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"config": {
"project": "test-prod",
"topic": "ld-pubsub-test-192301"
},
"kind": "google-pubsub"
}
'import requests
url = "https://app.launchdarkly.com/api/v2/destinations/{projectKey}/{environmentKey}"
payload = {
"config": {
"project": "test-prod",
"topic": "ld-pubsub-test-192301"
},
"kind": "google-pubsub"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
config: {project: 'test-prod', topic: 'ld-pubsub-test-192301'},
kind: 'google-pubsub'
})
};
fetch('https://app.launchdarkly.com/api/v2/destinations/{projectKey}/{environmentKey}', 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/destinations/{projectKey}/{environmentKey}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'config' => [
'project' => 'test-prod',
'topic' => 'ld-pubsub-test-192301'
],
'kind' => 'google-pubsub'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.launchdarkly.com/api/v2/destinations/{projectKey}/{environmentKey}"
payload := strings.NewReader("{\n \"config\": {\n \"project\": \"test-prod\",\n \"topic\": \"ld-pubsub-test-192301\"\n },\n \"kind\": \"google-pubsub\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.launchdarkly.com/api/v2/destinations/{projectKey}/{environmentKey}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"config\": {\n \"project\": \"test-prod\",\n \"topic\": \"ld-pubsub-test-192301\"\n },\n \"kind\": \"google-pubsub\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/destinations/{projectKey}/{environmentKey}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"config\": {\n \"project\": \"test-prod\",\n \"topic\": \"ld-pubsub-test-192301\"\n },\n \"kind\": \"google-pubsub\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "610addeadbeefaa86ec9a7d4",
"_links": {
"parent": {
"href": "/api/v2/destinations",
"type": "application/json"
},
"self": {
"href": "/api/v2/destinations/my-project/my-environment/610addeadbeefaa86ec9a7d4",
"type": "application/json"
}
},
"name": "example-destination",
"kind": "google-pubsub",
"version": 1,
"config": "{\"project\":\"test-prod\",\"topic\":\"ld-pubsub-test-192301\"}",
"on": true,
"_access": {
"denied": [
{
"action": "<string>",
"reason": {
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"notResources": [
"<string>"
],
"actions": [
"*"
],
"notActions": [
"<string>"
],
"role_name": "<string>"
}
}
],
"allowed": [
{
"action": "<string>",
"reason": {
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"notResources": [
"<string>"
],
"actions": [
"*"
],
"notActions": [
"<string>"
],
"role_name": "<string>"
}
}
]
}
}{
"code": "invalid_request",
"message": "Invalid request body"
}{
"code": "unauthorized",
"message": "Invalid access token"
}{
"code": "forbidden",
"message": "Forbidden. Access to the requested resource was denied."
}{
"code": "optimistic_locking_error",
"message": "Conflict. Optimistic lock error. Try again later."
}{
"code": "rate_limited",
"message": "You've exceeded the API rate limit. Try again later."
}Authorizations
Path Parameters
The project key
The environment key
Body
A human-readable name for your Data Export destination
"example-destination"
The type of Data Export destination
google-pubsub, kinesis, mparticle, segment, azure-event-hubs, snowflake-v2, databricks, bigquery, redshift "google-pubsub"
An object with the configuration parameters required for the destination type
"{\"project\":\"test-prod\",\"topic\":\"ld-pubsub-test-192301\"}"
Whether the export is on. Displayed as the integration status in the LaunchDarkly UI.
true
Response
Destination response
The ID of this Data Export destination
"610addeadbeefaa86ec9a7d4"
The location and content type of related resources
Show child attributes
Show child attributes
{
"parent": {
"href": "/api/v2/destinations",
"type": "application/json"
},
"self": {
"href": "/api/v2/destinations/my-project/my-environment/610addeadbeefaa86ec9a7d4",
"type": "application/json"
}
}
A human-readable name for your Data Export destination
"example-destination"
The type of Data Export destination
google-pubsub, kinesis, mparticle, segment, azure-event-hubs, snowflake-v2, databricks, bigquery, redshift "google-pubsub"
1
An object with the configuration parameters required for the destination type
"{\"project\":\"test-prod\",\"topic\":\"ld-pubsub-test-192301\"}"
Whether the export is on, that is, the status of the integration
true
Details on the allowed and denied actions for this Data Export destination
Show child attributes
Show child attributes
curl --request POST \
--url https://app.launchdarkly.com/api/v2/destinations/{projectKey}/{environmentKey} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"config": {
"project": "test-prod",
"topic": "ld-pubsub-test-192301"
},
"kind": "google-pubsub"
}
'import requests
url = "https://app.launchdarkly.com/api/v2/destinations/{projectKey}/{environmentKey}"
payload = {
"config": {
"project": "test-prod",
"topic": "ld-pubsub-test-192301"
},
"kind": "google-pubsub"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
config: {project: 'test-prod', topic: 'ld-pubsub-test-192301'},
kind: 'google-pubsub'
})
};
fetch('https://app.launchdarkly.com/api/v2/destinations/{projectKey}/{environmentKey}', 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/destinations/{projectKey}/{environmentKey}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'config' => [
'project' => 'test-prod',
'topic' => 'ld-pubsub-test-192301'
],
'kind' => 'google-pubsub'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.launchdarkly.com/api/v2/destinations/{projectKey}/{environmentKey}"
payload := strings.NewReader("{\n \"config\": {\n \"project\": \"test-prod\",\n \"topic\": \"ld-pubsub-test-192301\"\n },\n \"kind\": \"google-pubsub\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.launchdarkly.com/api/v2/destinations/{projectKey}/{environmentKey}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"config\": {\n \"project\": \"test-prod\",\n \"topic\": \"ld-pubsub-test-192301\"\n },\n \"kind\": \"google-pubsub\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/destinations/{projectKey}/{environmentKey}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"config\": {\n \"project\": \"test-prod\",\n \"topic\": \"ld-pubsub-test-192301\"\n },\n \"kind\": \"google-pubsub\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "610addeadbeefaa86ec9a7d4",
"_links": {
"parent": {
"href": "/api/v2/destinations",
"type": "application/json"
},
"self": {
"href": "/api/v2/destinations/my-project/my-environment/610addeadbeefaa86ec9a7d4",
"type": "application/json"
}
},
"name": "example-destination",
"kind": "google-pubsub",
"version": 1,
"config": "{\"project\":\"test-prod\",\"topic\":\"ld-pubsub-test-192301\"}",
"on": true,
"_access": {
"denied": [
{
"action": "<string>",
"reason": {
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"notResources": [
"<string>"
],
"actions": [
"*"
],
"notActions": [
"<string>"
],
"role_name": "<string>"
}
}
],
"allowed": [
{
"action": "<string>",
"reason": {
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"notResources": [
"<string>"
],
"actions": [
"*"
],
"notActions": [
"<string>"
],
"role_name": "<string>"
}
}
]
}
}{
"code": "invalid_request",
"message": "Invalid request body"
}{
"code": "unauthorized",
"message": "Invalid access token"
}{
"code": "forbidden",
"message": "Forbidden. Access to the requested resource was denied."
}{
"code": "optimistic_locking_error",
"message": "Conflict. Optimistic lock error. Try again later."
}{
"code": "rate_limited",
"message": "You've exceeded the API rate limit. Try again later."
}