# Line Type Override

Make a Line Type Override request to manually update the `type` for a specific phone number when the [Line Type Intelligence](/docs/lookup/v2-api/line-type-intelligence) response is incomplete or inaccurate. This ensures incorrect detection doesn't affect your workflows.

> \[!NOTE]
>
> 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

* 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`.

## Base URL

```bash
https://lookups.twilio.com/v2/PhoneNumbers/{PhoneNumber}/Overrides/line_type_intelligence
```

| Path parameter | Type   | Description                                                                                           |
| -------------- | ------ | ----------------------------------------------------------------------------------------------------- |
| `PhoneNumber`  | string | The [E.164](/docs/glossary/what-e164)-formatted phone number to override (for example, `+1419929960`) |

**Note**: To ensure data privacy, Twilio doesn't support unencrypted HTTP.

## Create an override

`POST https://lookups.twilio.com/v2/PhoneNumbers/{PhoneNumber}/Overrides/line_type_intelligence`

### Request body parameters

```json
{
  "line_type": "nonFixedVoip",
  "reason": "Customer has provided evidence that this is a non-fixed VoIP number."
}
```

| 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.                                                                                                                                                                                               |

### Response codes

| 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                                    |

### Code examples and response

Create an override

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function createLookupPhoneNumberOverrides() {
  const lookupOverride = await client.lookups.v2
    .lookupOverrides("+14159929960", "line_type_intelligence")
    .create();

  console.log(lookupOverride.phoneNumber);
}

createLookupPhoneNumberOverrides();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client
from twilio.rest.lookups.v2 import LookupPhoneNumberOverridesList

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

lookup_override = client.lookups.v2.lookup_overrides(
    "+14159929960", "line_type_intelligence"
).create()

print(lookup_override.phone_number)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Lookups.V2;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var lookupOverride = await LookupOverrideResource.CreateAsync(
            pathField: "line_type_intelligence", pathPhoneNumber: "+14159929960");

        Console.WriteLine(lookupOverride.PhoneNumber);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.lookups.v2.LookupOverride;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        LookupOverride lookupOverride = LookupOverride.creator("line_type_intelligence", "+14159929960").create();

        System.out.println(lookupOverride.getPhoneNumber());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	lookups "github.com/twilio/twilio-go/rest/lookups/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &lookups.CreateLookupPhoneNumberOverridesParams{}

	resp, err := client.LookupsV2.CreateLookupPhoneNumberOverrides("line_type_intelligence",
		"+14159929960",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		fmt.Println(resp.PhoneNumber)
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;
use Twilio\Rest\Lookups\V2\LookupPhoneNumberOverridesModels;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$lookup_override = $twilio->lookups->v2
    ->lookupOverrides("+14159929960", "line_type_intelligence")
    ->create();

print $lookup_override->phoneNumber;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

lookup_override = @client
                  .lookups
                  .v2
                  .lookup_overrides('+14159929960', 'line_type_intelligence')
                  .create

puts lookup_override.phone_number
```

```bash
# This endpoint is not currently supported by the Twilio CLI. You can open an issue to request it on https://github.com/twilio/twilio-cli/issues
  # For an alternative low-code solution, check out https://www.twilio.com/docs/openapi/using-twilio-postman-collections
```

```bash
curl -X POST "https://lookups.twilio.com/v2/PhoneNumbers/%2B14159929960/Overrides/line_type_intelligence" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "original_line_type": "fixedVoip",
  "overridden_line_type": "nonFixedVoip",
  "override_reason": "Customer has provided evidence that this is a non-fixed VoIP number.",
  "override_timestamp": "2025-05-29T20:11:43Z",
  "phone_number": "+14159929960"
}
```

## Retrieve an override

`GET https://lookups.twilio.com/v2/PhoneNumbers/{PhoneNumber}/Overrides/line_type_intelligence`

### Response code

| Code  | Description                     |
| ----- | ------------------------------- |
| `200` | Override successfully retrieved |
| `404` | Phone number not found          |
| `500` | Internal server error           |

### Code examples and response

Retrieve an override

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function fetchLookupPhoneNumberOverrides() {
  const lookupOverride = await client.lookups.v2
    .lookupOverrides("+14159929960", "line_type_intelligence")
    .fetch();

  console.log(lookupOverride.phoneNumber);
}

fetchLookupPhoneNumberOverrides();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

lookup_override = client.lookups.v2.lookup_overrides(
    "+14159929960", "line_type_intelligence"
).fetch()

print(lookup_override.phone_number)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Lookups.V2;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var lookupOverride = await LookupOverrideResource.FetchAsync(
            pathField: "line_type_intelligence", pathPhoneNumber: "+14159929960");

        Console.WriteLine(lookupOverride.PhoneNumber);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.lookups.v2.LookupOverride;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        LookupOverride lookupOverride = LookupOverride.fetcher("line_type_intelligence", "+14159929960").fetch();

        System.out.println(lookupOverride.getPhoneNumber());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	resp, err := client.LookupsV2.FetchLookupPhoneNumberOverrides("line_type_intelligence",
		"+14159929960")
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		fmt.Println(resp.PhoneNumber)
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$lookup_override = $twilio->lookups->v2
    ->lookupOverrides("+14159929960", "line_type_intelligence")
    ->fetch();

