Create a LaunchDarkly OAuth 2.0 client
curl --request POST \
--url https://app.launchdarkly.com/api/v2/oauth/clients \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"redirectUri": "<string>",
"description": "<string>"
}
'import requests
url = "https://app.launchdarkly.com/api/v2/oauth/clients"
payload = {
"name": "<string>",
"redirectUri": "<string>",
"description": "<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>', redirectUri: '<string>', description: '<string>'})
};
fetch('https://app.launchdarkly.com/api/v2/oauth/clients', 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/oauth/clients",
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>',
'redirectUri' => '<string>',
'description' => '<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/oauth/clients"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"redirectUri\": \"<string>\",\n \"description\": \"<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/oauth/clients")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"redirectUri\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/oauth/clients")
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 \"redirectUri\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"_links": {
"parent": {
"href": "/api/v2/oauth/clients",
"type": "application/json"
},
"self": {
"href": "/api/v2/oauth/clients/50666563-9144-4125-b822-33f308227e45",
"type": "application/json"
}
},
"name": "<string>",
"_accountId": "<string>",
"_clientId": "<string>",
"redirectUri": "<string>",
"_creationDate": "1494437420312",
"description": "<string>",
"_clientSecret": "<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."
}Create a LaunchDarkly OAuth 2.0 client
Create (register) a LaunchDarkly OAuth2 client. OAuth2 clients allow you to build custom integrations using LaunchDarkly as your identity provider.
POST
/
api
/
v2
/
oauth
/
clients
Create a LaunchDarkly OAuth 2.0 client
curl --request POST \
--url https://app.launchdarkly.com/api/v2/oauth/clients \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"redirectUri": "<string>",
"description": "<string>"
}
'import requests
url = "https://app.launchdarkly.com/api/v2/oauth/clients"
payload = {
"name": "<string>",
"redirectUri": "<string>",
"description": "<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>', redirectUri: '<string>', description: '<string>'})
};
fetch('https://app.launchdarkly.com/api/v2/oauth/clients', 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/oauth/clients",
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>',
'redirectUri' => '<string>',
'description' => '<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/oauth/clients"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"redirectUri\": \"<string>\",\n \"description\": \"<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/oauth/clients")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"redirectUri\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/oauth/clients")
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 \"redirectUri\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"_links": {
"parent": {
"href": "/api/v2/oauth/clients",
"type": "application/json"
},
"self": {
"href": "/api/v2/oauth/clients/50666563-9144-4125-b822-33f308227e45",
"type": "application/json"
}
},
"name": "<string>",
"_accountId": "<string>",
"_clientId": "<string>",
"redirectUri": "<string>",
"_creationDate": "1494437420312",
"description": "<string>",
"_clientSecret": "<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."
}Authorizations
Body
application/json
Response
OAuth 2.0 client response
The location and content type of related resources
Show child attributes
Show child attributes
Example:
{
"parent": {
"href": "/api/v2/oauth/clients",
"type": "application/json"
},
"self": {
"href": "/api/v2/oauth/clients/50666563-9144-4125-b822-33f308227e45",
"type": "application/json"
}
}
Client name
The account ID the client is registered under
The client's unique ID
The client's redirect URI
Timestamp of client creation date
Example:
"1494437420312"
Client description
The client secret. This will only be shown upon creation.