Patch client by ID
curl --request PATCH \
--url https://app.launchdarkly.com/api/v2/oauth/clients/{clientId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
[
{
"op": "replace",
"path": "/name",
"value": "Example Client V2"
}
]
'import requests
url = "https://app.launchdarkly.com/api/v2/oauth/clients/{clientId}"
payload = [
{
"op": "replace",
"path": "/name",
"value": "Example Client V2"
}
]
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([{op: 'replace', path: '/name', value: 'Example Client V2'}])
};
fetch('https://app.launchdarkly.com/api/v2/oauth/clients/{clientId}', 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/{clientId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
[
'op' => 'replace',
'path' => '/name',
'value' => 'Example Client V2'
]
]),
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/{clientId}"
payload := strings.NewReader("[\n {\n \"op\": \"replace\",\n \"path\": \"/name\",\n \"value\": \"Example Client V2\"\n }\n]")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.launchdarkly.com/api/v2/oauth/clients/{clientId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"op\": \"replace\",\n \"path\": \"/name\",\n \"value\": \"Example Client V2\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/oauth/clients/{clientId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"op\": \"replace\",\n \"path\": \"/name\",\n \"value\": \"Example Client V2\"\n }\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."
}{
"code": "not_found",
"message": "Invalid resource identifier"
}Patch client by ID
Patch an existing OAuth 2.0 client by client ID. Updating an OAuth2 client uses a JSON patch representation of the desired changes. To learn more, read Updates. Only name, description, and redirectUri may be patched.
PATCH
/
api
/
v2
/
oauth
/
clients
/
{clientId}
Patch client by ID
curl --request PATCH \
--url https://app.launchdarkly.com/api/v2/oauth/clients/{clientId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
[
{
"op": "replace",
"path": "/name",
"value": "Example Client V2"
}
]
'import requests
url = "https://app.launchdarkly.com/api/v2/oauth/clients/{clientId}"
payload = [
{
"op": "replace",
"path": "/name",
"value": "Example Client V2"
}
]
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([{op: 'replace', path: '/name', value: 'Example Client V2'}])
};
fetch('https://app.launchdarkly.com/api/v2/oauth/clients/{clientId}', 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/{clientId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
[
'op' => 'replace',
'path' => '/name',
'value' => 'Example Client V2'
]
]),
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/{clientId}"
payload := strings.NewReader("[\n {\n \"op\": \"replace\",\n \"path\": \"/name\",\n \"value\": \"Example Client V2\"\n }\n]")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.launchdarkly.com/api/v2/oauth/clients/{clientId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"op\": \"replace\",\n \"path\": \"/name\",\n \"value\": \"Example Client V2\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/oauth/clients/{clientId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"op\": \"replace\",\n \"path\": \"/name\",\n \"value\": \"Example Client V2\"\n }\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."
}{
"code": "not_found",
"message": "Invalid resource identifier"
}Authorizations
Path Parameters
The client ID
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.