# Conversational Intelligence - CustomOperator Subresource

The CustomOperator subresource of the [Operator resource](/docs/conversational-intelligence/api/operator-resource) represents a Custom Operator. A Custom Operator refers to a [Language Operator](/docs/conversational-intelligence/pre-built-operators) you have created on your Account.

## Custom Operator Properties

```json
{"type":"object","refName":"intelligence.v2.custom_operator","modelName":"intelligence_v2_custom_operator","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 the Custom Operator belongs to."},"sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^LY[0-9a-fA-F]{32}$","nullable":true,"description":"A 34 character string that uniquely identifies this Custom Operator."},"friendly_name":{"type":"string","nullable":true,"description":"A human-readable name of this resource, up to 64 characters."},"description":{"type":"string","nullable":true,"description":"A human-readable description of this resource, longer than the friendly name."},"author":{"type":"string","nullable":true,"description":"The creator of the Custom Operator. Custom Operators can only be created by a Twilio Account."},"operator_type":{"type":"string","nullable":true,"description":"Operator Type for this Operator. References an existing Operator Type resource."},"version":{"type":"integer","default":0,"description":"Numeric Custom Operator version. Incremented with each update on the resource, used to ensure integrity when updating the Custom Operator."},"availability":{"type":"string","enum":["internal","beta","public","retired","general-availability","deprecated"],"description":"Custom Operator availability status. Possible values: internal, beta, public, retired.","refName":"custom_operator_enum_availability","modelName":"custom_operator_enum_availability"},"config":{"nullable":true,"description":"Operator configuration, following the schema defined by the Operator Type. Only available on Operators created by the Account."},"date_created":{"type":"string","format":"date-time","nullable":true,"description":"The date that this Custom Operator was created, given in ISO 8601 format."},"date_updated":{"type":"string","format":"date-time","nullable":true,"description":"The date that this Custom Operator was updated, given in ISO 8601 format."},"url":{"type":"string","format":"uri","nullable":true,"description":"The URL of this resource."}}}
```

## Create a Custom Operator

`POST https://intelligence.twilio.com/v2/Operators/Custom`

This endpoint allows you to create a new Custom Operator for an [Intelligence Service](/docs/conversational-intelligence/api/service-resource) on your Account. Currently, you can create Custom Operators of the `LiteralSpot` or `LiteralClassification` Operator Types. `LiteralSpot` lets you find and extract useful phrases in a Transcript while `LiteralClassification` lets you categorize an entire Transcript or sentences within a Transcript.

### Request body parameters

```json
{"schema":{"type":"object","title":"CreateCustomOperatorRequest","required":["FriendlyName","OperatorType","Config"],"properties":{"FriendlyName":{"type":"string","description":"A human readable description of the new Operator, up to 64 characters."},"OperatorType":{"type":"string","description":"Operator Type for this Operator. References an existing Operator Type resource."},"Config":{"description":"Operator configuration, following the schema defined by the Operator Type."}}},"examples":{"create":{"value":{"lang":"json","value":"{\n  \"FriendlyName\": \"My New Operator\",\n  \"Config\": \"{ \\\"configuration\\\" : { \\\"field\\\": \\\"value\\\"}}\",\n  \"OperatorType\": \"operator-type-name\"\n}","meta":"","code":"{\n  \"FriendlyName\": \"My New Operator\",\n  \"Config\": \"{ \\\"configuration\\\" : { \\\"field\\\": \\\"value\\\"}}\",\n  \"OperatorType\": \"operator-type-name\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"FriendlyName\"","#7EE787"],[":","#C9D1D9"]," ",["\"My New Operator\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Config\"","#7EE787"],[":","#C9D1D9"]," ",["\"{","#A5D6FF"]," ",["\\\"","#79C0FF"],["configuration","#A5D6FF"],["\\\"","#79C0FF"]," ",[": {","#A5D6FF"]," ",["\\\"","#79C0FF"],["field","#A5D6FF"],["\\\"","#79C0FF"],[":","#A5D6FF"]," ",["\\\"","#79C0FF"],["value","#A5D6FF"],["\\\"","#79C0FF"],["}}\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"OperatorType\"","#7EE787"],[":","#C9D1D9"]," ",["\"operator-type-name\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

First, identify the Operator Type of the new Custom Operator. You can fetch a list of available Operator Types using the [OperatorType resource](/docs/conversational-intelligence/api/operator-type-resource). The Operator Type you choose must have the `configurable` property set to `true`.

### OperatorType parameter

When creating your Custom Operator, use the Operator Type's `name` as the value for the `OperatorType` parameter.

### Config parameter

Review the Operator Type's `config_schema` property (specifically the `required` and `properties` fields) to set the `Config` parameter.

Create a Custom Operator

```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 createCustomOperator() {
  const customOperator = await client.intelligence.v2.customOperators.create({
    config: {},
    friendlyName: "FriendlyName",
    operatorType: "OperatorType",
  });

  console.log(customOperator.accountSid);
}

