Inbound Phone Number Report Resource
Legal notice
Not a HIPAA Eligible Service
Voice Insights Reports API is not a HIPAA Eligible Service and should not be used in workflows that are subject to HIPAA.
An Inbound Phone Number Report aggregates Voice Insights metrics for calls received by a specific phone number handle.
application/jsonScore (0-100) representing how often inbound calls were answered.
Percentage of calls by call state (completed, fail, busy, no-answer, canceled).
Percentage of inbound calls with silence tags over total outbound calls. A silent tag is indicative of a connectivity issue or muted audio.
Info
A Voice Insights Report will be available for 5 days after it is created.
The unique SID identifier of the Account.
^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34The URL of this resource.
POST https://insights.twilio.com/v2/Voice/Reports/PhoneNumbers/Inbound
application/jsonThe recent 7 days report can be created without any parameters.
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 createInboundPhoneNumbersReport() {11const inbound = await client.insights.v2.inbound().create();1213console.log(inbound.accountSid);14}1516createInboundPhoneNumbersReport();
Response
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"report_id": "voiceinsights_report_01jmzm99cte5rrbbhv8bctd4av",4"status": "created",5"request_meta": {6"start_time": "2024-11-01T00:00:00Z",7"end_time": "2024-11-07T00:00:00Z",8"filters": []9},10"url": "https://insights.twilio.com/v2/Voice/Reports/PhoneNumbers/Inbound/voiceinsights_report_01jmzm99cte5rrbbhv8bctd4av"11}
Generate inbound reports for a specific period by providing the time_range parameter.
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 createInboundPhoneNumbersReport() {11const inbound = await client.insights.v2.inbound().create({12time_range: {13start_datetime: "2024-10-15T00:00:00Z",14end_datetime: "2024-11-07T00:00:00Z",15},16});1718console.log(inbound.accountSid);19}2021createInboundPhoneNumbersReport();
Response
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"report_id": "voiceinsights_report_01jmzm99cte5rrbbhv8bctd4av",4"status": "created",5"request_meta": {6"start_time": "2024-11-01T00:00:00Z",7"end_time": "2024-11-07T00:00:00Z",8"filters": []9},10"url": "https://insights.twilio.com/v2/Voice/Reports/PhoneNumbers/Inbound/voiceinsights_report_01jmzm99cte5rrbbhv8bctd4av"11}
Generate a specific number of outbound reports by providing the size parameter.
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 createInboundPhoneNumbersReport() {11const inbound = await client.insights.v2.inbound().create({12time_range: {13start_datetime: "2024-10-15T00:00:00Z",14end_datetime: "2024-11-07T00:00:00Z",15},16size: 100,17});1819console.log(inbound.accountSid);20}2122createInboundPhoneNumbersReport();
Response
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"report_id": "voiceinsights_report_01jmzm99cte5rrbbhv8bctd4av",4"status": "created",5"request_meta": {6"start_time": "2024-11-01T00:00:00Z",7"end_time": "2024-11-07T00:00:00Z",8"filters": []9},10"url": "https://insights.twilio.com/v2/Voice/Reports/PhoneNumbers/Inbound/voiceinsights_report_01jmzm99cte5rrbbhv8bctd4av"11}
GET https://insights.twilio.com/v2/Voice/Reports/PhoneNumbers/Inbound/{reportId}
A unique Report Id.
How many resources to return in each list page.
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 listInboundPhoneNumbersReport() {11const inbounds = await client.insights.v212.inbound("voiceinsights_report_01jmzm99cte5rrbbhv8bctd4av")13.list({ limit: 20 });1415inbounds.forEach((i) => console.log(i.handle));16}1718listInboundPhoneNumbersReport();
Response
1{2"meta": {3"page": 0,4"page_size": 50,5"first_page_url": "https://insights.twilio.com/v2/Voice/Reports/PhoneNumbers/Inbound/voiceinsights_report_01jmzm99cte5rrbbhv8bctd4av?PageSize=50&Page=0",6"previous_page_url": null,7"url": "https://insights.twilio.com/v2/Voice/Reports/PhoneNumbers/Inbound/voiceinsights_report_01jmzm99cte5rrbbhv8bctd4av?PageSize=50&Page=0",8"next_page_url": null,9"key": "reports"10},11"reports": []12}