curl --request POST \
--url https://api.astronomer.io/v1/organizations/{organizationId}/allowed-ip-address-ranges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ipAddressRange": "1.1.1.1/32"
}
'import requests
url = "https://api.astronomer.io/v1/organizations/{organizationId}/allowed-ip-address-ranges"
payload = { "ipAddressRange": "1.1.1.1/32" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ipAddressRange: '1.1.1.1/32'})
};
fetch('https://api.astronomer.io/v1/organizations/{organizationId}/allowed-ip-address-ranges', 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://api.astronomer.io/v1/organizations/{organizationId}/allowed-ip-address-ranges",
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([
'ipAddressRange' => '1.1.1.1/32'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.astronomer.io/v1/organizations/{organizationId}/allowed-ip-address-ranges"
payload := strings.NewReader("{\n \"ipAddressRange\": \"1.1.1.1/32\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.astronomer.io/v1/organizations/{organizationId}/allowed-ip-address-ranges")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ipAddressRange\": \"1.1.1.1/32\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/v1/organizations/{organizationId}/allowed-ip-address-ranges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ipAddressRange\": \"1.1.1.1/32\"\n}"
response = http.request(request)
puts response.read_body{
"createdAt": "2022-11-22T04:37:12Z",
"id": "clm9sq6s0000008kz7uvl7yz7",
"ipAddressRange": "1.1.1.1/32",
"organizationId": "clyt27999000008me3yp39wcp",
"updatedAt": "2022-11-22T04:37:12Z",
"createdBy": {
"id": "clm8qv74h000008mlf08scq7k",
"apiTokenName": "my-token",
"avatarUrl": "https://avatar.url",
"fullName": "Jane Doe",
"subjectType": "USER",
"username": "user1@company.com"
},
"updatedBy": {
"id": "clm8qv74h000008mlf08scq7k",
"apiTokenName": "my-token",
"avatarUrl": "https://avatar.url",
"fullName": "Jane Doe",
"subjectType": "USER",
"username": "user1@company.com"
}
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}Create an allowed IP address range
Create an allowed IP address range that constrains which IP addresses can be used to interact with your Astro Organization using APIs.
curl --request POST \
--url https://api.astronomer.io/v1/organizations/{organizationId}/allowed-ip-address-ranges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ipAddressRange": "1.1.1.1/32"
}
'import requests
url = "https://api.astronomer.io/v1/organizations/{organizationId}/allowed-ip-address-ranges"
payload = { "ipAddressRange": "1.1.1.1/32" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ipAddressRange: '1.1.1.1/32'})
};
fetch('https://api.astronomer.io/v1/organizations/{organizationId}/allowed-ip-address-ranges', 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://api.astronomer.io/v1/organizations/{organizationId}/allowed-ip-address-ranges",
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([
'ipAddressRange' => '1.1.1.1/32'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.astronomer.io/v1/organizations/{organizationId}/allowed-ip-address-ranges"
payload := strings.NewReader("{\n \"ipAddressRange\": \"1.1.1.1/32\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.astronomer.io/v1/organizations/{organizationId}/allowed-ip-address-ranges")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ipAddressRange\": \"1.1.1.1/32\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/v1/organizations/{organizationId}/allowed-ip-address-ranges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ipAddressRange\": \"1.1.1.1/32\"\n}"
response = http.request(request)
puts response.read_body{
"createdAt": "2022-11-22T04:37:12Z",
"id": "clm9sq6s0000008kz7uvl7yz7",
"ipAddressRange": "1.1.1.1/32",
"organizationId": "clyt27999000008me3yp39wcp",
"updatedAt": "2022-11-22T04:37:12Z",
"createdBy": {
"id": "clm8qv74h000008mlf08scq7k",
"apiTokenName": "my-token",
"avatarUrl": "https://avatar.url",
"fullName": "Jane Doe",
"subjectType": "USER",
"username": "user1@company.com"
},
"updatedBy": {
"id": "clm8qv74h000008mlf08scq7k",
"apiTokenName": "my-token",
"avatarUrl": "https://avatar.url",
"fullName": "Jane Doe",
"subjectType": "USER",
"username": "user1@company.com"
}
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the Organization where you want to create the allowed IP address range.
Body
The request body for creating an IP address range that allows access to the Astro API.
The allowed IP address range in CIDR format.
"1.1.1.1/32"
Response
OK
The time when the allowed IP address range was created in UTC, formatted as YYYY-MM-DDTHH:MM:SSZ.
"2022-11-22T04:37:12Z"
The allowed IP address range's ID.
"clm9sq6s0000008kz7uvl7yz7"
The allowed IP address range in CIDR format.
"1.1.1.1/32"
The allowed IP address range's Organization ID.
"clyt27999000008me3yp39wcp"
The time when the allowed IP address range was updated in UTC, formatted as YYYY-MM-DDTHH:MM:SSZ.
"2022-11-22T04:37:12Z"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?