print $lookup_override->phoneNumber;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

lookup_override = @client
                  .lookups
                  .v2
                  .lookup_overrides('+14159929960', 'line_type_intelligence')
                  .fetch

puts lookup_override.phone_number
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:lookups:v2:phone-numbers:overrides:list \
   --field line_type_intelligence \
   --phone-number +14159929960
```

```bash
curl -X GET "https://lookups.twilio.com/v2/PhoneNumbers/%2B14159929960/Overrides/line_type_intelligence" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "original_line_type": "fixedVoip",
  "overridden_line_type": "nonFixedVoip",
  "override_reason": "Customer has provided evidence that this is a non-fixed VoIP number.",
  "override_timestamp": "2025-05-29T20:11:43Z",
  "phone_number": "+14159929960"
}
```

## Update an override

`PUT https://lookups.twilio.com/v2/PhoneNumbers/{PhoneNumber}/Overrides/line_type_intelligence`

### Request body parameters

```json
{
  "line_type": "mobile",
  "reason": "Customer has provided evidence that this is a mobile number."
}
```

| 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.                                                                                                                                                                                             |

### Response codes

| Code  | Description                   |
| ----- | ----------------------------- |
| `200` | Override successfully updated |
| `404` | Phone number not found        |
| `500` | Internal server error         |

### Code examples and response

Update an override

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function updateLookupPhoneNumberOverrides() {
  const lookupOverride = await client.lookups.v2
    .lookupOverrides("+14159929960", "line_type_intelligence")
    .update({
      line_type: "mobile",
    });

  console.log(lookupOverride.phoneNumber);
}

updateLookupPhoneNumberOverrides();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client
from twilio.rest.lookups.v2 import LookupPhoneNumberOverridesList

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

lookup_phone_number_overrides = client.lookups.v2.lookup_overrides(
    "+14159929960", "line_type_intelligence"
).update(
    overrides_request=LookupPhoneNumberOverridesList.OverridesRequest(
        {"line_type": "mobile"}
    )
)

print(lookup_phone_number_overrides.phone_number)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Lookups.V2;
using System.Threading.Tasks;
using System.Collections.Generic;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var lookupOverride = await LookupOverrideResource.UpdateAsync(
            overridesRequest: new LookupOverrideResource.OverridesRequest.Builder()
                .WithLineType("mobile")
                .Build(),
            pathField: "line_type_intelligence",
            pathPhoneNumber: "+14159929960");

        Console.WriteLine(lookupOverride.PhoneNumber);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import java.util.Arrays;
import java.util.HashMap;
import com.twilio.Twilio;
import com.twilio.rest.lookups.v2.LookupOverride;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

        LookupOverride.OverridesRequest overridesRequest = new LookupOverride.OverridesRequest();
        overridesRequest.setLineType("mobile");

        LookupOverride lookupOverride =
            LookupOverride.updater("line_type_intelligence", "+14159929960", overridesRequest).update();

        System.out.println(lookupOverride.getPhoneNumber());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	lookups "github.com/twilio/twilio-go/rest/lookups/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &lookups.UpdateLookupPhoneNumberOverridesParams{}
	params.SetOverridesRequest(lookups.OverridesRequest{
		LineType: "mobile",
	})

	resp, err := client.LookupsV2.UpdateLookupPhoneNumberOverrides("line_type_intelligence",
		"+14159929960",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		fmt.Println(resp.PhoneNumber)
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;
use Twilio\Rest\Lookups\V2\LookupPhoneNumberOverridesModels;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$lookup_phone_number_overrides = $twilio->lookups->v2
    ->lookupOverrides("+14159929960", "line_type_intelligence")
    ->update(
        LookupPhoneNumberOverridesModels::createOverridesRequest([
            "lineType" => "mobile",
        ])
    );

print $lookup_phone_number_overrides->phoneNumber;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

lookup_override = @client
                  .lookups
                  .v2
                  .lookup_overrides('+14159929960', 'line_type_intelligence')
                  .update(
                    overrides_request: {
                      'line_type' => 'mobile'
                    }
                  )

puts lookup_override.phone_number
```

```bash
# This endpoint is not currently supported by the Twilio CLI. You can open an issue to request it on https://github.com/twilio/twilio-cli/issues
  # For an alternative low-code solution, check out https://www.twilio.com/docs/openapi/using-twilio-postman-collections
```

```bash
OVERRIDES_REQUEST_OBJ=$(cat << EOF
{
  "line_type": "mobile"
}
EOF
)
curl -X PUT "https://lookups.twilio.com/v2/PhoneNumbers/%2B14159929960/Overrides/line_type_intelligence" \
--json "$OVERRIDES_REQUEST_OBJ" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "original_line_type": "fixedVoip",
  "overridden_line_type": "mobile",
  "override_reason": "",
  "override_timestamp": "2025-07-04T20:30:00Z",
  "phone_number": "+14159929960"
}
```

## Delete an override

`DELETE https://lookups.twilio.com/v2/PhoneNumbers/{PhoneNumber}/Overrides/line_type_intelligence`

