Skip to contentSkip to navigationSkip to topbar
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 nameTypeRequiredDescriptionChild properties
account_sidSID<AC>

Optional

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>

Optional

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

Optional

The string that you assigned to describe the resource.


ip_addressstring

Optional

PII MTL: 30 days

An IP address in dotted decimal notation, IPv4 only.


cidr_prefix_lengthinteger

Optional

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.

Default: 0

date_createdstring<date-time>

Optional

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>

Optional

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>

Optional

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
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
IpAddressstringrequired

An IP address in dotted decimal notation, IPv4 only.


FriendlyNamestring

Optional

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


CidrPrefixLengthinteger

Optional

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 IpRecordLink to code sample: Create an IpRecord
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createIpRecord() {
11
const ipRecord = await client.voice.v1.ipRecords.create({
12
ipAddress: "IpAddress",
13
});
14
15
console.log(ipRecord.accountSid);
16
}
17
18
createIpRecord();

Output

1
{
2
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"sid": "ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"friendly_name": "friendly_name",
5
"ip_address": "IpAddress",
6
"cidr_prefix_length": 30,
7
"date_created": "2020-03-18T23:31:36Z",
8
"date_updated": "2020-03-18T23:31:36Z",
9
"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
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchIpRecord() {
11
const ipRecord = await client.voice.v1
12
.ipRecords("ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.fetch();
14
15
console.log(ipRecord.accountSid);
16
}
17
18
fetchIpRecord();

Output

1
{
2
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"sid": "ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"friendly_name": "friendly_name",
5
"ip_address": "10.2.3.4",
6
"cidr_prefix_length": 30,
7
"date_created": "2020-03-18T23:31:36Z",
8
"date_updated": "2020-03-18T23:31:37Z",
9
"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
PageSizeinteger

Optional

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

Minimum: 1Maximum: 1000

Pageinteger

Optional

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

Minimum: 0

PageTokenstring

Optional

The page token. This is provided by the API.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listIpRecord() {
11
const ipRecords = await client.voice.v1.ipRecords.list({ limit: 20 });
12
13
ipRecords.forEach((i) => console.log(i.accountSid));
14
}
15
16
listIpRecord();

Output

1
{
2
"meta": {
3
"page": 0,
4
"page_size": 50,
5
"first_page_url": "https://voice.twilio.com/v1/IpRecords?PageSize=50&Page=0",
6
"previous_page_url": null,
7
"url": "https://voice.twilio.com/v1/IpRecords?PageSize=50&Page=0",
8
"next_page_url": null,
9
"key": "ip_records"
10
},
11
"ip_records": [
12
{
13
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
14
"sid": "ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
15
"friendly_name": "friendly_name",
16
"ip_address": "10.2.3.4",
17
"cidr_prefix_length": 30,
18
"date_created": "2020-03-18T23:31:36Z",
19
"date_updated": "2020-03-18T23:31:37Z",
20
"url": "https://voice.twilio.com/v1/IpRecords/ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
21
}
22
]
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
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
FriendlyNamestring

Optional

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

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function updateIpRecord() {
11
const ipRecord = await client.voice.v1
12
.ipRecords("ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.update({ friendlyName: "FriendlyName" });
14
15
console.log(ipRecord.accountSid);
16
}
17
18
updateIpRecord();

Output

1
{
2
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"sid": "ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"friendly_name": "FriendlyName",
5
"ip_address": "10.2.3.4",
6
"cidr_prefix_length": 30,
7
"date_created": "2020-03-18T23:31:36Z",
8
"date_updated": "2020-03-18T23:31:37Z",
9
"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
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function deleteIpRecord() {
11
await client.voice.v1
12
.ipRecords("ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.remove();
14
}
15
16
deleteIpRecord();

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.