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

iprecord-properties page anchor
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(link takes you to an external page) 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(link takes you to an external page) format.


date_updatedstring<date-time>

The date and time in GMT that the resource was last updated specified in RFC 2822(link takes you to an external page) format.


urlstring<uri>

The absolute URL of the resource.


Create an IpRecord resource

create-an-iprecord-resource page anchor
POST https://voice.twilio.com/v1/IpRecords

Request body parameters

request-body-parameters page anchor
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(link takes you to an external page) prefix to use with this IP address. By default the entire IP address is used, which for IPv4 is value 32.

Create an IpRecord

create-an-iprecord page anchor
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

fetch-an-iprecord-resource page anchor
GET https://voice.twilio.com/v1/IpRecords/{Sid}

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
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

read-multiple-iprecord-resources page anchor
GET https://voice.twilio.com/v1/IpRecords

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.

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

update-an-iprecord-resource page anchor
POST https://voice.twilio.com/v1/IpRecords/{Sid}

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
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.

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-an-iprecord-resource page anchor
DELETE https://voice.twilio.com/v1/IpRecords/{Sid}

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
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: