# Voice Insights Settings Resource

**Voice Insights Settings** determine whether

* [Advanced Features](/docs/voice/voice-insights/advanced-features) and/or
* [Voice Trace](/docs/glossary/what-voice-trace)

are activated for a given account.

Using the **Voice Insights Settings Resource**, you can

* [get the Voice Insights Settings](#get-the-voice-insights-settings), or
* [update one or more the Voice Insights Settings](#update-voice-insights-settings)

for an account or a specific subaccount.

## Voice Insight Settings properties

```json
{"type":"object","refName":"insights.v1.account_settings","modelName":"insights_v1_account_settings","properties":{"account_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^AC[0-9a-fA-F]{32}$","nullable":true,"description":"The unique SID identifier of the Account."},"advanced_features":{"type":"boolean","nullable":true,"description":"A boolean flag indicating whether Advanced Features for Voice Insights are enabled."},"voice_trace":{"type":"boolean","nullable":true,"description":"A boolean flag indicating whether Voice Trace is enabled."},"url":{"type":"string","format":"uri","nullable":true,"description":"The URL of this resource."}}}
```

## Get the Voice Insights Settings

`GET https://insights.twilio.com/v1/Voice/Settings`

### Query parameters

```json
[{"name":"SubaccountSid","in":"query","description":"The unique SID identifier of the Subaccount.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^AC[0-9a-fA-F]{32}$"}}]
```

Get the Voice Insights Settings for the account

```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 fetchAccountSettings() {
  const setting = await client.insights.v1.settings().fetch();

  console.log(setting.accountSid);
}

fetchAccountSettings();
```

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

setting = client.insights.v1.settings().fetch()

print(setting.account_sid)
```

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

using System;
using Twilio;
using Twilio.Rest.Insights.V1;
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 setting = await SettingResource.FetchAsync();

        Console.WriteLine(setting.AccountSid);
    }
}
```

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

import com.twilio.Twilio;
import com.twilio.rest.insights.v1.Setting;

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);
        Setting setting = Setting.fetcher().fetch();

        System.out.println(setting.getAccountSid());
    }
}
```

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

import (
	"fmt"
	"github.com/twilio/twilio-go"
	insights "github.com/twilio/twilio-go/rest/insights/v1"
	"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 := &insights.FetchAccountSettingsParams{}

	resp, err := client.InsightsV1.FetchAccountSettings(params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.AccountSid != nil {
			fmt.Println(*resp.AccountSid)
		} else {
			fmt.Println(resp.AccountSid)
		}
	}
}
```

```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);

$setting = $twilio->insights->v1->settings()->fetch();

print $setting->accountSid;
```

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

setting = @client
          .insights
          .v1
          .settings
          .fetch

puts setting.account_sid
```

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

twilio api:insights:v1:voice:settings:fetch
```

```bash
curl -X GET "https://insights.twilio.com/v1/Voice/Settings" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "voice_trace": true,
  "advanced_features": true,
  "url": "https://insights.twilio.com/v1/Voice/Settings"
}
```

## Update Voice Insights Settings

`POST https://insights.twilio.com/v1/Voice/Settings`

To manage subaccount Settings pass the subaccount SID as a parameter in the request.

### Request body parameters

```json
{"schema":{"type":"object","title":"UpdateAccountSettingsRequest","properties":{"AdvancedFeatures":{"type":"boolean","description":"A boolean flag to enable Advanced Features for Voice Insights."},"VoiceTrace":{"type":"boolean","description":"A boolean flag to enable Voice Trace."},"SubaccountSid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^AC[0-9a-fA-F]{32}$","description":"The unique SID identifier of the Subaccount."}}},"examples":{"update":{"value":{"lang":"json","value":"{\n  \"VoiceTrace\": true,\n  \"AdvancedFeatures\": true,\n  \"SubaccountSid\": \"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab\"\n}","meta":"","code":"{\n  \"VoiceTrace\": true,\n  \"AdvancedFeatures\": true,\n  \"SubaccountSid\": \"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"VoiceTrace\"","#7EE787"],[":","#C9D1D9"]," ",["true","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"AdvancedFeatures\"","#7EE787"],[":","#C9D1D9"]," ",["true","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"SubaccountSid\"","#7EE787"],[":","#C9D1D9"]," ",["\"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

Update Settings to activate Advanced Features for the account

```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 updateAccountSettings() {
  const setting = await client.insights.v1
    .settings()
    .update({ advancedFeatures: true });

  console.log(setting.accountSid);
}