### Response code

| Code  | Description           |
| ----- | --------------------- |
| `204` | Override removed      |
| `404` | Override not found    |
| `500` | Internal server error |

### Code examples

Delete an override

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function deleteLookupPhoneNumberOverrides() {
  await client.lookups.v2
    .lookupOverrides("+14159929960", "line_type_intelligence")
    .remove();
}

deleteLookupPhoneNumberOverrides();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

client.lookups.v2.lookup_overrides(
    "+14159929960", "line_type_intelligence"
).delete()
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Lookups.V2;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        await LookupOverrideResource.DeleteAsync(
            pathField: "line_type_intelligence", pathPhoneNumber: "+14159929960");
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.lookups.v2.LookupOverride;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        LookupOverride.deleter("line_type_intelligence", "+14159929960").delete();
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	err := client.LookupsV2.DeleteLookupPhoneNumberOverrides("line_type_intelligence",
		"+14159929960")
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$twilio->lookups->v2
    ->lookupOverrides("+14159929960", "line_type_intelligence")
    ->delete();
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

@client
  .lookups
  .v2
  .lookup_overrides('+14159929960', 'line_type_intelligence')
  .delete
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:lookups:v2:phone-numbers:overrides:remove \
   --field line_type_intelligence \
   --phone-number +14159929960
```

```bash
curl -X DELETE "https://lookups.twilio.com/v2/PhoneNumbers/%2B14159929960/Overrides/line_type_intelligence" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

## Test an override

To test if an override has been applied to a phone number, [make a Line Type Intelligence request](/docs/lookup/v2-api/line-type-intelligence#run-line-type-intelligence).

Run Line Type Intelligence

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function fetchPhoneNumber() {
  const phoneNumber = await client.lookups.v2
    .phoneNumbers("+14159929960")
    .fetch({ fields: "line_type_intelligence" });

  console.log(phoneNumber.lineTypeIntelligence);
}

fetchPhoneNumber();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

phone_number = client.lookups.v2.phone_numbers("+14159929960").fetch(
    fields="line_type_intelligence"
)

print(phone_number.line_type_intelligence)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Lookups.V2;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var phoneNumber = await PhoneNumberResource.FetchAsync(
            pathPhoneNumber: "+14159929960", fields: "line_type_intelligence");

        Console.WriteLine(phoneNumber._LineTypeIntelligence);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.lookups.v2.PhoneNumber;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        PhoneNumber phoneNumber = PhoneNumber.fetcher("+14159929960").setFields("line_type_intelligence").fetch();

        System.out.println(phoneNumber.getLineTypeIntelligence());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	lookups "github.com/twilio/twilio-go/rest/lookups/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &lookups.FetchPhoneNumberParams{}
	params.SetFields("line_type_intelligence")

	resp, err := client.LookupsV2.FetchPhoneNumber("+14159929960",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.LineTypeIntelligence != (lookups.LineTypeIntelligenceInfo{}) {
			fmt.Println(resp.LineTypeIntelligence)
		} else {
			fmt.Println(resp.LineTypeIntelligence)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$phone_number = $twilio->lookups->v2
    ->phoneNumbers("+14159929960")
    ->fetch(["fields" => "line_type_intelligence"]);

print $phone_number->lineTypeIntelligence;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

phone_number = @client
               .lookups
               .v2
               .phone_numbers('+14159929960')
               .fetch(fields: 'line_type_intelligence')

puts phone_number.line_type_intelligence
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:lookups:v2:phone-numbers:fetch \
   --phone-number +14159929960 \
   --fields line_type_intelligence
```

```bash
curl -X GET "https://lookups.twilio.com/v2/PhoneNumbers/%2B14159929960?Fields=line_type_intelligence" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "calling_country_code": "1",
  "country_code": "US",
  "phone_number": "+14159929960",
  "national_format": "(415) 992-9960",
  "valid": true,
  "validation_errors": null,
  "caller_name": null,
  "sim_swap": null,
  "call_forwarding": null,
  "line_status": null,
  "line_type_intelligence": {
    "error_code": null,
    "mobile_country_code": "240",
    "mobile_network_code": "38",
    "carrier_name": "Twilio - SMS/MMS-SVR",
    "type": "mobile"
  },
  "identity_match": null,
  "reassigned_number": null,
  "sms_pumping_risk": null,
  "phone_number_quality_score": null,
  "pre_fill": null,
  "url": "https://lookups.twilio.com/v2/PhoneNumbers/+14159929960"
}
```
