curl --request POST \
--url https://app.launchdarkly.com/api/v2/destinations/projects/{projKey}/environments/{envKey}/kinds/{kind}/setup \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"snowflakeHostAddress": "<string>",
"databaseName": "<string>",
"warehouseName": "<string>",
"roleName": "<string>",
"schemaName": "<string>",
"userName": "<string>",
"includeNetworkPolicy": true,
"clusterIdentifier": "<string>",
"clusterRegion": "<string>",
"clusterAwsAccountId": "<string>",
"endpoint": "<string>",
"clickHouseDatabaseName": "<string>",
"clickHouseUserName": "<string>",
"clickHouseS3BucketName": "<string>",
"clickHouseIncludeHostRestriction": true,
"clickHouseServiceRoleArn": "<string>",
"clickHousePassword": "<string>",
"s3BucketName": "<string>"
}
'import requests
url = "https://app.launchdarkly.com/api/v2/destinations/projects/{projKey}/environments/{envKey}/kinds/{kind}/setup"
payload = {
"name": "<string>",
"snowflakeHostAddress": "<string>",
"databaseName": "<string>",
"warehouseName": "<string>",
"roleName": "<string>",
"schemaName": "<string>",
"userName": "<string>",
"includeNetworkPolicy": True,
"clusterIdentifier": "<string>",
"clusterRegion": "<string>",
"clusterAwsAccountId": "<string>",
"endpoint": "<string>",
"clickHouseDatabaseName": "<string>",
"clickHouseUserName": "<string>",
"clickHouseS3BucketName": "<string>",
"clickHouseIncludeHostRestriction": True,
"clickHouseServiceRoleArn": "<string>",
"clickHousePassword": "<string>",
"s3BucketName": "<string>"
}
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({
name: '<string>',
snowflakeHostAddress: '<string>',
databaseName: '<string>',
warehouseName: '<string>',
roleName: '<string>',
schemaName: '<string>',
userName: '<string>',
includeNetworkPolicy: true,
clusterIdentifier: '<string>',
clusterRegion: '<string>',
clusterAwsAccountId: '<string>',
endpoint: '<string>',
clickHouseDatabaseName: '<string>',
clickHouseUserName: '<string>',
clickHouseS3BucketName: '<string>',
clickHouseIncludeHostRestriction: true,
clickHouseServiceRoleArn: '<string>',
clickHousePassword: '<string>',
s3BucketName: '<string>'
})
};
fetch('https://app.launchdarkly.com/api/v2/destinations/projects/{projKey}/environments/{envKey}/kinds/{kind}/setup', 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/projects/{projKey}/environments/{envKey}/kinds/{kind}/setup",
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([
'name' => '<string>',
'snowflakeHostAddress' => '<string>',
'databaseName' => '<string>',
'warehouseName' => '<string>',
'roleName' => '<string>',
'schemaName' => '<string>',
'userName' => '<string>',
'includeNetworkPolicy' => true,
'clusterIdentifier' => '<string>',
'clusterRegion' => '<string>',
'clusterAwsAccountId' => '<string>',
'endpoint' => '<string>',
'clickHouseDatabaseName' => '<string>',
'clickHouseUserName' => '<string>',
'clickHouseS3BucketName' => '<string>',
'clickHouseIncludeHostRestriction' => true,
'clickHouseServiceRoleArn' => '<string>',
'clickHousePassword' => '<string>',
's3BucketName' => '<string>'
]),
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/projects/{projKey}/environments/{envKey}/kinds/{kind}/setup"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"snowflakeHostAddress\": \"<string>\",\n \"databaseName\": \"<string>\",\n \"warehouseName\": \"<string>\",\n \"roleName\": \"<string>\",\n \"schemaName\": \"<string>\",\n \"userName\": \"<string>\",\n \"includeNetworkPolicy\": true,\n \"clusterIdentifier\": \"<string>\",\n \"clusterRegion\": \"<string>\",\n \"clusterAwsAccountId\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"clickHouseDatabaseName\": \"<string>\",\n \"clickHouseUserName\": \"<string>\",\n \"clickHouseS3BucketName\": \"<string>\",\n \"clickHouseIncludeHostRestriction\": true,\n \"clickHouseServiceRoleArn\": \"<string>\",\n \"clickHousePassword\": \"<string>\",\n \"s3BucketName\": \"<string>\"\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/projects/{projKey}/environments/{envKey}/kinds/{kind}/setup")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"snowflakeHostAddress\": \"<string>\",\n \"databaseName\": \"<string>\",\n \"warehouseName\": \"<string>\",\n \"roleName\": \"<string>\",\n \"schemaName\": \"<string>\",\n \"userName\": \"<string>\",\n \"includeNetworkPolicy\": true,\n \"clusterIdentifier\": \"<string>\",\n \"clusterRegion\": \"<string>\",\n \"clusterAwsAccountId\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"clickHouseDatabaseName\": \"<string>\",\n \"clickHouseUserName\": \"<string>\",\n \"clickHouseS3BucketName\": \"<string>\",\n \"clickHouseIncludeHostRestriction\": true,\n \"clickHouseServiceRoleArn\": \"<string>\",\n \"clickHousePassword\": \"<string>\",\n \"s3BucketName\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/destinations/projects/{projKey}/environments/{envKey}/kinds/{kind}/setup")
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 \"name\": \"<string>\",\n \"snowflakeHostAddress\": \"<string>\",\n \"databaseName\": \"<string>\",\n \"warehouseName\": \"<string>\",\n \"roleName\": \"<string>\",\n \"schemaName\": \"<string>\",\n \"userName\": \"<string>\",\n \"includeNetworkPolicy\": true,\n \"clusterIdentifier\": \"<string>\",\n \"clusterRegion\": \"<string>\",\n \"clusterAwsAccountId\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"clickHouseDatabaseName\": \"<string>\",\n \"clickHouseUserName\": \"<string>\",\n \"clickHouseS3BucketName\": \"<string>\",\n \"clickHouseIncludeHostRestriction\": true,\n \"clickHouseServiceRoleArn\": \"<string>\",\n \"clickHousePassword\": \"<string>\",\n \"s3BucketName\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"script": "<string>",
"publicKey": "<string>",
"publicKeyPkcs8": "<string>",
"redshiftIAMPermissionsPolicy": "<string>",
"redshiftIAMTrustPolicy": "<string>",
"s3BucketName": "<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": "rate_limited",
"message": "You've exceeded the API rate limit. Try again later."
}Generate warehouse destination setup script
Generate the SQL setup script required to prepare a warehouse for LaunchDarkly Data Export. For Snowflake, this also generates a key pair. Custom Snowflake object names may be provided. If omitted, defaults are used.
curl --request POST \
--url https://app.launchdarkly.com/api/v2/destinations/projects/{projKey}/environments/{envKey}/kinds/{kind}/setup \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"snowflakeHostAddress": "<string>",
"databaseName": "<string>",
"warehouseName": "<string>",
"roleName": "<string>",
"schemaName": "<string>",
"userName": "<string>",
"includeNetworkPolicy": true,
"clusterIdentifier": "<string>",
"clusterRegion": "<string>",
"clusterAwsAccountId": "<string>",
"endpoint": "<string>",
"clickHouseDatabaseName": "<string>",
"clickHouseUserName": "<string>",
"clickHouseS3BucketName": "<string>",
"clickHouseIncludeHostRestriction": true,
"clickHouseServiceRoleArn": "<string>",
"clickHousePassword": "<string>",
"s3BucketName": "<string>"
}
'import requests
url = "https://app.launchdarkly.com/api/v2/destinations/projects/{projKey}/environments/{envKey}/kinds/{kind}/setup"
payload = {
"name": "<string>",
"snowflakeHostAddress": "<string>",
"databaseName": "<string>",
"warehouseName": "<string>",
"roleName": "<string>",
"schemaName": "<string>",
"userName": "<string>",
"includeNetworkPolicy": True,
"clusterIdentifier": "<string>",
"clusterRegion": "<string>",
"clusterAwsAccountId": "<string>",
"endpoint": "<string>",
"clickHouseDatabaseName": "<string>",
"clickHouseUserName": "<string>",
"clickHouseS3BucketName": "<string>",
"clickHouseIncludeHostRestriction": True,
"clickHouseServiceRoleArn": "<string>",
"clickHousePassword": "<string>",
"s3BucketName": "<string>"
}
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({
name: '<string>',
snowflakeHostAddress: '<string>',
databaseName: '<string>',
warehouseName: '<string>',
roleName: '<string>',
schemaName: '<string>',
userName: '<string>',
includeNetworkPolicy: true,
clusterIdentifier: '<string>',
clusterRegion: '<string>',
clusterAwsAccountId: '<string>',
endpoint: '<string>',
clickHouseDatabaseName: '<string>',
clickHouseUserName: '<string>',
clickHouseS3BucketName: '<string>',
clickHouseIncludeHostRestriction: true,
clickHouseServiceRoleArn: '<string>',
clickHousePassword: '<string>',
s3BucketName: '<string>'
})
};
fetch('https://app.launchdarkly.com/api/v2/destinations/projects/{projKey}/environments/{envKey}/kinds/{kind}/setup', 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/projects/{projKey}/environments/{envKey}/kinds/{kind}/setup",
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([
'name' => '<string>',
'snowflakeHostAddress' => '<string>',
'databaseName' => '<string>',
'warehouseName' => '<string>',
'roleName' => '<string>',
'schemaName' => '<string>',
'userName' => '<string>',
'includeNetworkPolicy' => true,
'clusterIdentifier' => '<string>',
'clusterRegion' => '<string>',
'clusterAwsAccountId' => '<string>',
'endpoint' => '<string>',
'clickHouseDatabaseName' => '<string>',
'clickHouseUserName' => '<string>',
'clickHouseS3BucketName' => '<string>',
'clickHouseIncludeHostRestriction' => true,
'clickHouseServiceRoleArn' => '<string>',
'clickHousePassword' => '<string>',
's3BucketName' => '<string>'
]),
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/projects/{projKey}/environments/{envKey}/kinds/{kind}/setup"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"snowflakeHostAddress\": \"<string>\",\n \"databaseName\": \"<string>\",\n \"warehouseName\": \"<string>\",\n \"roleName\": \"<string>\",\n \"schemaName\": \"<string>\",\n \"userName\": \"<string>\",\n \"includeNetworkPolicy\": true,\n \"clusterIdentifier\": \"<string>\",\n \"clusterRegion\": \"<string>\",\n \"clusterAwsAccountId\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"clickHouseDatabaseName\": \"<string>\",\n \"clickHouseUserName\": \"<string>\",\n \"clickHouseS3BucketName\": \"<string>\",\n \"clickHouseIncludeHostRestriction\": true,\n \"clickHouseServiceRoleArn\": \"<string>\",\n \"clickHousePassword\": \"<string>\",\n \"s3BucketName\": \"<string>\"\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/projects/{projKey}/environments/{envKey}/kinds/{kind}/setup")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"snowflakeHostAddress\": \"<string>\",\n \"databaseName\": \"<string>\",\n \"warehouseName\": \"<string>\",\n \"roleName\": \"<string>\",\n \"schemaName\": \"<string>\",\n \"userName\": \"<string>\",\n \"includeNetworkPolicy\": true,\n \"clusterIdentifier\": \"<string>\",\n \"clusterRegion\": \"<string>\",\n \"clusterAwsAccountId\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"clickHouseDatabaseName\": \"<string>\",\n \"clickHouseUserName\": \"<string>\",\n \"clickHouseS3BucketName\": \"<string>\",\n \"clickHouseIncludeHostRestriction\": true,\n \"clickHouseServiceRoleArn\": \"<string>\",\n \"clickHousePassword\": \"<string>\",\n \"s3BucketName\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/destinations/projects/{projKey}/environments/{envKey}/kinds/{kind}/setup")
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 \"name\": \"<string>\",\n \"snowflakeHostAddress\": \"<string>\",\n \"databaseName\": \"<string>\",\n \"warehouseName\": \"<string>\",\n \"roleName\": \"<string>\",\n \"schemaName\": \"<string>\",\n \"userName\": \"<string>\",\n \"includeNetworkPolicy\": true,\n \"clusterIdentifier\": \"<string>\",\n \"clusterRegion\": \"<string>\",\n \"clusterAwsAccountId\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"clickHouseDatabaseName\": \"<string>\",\n \"clickHouseUserName\": \"<string>\",\n \"clickHouseS3BucketName\": \"<string>\",\n \"clickHouseIncludeHostRestriction\": true,\n \"clickHouseServiceRoleArn\": \"<string>\",\n \"clickHousePassword\": \"<string>\",\n \"s3BucketName\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"script": "<string>",
"publicKey": "<string>",
"publicKeyPkcs8": "<string>",
"redshiftIAMPermissionsPolicy": "<string>",
"redshiftIAMTrustPolicy": "<string>",
"s3BucketName": "<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": "rate_limited",
"message": "You've exceeded the API rate limit. Try again later."
}Authorizations
Path Parameters
The project key
The environment key
The destination kind (snowflake-v2, redshift, clickhouse)
Body
Response
Generate warehouse destination setup script response
The SQL setup script to run in your data warehouse
The RSA public key (Snowflake only) to store as the destination public_key
The PKCS8 RSA public key (Snowflake only)
For Redshift, present only when clusterIdentifier, clusterRegion, and clusterAwsAccountId are supplied in the request body.
For Redshift, present only when clusterIdentifier, clusterRegion, and clusterAwsAccountId are supplied in the request body.
The auto-generated S3 staging bucket name (ClickHouse and Redshift)