Skip to contentSkip to navigationSkip to topbar
On this page

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.

(information)

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.


Override behavior

override-behavior page anchor
  • 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 to US1.

https://lookups.twilio.com/v2/PhoneNumbers/{PhoneNumber}/Overrides/line_type_intelligence
Path parameterTypeDescription
PhoneNumberstringThe 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

Request body parameters

request-body-parameters page anchor
1
{
2
"line_type": "nonFixedVoip",
3
"reason": "Customer has provided evidence that this is a non-fixed VoIP number."
4
}
NameTypeRequiredDescription
line_typestringYesThe new type value for the provided phone number. This parameter accepts mobile, landline, tollFree, fixedVoip, nonFixedVoip, personal, premium, voicemail, sharedCost, uan, pager, and unknown.
reasonstringNoThe reason for the override.
CodeDescription
201Override successfully created
422Unprocessable entity, such as unsupported field or value
404Phone number not found
409Override already exists with the same value
500Internal server error

Code examples and response

code-examples-and-response page anchor
Create an overrideLink to code sample: Create an override
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 createLookupPhoneNumberOverrides() {
11
const lookupOverride = await client.lookups.v2
12
.lookupOverrides("+14159929960", "line_type_intelligence")
13
.create();
14
15
console.log(lookupOverride.phoneNumber);
16
}
17
18
createLookupPhoneNumberOverrides();
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

CodeDescription
200Override successfully retrieved
404Phone number not found
500Internal server error
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 fetchLookupPhoneNumberOverrides() {
11
const lookupOverride = await client.lookups.v2
12
.lookupOverrides("+14159929960", "line_type_intelligence")
13
.fetch();
14
15
console.log(lookupOverride.phoneNumber);
16
}
17
18
fetchLookupPhoneNumberOverrides();
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
}
NameTypeRequiredDescription
line_typestringYesThe new type value for the provided phone number. Supported values are mobile, landline, tollFree, fixedVoip, nonFixedVoip, personal, premium, voicemail, sharedCost, uan, pager, and unknown.
reasonstringNoThe reason for the override.
CodeDescription
200Override successfully updated
404Phone number not found
500Internal server error
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 updateLookupPhoneNumberOverrides() {
11
const lookupOverride = await client.lookups.v2
12
.lookupOverrides("+14159929960", "line_type_intelligence")
13
.update({
14
line_type: "mobile",
15
});
16
17
console.log(lookupOverride.phoneNumber);
18
}
19
20
updateLookupPhoneNumberOverrides();
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

CodeDescription
204Override removed
404Override not found
500Internal server error
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 deleteLookupPhoneNumberOverrides() {
11
await client.lookups.v2
12
.lookupOverrides("+14159929960", "line_type_intelligence")
13
.remove();
14
}
15
16
deleteLookupPhoneNumberOverrides();

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/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 fetchPhoneNumber() {
11
const phoneNumber = await client.lookups.v2
12
.phoneNumbers("+14159929960")
13
.fetch({ fields: "line_type_intelligence" });
14
15
console.log(phoneNumber.lineTypeIntelligence);
16
}
17
18
fetchPhoneNumber();
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
}