createCustomOperator();
```

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

custom_operator = client.intelligence.v2.custom_operators.create(
    friendly_name="FriendlyName", operator_type="OperatorType", config={}
)

print(custom_operator.account_sid)
```

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

using System;
using Twilio;
using Twilio.Rest.Intelligence.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 customOperator = await CustomOperatorResource.CreateAsync(
            friendlyName: "FriendlyName",
            operatorType: "OperatorType",
            config: new Dictionary<string, Object>() {

            });

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

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

import java.util.HashMap;
import com.twilio.Twilio;
import com.twilio.rest.intelligence.v2.CustomOperator;

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);
        CustomOperator customOperator = CustomOperator
                                            .creator("FriendlyName",
                                                "OperatorType",
                                                new HashMap<String, Object>() {
                                                    {
                                                    }
                                                })
                                            .create();

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

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

import (
	"fmt"
	"github.com/twilio/twilio-go"
	intelligence "github.com/twilio/twilio-go/rest/intelligence/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 := &intelligence.CreateCustomOperatorParams{}
	params.SetFriendlyName("FriendlyName")
	params.SetOperatorType("OperatorType")
	params.SetConfig(map[string]interface{}{})

	resp, err := client.IntelligenceV2.CreateCustomOperator(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);

$custom_operator = $twilio->intelligence->v2->customOperators->create(
    "FriendlyName", // FriendlyName
    "OperatorType", // OperatorType
    [] // Config
);

print $custom_operator->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)

custom_operator = @client
                  .intelligence
                  .v2
                  .custom_operators
                  .create(
                    friendly_name: 'FriendlyName',
                    operator_type: 'OperatorType',
                    config: {

                    }
                  )

puts custom_operator.account_sid
```

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

twilio api:intelligence:v2:operators:custom:create \
   --friendly-name FriendlyName \
   --operator-type OperatorType \
   --config "{}"
```

```bash
CONFIG_OBJ=$(cat << EOF
{

}
EOF
)
curl -X POST "https://intelligence.twilio.com/v2/Operators/Custom" \
--data-urlencode "FriendlyName=FriendlyName" \
--data-urlencode "OperatorType=OperatorType" \
--data-urlencode "Config=$CONFIG_OBJ" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "sid": "LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "friendly_name": "FriendlyName",
  "description": "New Operator",
  "author": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "operator_type": "OperatorType",
  "version": 1,
  "availability": "public",
  "config": {},
  "date_created": "2010-08-31T20:36:28Z",
  "date_updated": "2010-08-31T20:36:28Z",
  "url": "https://intelligence.twilio.com/v2/Operators/Custom/LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
```

## Fetch a Custom Operator

`GET https://intelligence.twilio.com/v2/Operators/Custom/{Sid}`

This endpoint retrieves the details of a Custom Operator using its SID.

### Path parameters

```json
[{"name":"Sid","in":"path","description":"A 34 character string that uniquely identifies this Custom Operator.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^LY[0-9a-fA-F]{32}$"},"required":true}]
```

