Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

IpRecord Resource


The IpRecord resource describe Static IP addresses used to address the BYOC Trunk's Termination SIP Domain via an IP Address instead of an FQDN (Fully Qualified Domain Name).

(warning)

Warning

The IP Address used in this resource must be a subset of a Twilio Interconnect connection configured on the same Account.


IpRecord Properties

Property nameTypePIIDescription
account_sidSID<AC>
Not PII

The SID of the Account that created the IP Record resource.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

sidSID<IL>

The unique string that we created to identify the IP Record resource.

Pattern: ^IL[0-9a-fA-F]{32}$Min length: 34Max length: 34

friendly_namestring

The string that you assigned to describe the resource.


ip_addressstring
PII MTL: 30 days

An IP address in dotted decimal notation, IPv4 only.


cidr_prefix_lengthinteger

An integer representing the length of the CIDR prefix to use with this IP address. By default the entire IP address is used, which for IPv4 is value 32.


date_createdstring<date-time>

The date and time in GMT that the resource was created specified in RFC 2822 format.


date_updatedstring<date-time>

The date and time in GMT that the resource was last updated specified in RFC 2822 format.


urlstring<uri>

The absolute URL of the resource.


Create an IpRecord resource

POST https://voice.twilio.com/v1/IpRecords

Request body parameters

Property nameTypeRequiredPIIDescription
IpAddressstringrequired

An IP address in dotted decimal notation, IPv4 only.


FriendlyNamestringOptional

A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.


CidrPrefixLengthintegerOptional

An integer representing the length of the CIDR prefix to use with this IP address. By default the entire IP address is used, which for IPv4 is value 32.

Create an IpRecord

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function createIpRecord() {
_18
const ipRecord = await client.voice.v1.ipRecords.create({
_18
ipAddress: "IpAddress",
_18
});
_18
_18
console.log(ipRecord.accountSid);
_18
}
_18
_18
createIpRecord();

Output

_10
{
_10
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"sid": "ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"friendly_name": "friendly_name",
_10
"ip_address": "IpAddress",
_10
"cidr_prefix_length": 30,
_10
"date_created": "2020-03-18T23:31:36Z",
_10
"date_updated": "2020-03-18T23:31:36Z",
_10
"url": "https://voice.twilio.com/v1/IpRecords/ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_10
}


Fetch an IpRecord resource

GET https://voice.twilio.com/v1/IpRecords/{Sid}

Path parameters

Property nameTypeRequiredPIIDescription
SidSID<IL>required

The Twilio-provided string that uniquely identifies the IP Record resource to fetch.

Pattern: ^IL[0-9a-fA-F]{32}$Min length: 34Max length: 34

Fetch an IpRecord

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function fetchIpRecord() {
_18
const ipRecord = await client.voice.v1
_18
.ipRecords("ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18
.fetch();
_18
_18
console.log(ipRecord.accountSid);
_18
}
_18
_18
fetchIpRecord();

Output

_10
{
_10
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"sid": "ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"friendly_name": "friendly_name",
_10
"ip_address": "10.2.3.4",
_10
"cidr_prefix_length": 30,
_10
"date_created": "2020-03-18T23:31:36Z",
_10
"date_updated": "2020-03-18T23:31:37Z",
_10
"url": "https://voice.twilio.com/v1/IpRecords/ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_10
}


Read multiple IpRecord resources

GET https://voice.twilio.com/v1/IpRecords

Query parameters

Property nameTypeRequiredPIIDescription
PageSizeintegerOptional

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum: 1Maximum: 1000

PageintegerOptional

The page index. This value is simply for client state.

Minimum: 0

PageTokenstringOptional

The page token. This is provided by the API.

List multiple IpRecords

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_16
// Download the helper library from https://www.twilio.com/docs/node/install
_16
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_16
_16
// Find your Account SID and Auth Token at twilio.com/console
_16
// and set the environment variables. See http://twil.io/secure
_16
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_16
const authToken = process.env.TWILIO_AUTH_TOKEN;
_16
const client = twilio(accountSid, authToken);
_16
_16
async function listIpRecord() {
_16
const ipRecords = await client.voice.v1.ipRecords.list({ limit: 20 });
_16
_16
ipRecords.forEach((i) => console.log(i.accountSid));
_16
}
_16
_16
listIpRecord();

Output

_23
{
_23
"meta": {
_23
"page": 0,
_23
"page_size": 50,
_23
"first_page_url": "https://voice.twilio.com/v1/IpRecords?PageSize=50&Page=0",
_23
"previous_page_url": null,
_23
"url": "https://voice.twilio.com/v1/IpRecords?PageSize=50&Page=0",
_23
"next_page_url": null,
_23
"key": "ip_records"
_23
},
_23
"ip_records": [
_23
{
_23
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_23
"sid": "ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_23
"friendly_name": "friendly_name",
_23
"ip_address": "10.2.3.4",
_23
"cidr_prefix_length": 30,
_23
"date_created": "2020-03-18T23:31:36Z",
_23
"date_updated": "2020-03-18T23:31:37Z",
_23
"url": "https://voice.twilio.com/v1/IpRecords/ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_23
}
_23
]
_23
}


Update an IpRecord resource

POST https://voice.twilio.com/v1/IpRecords/{Sid}

Path parameters

Property nameTypeRequiredPIIDescription
SidSID<IL>required

The Twilio-provided string that uniquely identifies the IP Record resource to update.

Pattern: ^IL[0-9a-fA-F]{32}$Min length: 34Max length: 34

Request body parameters

Property nameTypeRequiredPIIDescription
FriendlyNamestringOptional

A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.

Update an IpRecord

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function updateIpRecord() {
_18
const ipRecord = await client.voice.v1
_18
.ipRecords("ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18
.update({ friendlyName: "FriendlyName" });
_18
_18
console.log(ipRecord.accountSid);
_18
}
_18
_18
updateIpRecord();

Output

_10
{
_10
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"sid": "ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"friendly_name": "FriendlyName",
_10
"ip_address": "10.2.3.4",
_10
"cidr_prefix_length": 30,
_10
"date_created": "2020-03-18T23:31:36Z",
_10
"date_updated": "2020-03-18T23:31:37Z",
_10
"url": "https://voice.twilio.com/v1/IpRecords/ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_10
}


Delete an IpRecord resource

DELETE https://voice.twilio.com/v1/IpRecords/{Sid}

Path parameters

Property nameTypeRequiredPIIDescription
SidSID<IL>required

The Twilio-provided string that uniquely identifies the IP Record resource to delete.

Pattern: ^IL[0-9a-fA-F]{32}$Min length: 34Max length: 34

Delete an IpRecord

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_16
// Download the helper library from https://www.twilio.com/docs/node/install
_16
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_16
_16
// Find your Account SID and Auth Token at twilio.com/console
_16
// and set the environment variables. See http://twil.io/secure
_16
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_16
const authToken = process.env.TWILIO_AUTH_TOKEN;
_16
const client = twilio(accountSid, authToken);
_16
_16
async function deleteIpRecord() {
_16
await client.voice.v1
_16
.ipRecords("ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_16
.remove();
_16
}
_16
_16
deleteIpRecord();


Rate this page: