Line Type Override
Make a Line Type Override request to manually update the type
for a specific phone number when the Line Type Intelligence response is incomplete or inaccurate. This ensures incorrect detection doesn't affect your workflows.
Info
You can only update the type
value under the line_type_intelligence
data structure. The Line Type Override request doesn't support overrides for other fields or data types.
- Overrides persist and apply to all future Lookup requests for the same phone number on your account.
- Overrides apply only to the region where you created them. For example, an override created in the
US1
region only applies toUS1
.
https://lookups.twilio.com/v2/PhoneNumbers/{PhoneNumber}/Overrides/line_type_intelligence
Path parameter | Type | Description |
---|---|---|
PhoneNumber | string | The E.164-formatted phone number to override (for example, +1419929960 ) |
Note: To ensure data privacy, Twilio doesn't support unencrypted HTTP.
POST https://lookups.twilio.com/v2/PhoneNumbers/{PhoneNumber}/Overrides/line_type_intelligence
1{2"line_type": "nonFixedVoip",3"reason": "Customer has provided evidence that this is a non-fixed VoIP number."4}
Name | Type | Required | Description |
---|---|---|---|
line_type | string | Yes | The new type value for the provided phone number. This parameter accepts mobile , landline , tollFree , fixedVoip , nonFixedVoip , personal , premium , voicemail , sharedCost , uan , pager , and unknown . |
reason | string | No | The reason for the override. |
Code | Description |
---|---|
201 | Override successfully created |
422 | Unprocessable entity, such as unsupported field or value |
404 | Phone number not found |
409 | Override already exists with the same value |
500 | Internal server error |
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 createLookupPhoneNumberOverrides() {11const lookupOverride = await client.lookups.v212.lookupOverrides("+14159929960", "line_type_intelligence")13.create();1415console.log(lookupOverride.phoneNumber);16}1718createLookupPhoneNumberOverrides();
1{2"original_line_type": "fixedVoip",3"overridden_line_type": "nonFixedVoip",4"override_reason": "Customer has provided evidence that this is a non-fixed VoIP number.",5"override_timestamp": "2025-05-29T20:11:43Z",6"phone_number": "+14159929960"7}
GET https://lookups.twilio.com/v2/PhoneNumbers/{PhoneNumber}/Overrides/line_type_intelligence
Code | Description |
---|---|
200 | Override successfully retrieved |
404 | Phone number not found |
500 | Internal server error |
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 fetchLookupPhoneNumberOverrides() {11const lookupOverride = await client.lookups.v212.lookupOverrides("+14159929960", "line_type_intelligence")13.fetch();1415console.log(lookupOverride.phoneNumber);16}1718fetchLookupPhoneNumberOverrides();
1{2"original_line_type": "fixedVoip",3"overridden_line_type": "nonFixedVoip",4"override_reason": "Customer has provided evidence that this is a non-fixed VoIP number.",5"override_timestamp": "2025-05-29T20:11:43Z",6"phone_number": "+14159929960"7}
PUT https://lookups.twilio.com/v2/PhoneNumbers/{PhoneNumber}/Overrides/line_type_intelligence
1{2"line_type": "mobile",3"reason": "Customer has provided evidence that this is a non-fixed VoIP number."4}
Name | Type | Required | Description |
---|---|---|---|
line_type | string | Yes | The new type value for the provided phone number. Supported values are mobile , landline , tollFree , fixedVoip , nonFixedVoip , personal , premium , voicemail , sharedCost , uan , pager , and unknown . |
reason | string | No | The reason for the override. |
Code | Description |
---|---|
200 | Override successfully updated |
404 | Phone number not found |
500 | Internal server error |
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 updateLookupPhoneNumberOverrides() {11const lookupOverride = await client.lookups.v212.lookupOverrides("+14159929960", "line_type_intelligence")13.update({14line_type: "mobile",15});1617console.log(lookupOverride.phoneNumber);18}1920updateLookupPhoneNumberOverrides();
1{2"original_line_type": "fixedVoip",3"overridden_line_type": "mobile",4"override_reason": "Customer has provided evidence that this is a mobile number.",5"override_timestamp": "2025-07-04T20:30:00Z",6"phone_number": "+14159929960"7}
DELETE https://lookups.twilio.com/v2/PhoneNumbers/{PhoneNumber}/Overrides/line_type_intelligence
Code | Description |
---|---|
204 | Override removed |
404 | Override not found |
500 | Internal server error |
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 deleteLookupPhoneNumberOverrides() {11await client.lookups.v212.lookupOverrides("+14159929960", "line_type_intelligence")13.remove();14}1516deleteLookupPhoneNumberOverrides();
To test if an override has been applied to a phone number, make a Line Type Intelligence request.
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 fetchPhoneNumber() {11const phoneNumber = await client.lookups.v212.phoneNumbers("+14159929960")13.fetch({ fields: "line_type_intelligence" });1415console.log(phoneNumber.lineTypeIntelligence);16}1718fetchPhoneNumber();
1{2"calling_country_code": "1",3"country_code": "US",4"phone_number": "+14159929960",5"national_format": "(415) 992-9960",6"valid": true,7"validation_errors": null,8"caller_name": null,9"sim_swap": null,10"call_forwarding": null,11"line_status": null,12"line_type_intelligence": {13"error_code": null,14"mobile_country_code": "240",15"mobile_network_code": "38",16"carrier_name": "Twilio - SMS/MMS-SVR",17"type": "mobile"18},19"identity_match": null,20"reassigned_number": null,21"sms_pumping_risk": null,22"phone_number_quality_score": null,23"pre_fill": null,24"url": "https://lookups.twilio.com/v2/PhoneNumbers/+14159929960"25}