Fetch a Custom Operator

```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 fetchCustomOperator() {
  const customOperator = await client.intelligence.v2
    .customOperators("LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .fetch();

  console.log(customOperator.accountSid);
}

fetchCustomOperator();
```

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

custom_operator = client.intelligence.v2.custom_operators(
    "LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
).fetch()

print(custom_operator.account_sid)
```

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

using System;
using Twilio;
using Twilio.Rest.Intelligence.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 customOperator =
            await CustomOperatorResource.FetchAsync(pathSid: "LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

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

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

import com.twilio.Twilio;
import com.twilio.rest.intelligence.v2.CustomOperator;

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);
        CustomOperator customOperator = CustomOperator.fetcher("LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch();

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

```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.IntelligenceV2.FetchCustomOperator("LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
	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);

$custom_operator = $twilio->intelligence->v2
    ->customOperators("LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->fetch();

print $custom_operator->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)

custom_operator = @client
                  .intelligence
                  .v2
                  .custom_operators('LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
                  .fetch

puts custom_operator.account_sid
```

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

twilio api:intelligence:v2:operators:custom:fetch \
   --sid LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
```

```bash
curl -X GET "https://intelligence.twilio.com/v2/Operators/Custom/LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "sid": "LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "friendly_name": "My New Operator",
  "description": "New Operator",
  "author": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "operator_type": "operator-type-name",
  "version": 1,
  "availability": "public",
  "config": {
    "configuration": {
      "field": "value"
    }
  },
  "date_created": "2010-08-31T20:36:28Z",
  "date_updated": "2010-08-31T20:36:28Z",
  "url": "https://intelligence.twilio.com/v2/Operators/Custom/LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
```

## List Custom Operators

`GET https://intelligence.twilio.com/v2/Operators/Custom`

This endpoint lists all available Custom Operators you can add to [Intelligence Services](/docs/conversational-intelligence/api/service-resource) on your Account, with optional filtering.

### Query parameters

```json
[{"name":"Availability","in":"query","description":"Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired.","schema":{"type":"string","enum":["internal","beta","public","retired","general-availability","deprecated"],"description":"Custom Operator availability status. Possible values: internal, beta, public, retired.","refName":"custom_operator_enum_availability","modelName":"custom_operator_enum_availability"},"examples":{"readFull":{"value":"public"},"readEmpty":{"value":"public"}}},{"name":"LanguageCode","in":"query","description":"Returns Custom Operators that support the provided language code.","schema":{"type":"string"},"examples":{"readFull":{"value":"en"},"readEmpty":{"value":"en"}}},{"name":"PageSize","in":"query","description":"How many resources to return in each list page. The default is 50, and the maximum is 1000.","schema":{"type":"integer","format":"int64","minimum":1,"maximum":1000}},{"name":"Page","in":"query","description":"The page index. This value is simply for client state.","schema":{"type":"integer","minimum":0}},{"name":"PageToken","in":"query","description":"The page token. This is provided by the API.","schema":{"type":"string"}}]
```

List multiple Custom Operators

```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 listCustomOperator() {
  const customOperators = await client.intelligence.v2.customOperators.list({
    limit: 20,
  });

  customOperators.forEach((c) => console.log(c.accountSid));
}

listCustomOperator();
```

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

custom_operators = client.intelligence.v2.custom_operators.list(limit=20)

for record in custom_operators:
    print(record.account_sid)
```

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

using System;
using Twilio;
using Twilio.Rest.Intelligence.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 customOperators = await CustomOperatorResource.ReadAsync(limit: 20);

        foreach (var record in customOperators) {
            Console.WriteLine(record.AccountSid);
        }
    }
}
```

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

import com.twilio.Twilio;
import com.twilio.rest.intelligence.v2.CustomOperator;
import com.twilio.base.ResourceSet;

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);
        ResourceSet<CustomOperator> customOperators = CustomOperator.reader().limit(20).read();

        for (CustomOperator record : customOperators) {
            System.out.println(record.getAccountSid());
        }
    }
}
```

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

import (
	"fmt"
	"github.com/twilio/twilio-go"
	intelligence "github.com/twilio/twilio-go/rest/intelligence/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 := &intelligence.ListCustomOperatorParams{}
	params.SetLimit(20)

	resp, err := client.IntelligenceV2.ListCustomOperator(params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		for record := range resp {
			if resp[record].AccountSid != nil {
				fmt.Println(*resp[record].AccountSid)
			} else {
				fmt.Println(resp[record].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);

$customOperators = $twilio->intelligence->v2->customOperators->read([], 20);

foreach ($customOperators as $record) {
    print $record->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)

custom_operators = @client
                   .intelligence
                   .v2
                   .custom_operators
                   .list(limit: 20)

custom_operators.each do |record|
   puts record.account_sid
end
```

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