updateAccountSettings();
```

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

account_settings = client.insights.v1.settings().update(advanced_features=True)

print(account_settings.account_sid)
```

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

using System;
using Twilio;
using Twilio.Rest.Insights.V1;
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 setting = await SettingResource.UpdateAsync(advancedFeatures: true);

        Console.WriteLine(setting.AccountSid);
    }
}
```

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

import com.twilio.Twilio;
import com.twilio.rest.insights.v1.Setting;

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);
        Setting setting = Setting.updater().setAdvancedFeatures(true).update();

        System.out.println(setting.getAccountSid());
    }
}
```

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

import (
	"fmt"
	"github.com/twilio/twilio-go"
	insights "github.com/twilio/twilio-go/rest/insights/v1"
	"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 := &insights.UpdateAccountSettingsParams{}
	params.SetAdvancedFeatures(true)

	resp, err := client.InsightsV1.UpdateAccountSettings(params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.AccountSid != nil {
			fmt.Println(*resp.AccountSid)
		} else {
			fmt.Println(resp.AccountSid)
		}
	}
}
```

```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);

$account_settings = $twilio->insights->v1
    ->settings()
    ->update(["advancedFeatures" => true]);

print $account_settings->accountSid;
```

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

setting = @client
          .insights
          .v1
          .settings
          .update(advanced_features: true)

puts setting.account_sid
```

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

twilio api:insights:v1:voice:settings:update \
   --advanced-features
```

```bash
curl -X POST "https://insights.twilio.com/v1/Voice/Settings" \
--data-urlencode "AdvancedFeatures=true" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "voice_trace": true,
  "advanced_features": true,
  "url": "https://insights.twilio.com/v1/Voice/Settings"
}
```

Update Settings to activate Voice Trace for a subaccount

```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 updateAccountSettings() {
  const setting = await client.insights.v1.settings().update({
    subaccountSid: "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
    voiceTrace: true,
  });

  console.log(setting.accountSid);
}

updateAccountSettings();
```

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

account_settings = client.insights.v1.settings().update(
    subaccount_sid="ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab", voice_trace=True
)

print(account_settings.account_sid)
```

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

using System;
using Twilio;
using Twilio.Rest.Insights.V1;
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 setting = await SettingResource.UpdateAsync(
            subaccountSid: "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab", voiceTrace: true);

        Console.WriteLine(setting.AccountSid);
    }
}
```

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

import com.twilio.Twilio;
import com.twilio.rest.insights.v1.Setting;

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);
        Setting setting =
            Setting.updater().setSubaccountSid("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab").setVoiceTrace(true).update();

        System.out.println(setting.getAccountSid());
    }
}
```

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

import (
	"fmt"
	"github.com/twilio/twilio-go"
	insights "github.com/twilio/twilio-go/rest/insights/v1"
	"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 := &insights.UpdateAccountSettingsParams{}
	params.SetSubaccountSid("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab")
	params.SetVoiceTrace(true)

	resp, err := client.InsightsV1.UpdateAccountSettings(params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.AccountSid != nil {
			fmt.Println(*resp.AccountSid)
		} else {
			fmt.Println(resp.AccountSid)
		}
	}
}
```

```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);

$account_settings = $twilio->insights->v1->settings()->update([
    "subaccountSid" => "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
    "voiceTrace" => true,
]);

print $account_settings->accountSid;
```

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

setting = @client
          .insights
          .v1
          .settings
          .update(
            subaccount_sid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab',
            voice_trace: true
          )

puts setting.account_sid
```

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

twilio api:insights:v1:voice:settings:update \
   --subaccount-sid ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab \
   --voice-trace
```

```bash
curl -X POST "https://insights.twilio.com/v1/Voice/Settings" \
--data-urlencode "SubaccountSid=ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab" \
--data-urlencode "VoiceTrace=true" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "voice_trace": true,
  "advanced_features": true,
  "url": "https://insights.twilio.com/v1/Voice/Settings"
}
```
