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
The IP Address used in this resource must be a subset of a Twilio Interconnect connection configured on the same Account.
The SID of the Account that created the IP Record resource.
^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34The unique string that we created to identify the IP Record resource.
^IL[0-9a-fA-F]{32}$Min length: 34Max length: 34An 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.
0The date and time in GMT that the resource was created specified in RFC 2822 format.
The date and time in GMT that the resource was last updated specified in RFC 2822 format.
The absolute URL of the resource.
POST https://voice.twilio.com/v1/IpRecords
application/x-www-form-urlencodedA 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/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createIpRecord() {11const ipRecord = await client.voice.v1.ipRecords.create({12ipAddress: "196.215.224.146",13});1415console.log(ipRecord.accountSid);16}1718createIpRecord();
Response
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"sid": "ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"friendly_name": "friendly_name",5"ip_address": "196.215.224.146",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}
GET https://voice.twilio.com/v1/IpRecords/{Sid}
The Twilio-provided string that uniquely identifies the IP Record resource to fetch.
^IL[0-9a-fA-F]{32}$Min length: 34Max length: 341// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchIpRecord() {11const ipRecord = await client.voice.v112.ipRecords("ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.fetch();1415console.log(ipRecord.accountSid);16}1718fetchIpRecord();
Response
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}
GET https://voice.twilio.com/v1/IpRecords
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1Maximum: 1000The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listIpRecord() {11const ipRecords = await client.voice.v1.ipRecords.list({ limit: 20 });1213ipRecords.forEach((i) => console.log(i.accountSid));14}1516listIpRecord();
Response
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}
POST https://voice.twilio.com/v1/IpRecords/{Sid}
The Twilio-provided string that uniquely identifies the IP Record resource to update.
^IL[0-9a-fA-F]{32}$Min length: 34Max length: 34application/x-www-form-urlencodedA 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/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function updateIpRecord() {11const ipRecord = await client.voice.v112.ipRecords("ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.update({ friendlyName: "FriendlyName" });1415console.log(ipRecord.accountSid);16}1718updateIpRecord();
Response
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 https://voice.twilio.com/v1/IpRecords/{Sid}
The Twilio-provided string that uniquely identifies the IP Record resource to delete.
^IL[0-9a-fA-F]{32}$Min length: 34Max length: 341// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function deleteIpRecord() {11await client.voice.v112.ipRecords("ILaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.remove();14}1516deleteIpRecord();