twilio api:intelligence:v2:operators:custom:list
```

```bash
curl -X GET "https://intelligence.twilio.com/v2/Operators/Custom?PageSize=20" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "operators": [
    {
      "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "sid": "LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "friendly_name": "My New Operator",
      "description": "New Operator",
      "author": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "operator_type": "operator-type-name",
      "version": 1,
      "availability": "public",
      "config": {
        "configuration": {
          "field": "value"
        }
      },
      "date_created": "2010-08-31T20:36:28Z",
      "date_updated": "2010-08-31T20:36:28Z",
      "url": "https://intelligence.twilio.com/v2/Operators/Custom/LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    }
  ],
  "meta": {
    "first_page_url": "https://intelligence.twilio.com/v2/Operators/Custom?LanguageCode=en&Availability=public&PageSize=50&Page=0",
    "key": "operators",
    "next_page_url": null,
    "page": 0,
    "page_size": 50,
    "previous_page_url": null,
    "url": "https://intelligence.twilio.com/v2/Operators/Custom?LanguageCode=en&Availability=public&PageSize=50&Page=0"
  }
}
```

## Update a Custom Operator

`POST https://intelligence.twilio.com/v2/Operators/Custom/{Sid}`

This endpoint updates a Custom Operator.

### Headers

```json
[{"name":"If-Match","in":"header","description":"The If-Match HTTP request header","schema":{"type":"string"}}]
```

### Path parameters

```json
[{"name":"Sid","in":"path","description":"A 34 character string that uniquely identifies this Custom Operator.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^LY[0-9a-fA-F]{32}$"},"required":true}]
```

### Request body parameters

```json
{"schema":{"type":"object","title":"UpdateCustomOperatorRequest","required":["FriendlyName","Config"],"properties":{"FriendlyName":{"type":"string","description":"A human-readable name of this resource, up to 64 characters."},"Config":{"description":"Operator configuration, following the schema defined by the Operator Type."}}},"examples":{"update":{"value":{"lang":"json","value":"{\n  \"FriendlyName\": \"My New Operator\",\n  \"Config\": \"{ \\\"configuration\\\" : { \\\"field\\\": \\\"value\\\"}}\"\n}","meta":"","code":"{\n  \"FriendlyName\": \"My New Operator\",\n  \"Config\": \"{ \\\"configuration\\\" : { \\\"field\\\": \\\"value\\\"}}\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"FriendlyName\"","#7EE787"],[":","#C9D1D9"]," ",["\"My New Operator\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Config\"","#7EE787"],[":","#C9D1D9"]," ",["\"{","#A5D6FF"]," ",["\\\"","#79C0FF"],["configuration","#A5D6FF"],["\\\"","#79C0FF"]," ",[": {","#A5D6FF"]," ",["\\\"","#79C0FF"],["field","#A5D6FF"],["\\\"","#79C0FF"],[":","#A5D6FF"]," ",["\\\"","#79C0FF"],["value","#A5D6FF"],["\\\"","#79C0FF"],["}}\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

Update a Custom Operator

```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 updateCustomOperator() {
  const customOperator = await client.intelligence.v2
    .customOperators("LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .update({
      config: {},
      friendlyName: "FriendlyName",
    });

  console.log(customOperator.accountSid);
}

