Update IP Allowlist Configuration
curl --request PATCH \
--url https://app.launchdarkly.com/api/v2/account/ip-allowlist \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"sessionAllowlistEnabled": true,
"apiTokenAllowlistEnabled": true
}
'import requests
url = "https://app.launchdarkly.com/api/v2/account/ip-allowlist"
payload = {
"sessionAllowlistEnabled": True,
"apiTokenAllowlistEnabled": True
}
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({sessionAllowlistEnabled: true, apiTokenAllowlistEnabled: true})
};
fetch('https://app.launchdarkly.com/api/v2/account/ip-allowlist', 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/account/ip-allowlist",
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([
'sessionAllowlistEnabled' => true,
'apiTokenAllowlistEnabled' => true
]),
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/account/ip-allowlist"
payload := strings.NewReader("{\n \"sessionAllowlistEnabled\": true,\n \"apiTokenAllowlistEnabled\": true\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/account/ip-allowlist")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sessionAllowlistEnabled\": true,\n \"apiTokenAllowlistEnabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/account/ip-allowlist")
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 \"sessionAllowlistEnabled\": true,\n \"apiTokenAllowlistEnabled\": true\n}"
response = http.request(request)
puts response.read_body{
"entries": [
{
"_createdAt": 0,
"ipAddress": "203.0.113.0/24",
"description": "Office network",
"_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"_updatedAt": 6,
"_createdByMemberId": "507f1f77bcf86cd799439011"
},
{
"_createdAt": 0,
"ipAddress": "203.0.113.0/24",
"description": "Office network",
"_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"_updatedAt": 6,
"_createdByMemberId": "507f1f77bcf86cd799439011"
}
],
"apiTokenAllowlistEnabled": false,
"_links": {
"self": {
"href": "href",
"type": "type"
}
},
"sessionAllowlistEnabled": true,
"totalCount": 42
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}Update IP Allowlist Configuration
Update sessionAllowlistEnabled and apiTokenAllowlistEnabled settings.
PATCH
/
api
/
v2
/
account
/
ip-allowlist
Update IP Allowlist Configuration
curl --request PATCH \
--url https://app.launchdarkly.com/api/v2/account/ip-allowlist \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"sessionAllowlistEnabled": true,
"apiTokenAllowlistEnabled": true
}
'import requests
url = "https://app.launchdarkly.com/api/v2/account/ip-allowlist"
payload = {
"sessionAllowlistEnabled": True,
"apiTokenAllowlistEnabled": True
}
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({sessionAllowlistEnabled: true, apiTokenAllowlistEnabled: true})
};
fetch('https://app.launchdarkly.com/api/v2/account/ip-allowlist', 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/account/ip-allowlist",
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([
'sessionAllowlistEnabled' => true,
'apiTokenAllowlistEnabled' => true
]),
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/account/ip-allowlist"
payload := strings.NewReader("{\n \"sessionAllowlistEnabled\": true,\n \"apiTokenAllowlistEnabled\": true\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/account/ip-allowlist")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sessionAllowlistEnabled\": true,\n \"apiTokenAllowlistEnabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/account/ip-allowlist")
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 \"sessionAllowlistEnabled\": true,\n \"apiTokenAllowlistEnabled\": true\n}"
response = http.request(request)
puts response.read_body{
"entries": [
{
"_createdAt": 0,
"ipAddress": "203.0.113.0/24",
"description": "Office network",
"_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"_updatedAt": 6,
"_createdByMemberId": "507f1f77bcf86cd799439011"
},
{
"_createdAt": 0,
"ipAddress": "203.0.113.0/24",
"description": "Office network",
"_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"_updatedAt": 6,
"_createdByMemberId": "507f1f77bcf86cd799439011"
}
],
"apiTokenAllowlistEnabled": false,
"_links": {
"self": {
"href": "href",
"type": "type"
}
},
"sessionAllowlistEnabled": true,
"totalCount": 42
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}Authorizations
Body
application/json
Response
Updated IP allowlist configuration and entries
Example:
true
Example:
false
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Example:
{
"self": { "href": "href", "type": "type" }
}
The total number of entries matching the query, before pagination.
Example:
42