Create an IP pool
Create an account-scoped pool of dedicated IPs. Set is_default or domain_id for the pool to carry mail; a pool with neither carries none.
curl --request POST \
--url https://api.telnyx.com/v2/email/ip_pools \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "primary-pool",
"is_default": true
}
'import requests
url = "https://api.telnyx.com/v2/email/ip_pools"
payload = {
"name": "primary-pool",
"is_default": True
}
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({name: 'primary-pool', is_default: true})
};
fetch('https://api.telnyx.com/v2/email/ip_pools', 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.telnyx.com/v2/email/ip_pools",
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' => 'primary-pool',
'is_default' => true
]),
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.telnyx.com/v2/email/ip_pools"
payload := strings.NewReader("{\n \"name\": \"primary-pool\",\n \"is_default\": true\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.telnyx.com/v2/email/ip_pools")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"primary-pool\",\n \"is_default\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telnyx.com/v2/email/ip_pools")
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 \"name\": \"primary-pool\",\n \"is_default\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "9b1c4d70-abcd-4e5f-8a9b-0c1d2e3f4a5b",
"record_type": "ip_pool",
"name": "primary-pool",
"is_default": true,
"domain_id": null,
"ips": [],
"created_at": "2026-09-30T02:03:09.474123Z",
"updated_at": "2026-09-30T02:03:09.474123Z"
}
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
}
}
]
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
}
}
]
}{
"errors": [
{
"code": "10001",
"title": "Not Found",
"detail": "The requested email domain was not found"
}
]
}{
"errors": [
{
"code": "10015",
"title": "Validation Failed",
"detail": "already has a default pool",
"source": {
"pointer": "/data/attributes/account_id"
}
}
]
}Authorizations
Telnyx API key supplied as Authorization: Bearer <token>. In production, auth may be validated by the API gateway and forwarded via Telnyx auth headers.
Body
Pool name: 1-64 characters of lowercase letters, digits, ., _, and -, starting and ending with a letter or digit. Must be unique within the account and must not start with dip_.
Make this the account's default pool, which carries mail for sending domains without a domain-scoped pool. An account can have one default pool. Defaults to false.
Scope the pool to one of the account's email domains; the pool then carries that domain's mail. Scope at most one pool to each domain.
Response
Created IP pool
An account-scoped pool of dedicated IPs. Mail uses a pool only when the pool is scoped to the sending domain (domain_id) or is the account default (is_default).
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://api.telnyx.com/v2/email/ip_pools \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "primary-pool",
"is_default": true
}
'import requests
url = "https://api.telnyx.com/v2/email/ip_pools"
payload = {
"name": "primary-pool",
"is_default": True
}
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({name: 'primary-pool', is_default: true})
};
fetch('https://api.telnyx.com/v2/email/ip_pools', 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.telnyx.com/v2/email/ip_pools",
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' => 'primary-pool',
'is_default' => true
]),
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.telnyx.com/v2/email/ip_pools"
payload := strings.NewReader("{\n \"name\": \"primary-pool\",\n \"is_default\": true\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.telnyx.com/v2/email/ip_pools")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"primary-pool\",\n \"is_default\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telnyx.com/v2/email/ip_pools")
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 \"name\": \"primary-pool\",\n \"is_default\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "9b1c4d70-abcd-4e5f-8a9b-0c1d2e3f4a5b",
"record_type": "ip_pool",
"name": "primary-pool",
"is_default": true,
"domain_id": null,
"ips": [],
"created_at": "2026-09-30T02:03:09.474123Z",
"updated_at": "2026-09-30T02:03:09.474123Z"
}
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
}
}
]
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
}
}
]
}{
"errors": [
{
"code": "10001",
"title": "Not Found",
"detail": "The requested email domain was not found"
}
]
}{
"errors": [
{
"code": "10015",
"title": "Validation Failed",
"detail": "already has a default pool",
"source": {
"pointer": "/data/attributes/account_id"
}
}
]
}