updateCustomOperator();
```

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

custom_operator = client.intelligence.v2.custom_operators(
    "LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
).update(friendly_name="FriendlyName", config={})

print(custom_operator.account_sid)
```

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

using System;
using Twilio;
using Twilio.Rest.Intelligence.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 customOperator = await CustomOperatorResource.UpdateAsync(
            friendlyName: "FriendlyName",
            config: new Dictionary<string, Object>() {

            },
            pathSid: "LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
        );

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

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

import java.util.HashMap;
import com.twilio.Twilio;
import com.twilio.rest.intelligence.v2.CustomOperator;

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);
        CustomOperator customOperator = CustomOperator
                                            .updater("LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                                                "FriendlyName",
                                                new HashMap<String, Object>() {
                                                    {
                                                    }
                                                }

                                                )
                                            .update();

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

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

import (
	"fmt"
	"github.com/twilio/twilio-go"
	intelligence "github.com/twilio/twilio-go/rest/intelligence/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 := &intelligence.UpdateCustomOperatorParams{}
	params.SetFriendlyName("FriendlyName")
	params.SetConfig(map[string]interface{}{})

	resp, err := client.IntelligenceV2.UpdateCustomOperator("LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
		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);

$custom_operator = $twilio->intelligence->v2
    ->customOperators("LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->update(
        "FriendlyName", // FriendlyName
        [] // Config
    );

print $custom_operator->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)

custom_operator = @client
                  .intelligence
                  .v2
                  .custom_operators('LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
                  .update(
                    friendly_name: 'FriendlyName',
                    config: {

                    }
                  )

puts custom_operator.account_sid
```

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

twilio api:intelligence:v2:operators:custom:update \
   --sid LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
   --friendly-name FriendlyName \
   --config "{}"
```

```bash
CONFIG_OBJ=$(cat << EOF
{

}
EOF
)
curl -X POST "https://intelligence.twilio.com/v2/Operators/Custom/LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
--data-urlencode "FriendlyName=FriendlyName" \
--data-urlencode "Config=$CONFIG_OBJ" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "sid": "LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "friendly_name": "FriendlyName",
  "description": "My New Operator",
  "author": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "operator_type": "operator-type-name",
  "version": 2,
  "availability": "public",
  "config": {},
  "date_created": "2010-08-31T20:36:28Z",
  "date_updated": "2010-08-31T20:36:28Z",
  "url": "https://intelligence.twilio.com/v2/Operators/Custom/LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
```

## Delete a Custom Operator

`DELETE https://intelligence.twilio.com/v2/Operators/Custom/{Sid}`

This endpoint deletes a Custom Operator.

### Path parameters

```json
[{"name":"Sid","in":"path","description":"A 34 character string that uniquely identifies this Custom Operator.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^LY[0-9a-fA-F]{32}$"},"required":true}]
```

Delete a Custom Operator

```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 deleteCustomOperator() {
  await client.intelligence.v2
    .customOperators("LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .remove();
}

deleteCustomOperator();
```

```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.intelligence.v2.custom_operators(
    "LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
).delete()
```

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

using System;
using Twilio;
using Twilio.Rest.Intelligence.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 CustomOperatorResource.DeleteAsync(pathSid: "LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
    }
}
```

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

import com.twilio.Twilio;
import com.twilio.rest.intelligence.v2.CustomOperator;

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);
        CustomOperator.deleter("LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").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.IntelligenceV2.DeleteCustomOperator("LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
	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->intelligence->v2
    ->customOperators("LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->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
  .intelligence
  .v2
  .custom_operators('LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
  .delete
```

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

twilio api:intelligence:v2:operators:custom:remove \
   --sid LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
```

```bash
curl -X DELETE "https://intelligence.twilio.com/v2/Operators/Custom/LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```
