# Chat Service Resource

> \[!CAUTION]
>
> Programmable Chat has been deprecated and is no longer supported. Instead, we'll be focusing on the next generation of chat: Twilio Conversations. Find out more about the [EOL process here](https://www.twilio.com/en-us/changelog/programmable-chat-end-of-life-notice).
>
> If you're starting a new project, please visit the [Conversations Docs](/docs/conversations) to begin. If you've already built on Programmable Chat, please visit our [Migration Guide](/docs/conversations/migrating-chat-conversations) to learn about how to switch.

A Service is the top-level scope of all other resources in the Programmable Chat REST API. All other Programmable Chat resources, such as Channels, Users, Messages, and Credentials belong to a specific Service.

Services allow you to:

* Create multiple, distinct environments (such as *dev, stage,* and *prod*) under a single Twilio account
* Scope access to resources through both the REST and client APIs
* Configure different service instances with specific behaviors

A Service can also send [HTTPS requests](https://en.wikipedia.org/wiki/Webhook) to URLs that you define to let you know of specific events. See what events you can subscribe to in our [webhook reference](/docs/chat/webhook-events).

## Twilio Console

You can also manage your Programmable Chat Services from your [Twilio console when you are logged in](/console/chat/services).

## Service Properties

The Service resource contains these properties.

```json
{"type":"object","refName":"chat.v2.service","modelName":"chat_v2_service","properties":{"sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^IS[0-9a-fA-F]{32}$","nullable":true,"description":"The unique string that we created to identify the Service resource."},"account_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^AC[0-9a-fA-F]{32}$","nullable":true,"description":"The SID of the [Account](/docs/iam/api/account) that created the Service resource."},"friendly_name":{"type":"string","nullable":true,"description":"The string that you assigned to describe the resource.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}},"date_created":{"type":"string","format":"date-time","nullable":true,"description":"The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format."},"date_updated":{"type":"string","format":"date-time","nullable":true,"description":"The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format."},"default_service_role_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^RL[0-9a-fA-F]{32}$","nullable":true,"description":"The service role assigned to users when they are added to the service. See the [Role resource](/docs/chat/rest/role-resource) for more info about roles."},"default_channel_role_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^RL[0-9a-fA-F]{32}$","nullable":true,"description":"The channel role assigned to users when they are added to a channel. See the [Role resource](/docs/chat/rest/role-resource) for more info about roles."},"default_channel_creator_role_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^RL[0-9a-fA-F]{32}$","nullable":true,"description":"The channel role assigned to a channel creator when they join a new channel. See the [Role resource](/docs/chat/rest/role-resource) for more info about roles."},"read_status_enabled":{"type":"boolean","nullable":true,"description":"Whether the [Message Consumption Horizon](/docs/chat/consumption-horizon) feature is enabled. The default is `true`."},"reachability_enabled":{"type":"boolean","nullable":true,"description":"Whether the [Reachability Indicator](/docs/chat/reachability-indicator) is enabled for this Service instance. The default is `false`."},"typing_indicator_timeout":{"type":"integer","default":0,"description":"How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received.  The default is 5 seconds."},"consumption_report_interval":{"type":"integer","default":0,"description":"DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints."},"limits":{"nullable":true,"description":"An object that describes the limits of the service instance. The `limits` object contains  `channel_members` to describe the members/channel limit and `user_channels` to describe the channels/user limit. `channel_members` can be 1,000 or less, with a default of 250. `user_channels` can be 1,000 or less, with a default value of 100."},"pre_webhook_url":{"type":"string","nullable":true,"description":"The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](/docs/chat/webhook-events) for more details."},"post_webhook_url":{"type":"string","nullable":true,"description":"The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](/docs/chat/webhook-events) for more details."},"webhook_method":{"type":"string","nullable":true,"description":"The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks.  Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](/docs/chat/webhook-events) for more details."},"webhook_filters":{"type":"array","nullable":true,"description":"The list of webhook events that are enabled for this Service instance. See [Webhook Events](/docs/chat/webhook-events) for more details.","items":{"type":"string"}},"pre_webhook_retry_count":{"type":"integer","default":0,"description":"The number of times to retry a call to the `pre_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. Default retry count is 0 times, which means the call won't be retried."},"post_webhook_retry_count":{"type":"integer","default":0,"description":"The number of times to retry a call to the `post_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. The default is 0, which means the call won't be retried."},"notifications":{"nullable":true,"description":"The notification configuration for the Service instance. See [Push Notification Configuration](/docs/chat/push-notification-configuration) for more info."},"media":{"nullable":true,"description":"An object that describes the properties of media that the service supports. The object contains the `size_limit_mb` property, which describes the size of the largest media file in MB; and the `compatibility_message` property, which contains the message text to send when a media message does not have any text."},"url":{"type":"string","format":"uri","nullable":true,"description":"The absolute URL of the Service resource."},"links":{"type":"object","format":"uri-map","nullable":true,"description":"The absolute URLs of the Service's [Channels](/docs/chat/channels), [Roles](/docs/chat/rest/role-resource), [Bindings](/docs/chat/rest/binding-resource), and [Users](/docs/chat/rest/user-resource)."}}}
```

## Create a Service resource

`POST https://chat.twilio.com/v2/Services`

### Request body parameters

```json
{"schema":{"type":"object","title":"CreateServiceRequest","required":["FriendlyName"],"properties":{"FriendlyName":{"type":"string","description":"A descriptive string that you create to describe the new resource.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}}}},"examples":{"create":{"value":{"lang":"json","value":"{\n  \"FriendlyName\": \"friendly_name\"\n}","meta":"","code":"{\n  \"FriendlyName\": \"friendly_name\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"FriendlyName\"","#7EE787"],[":","#C9D1D9"]," ",["\"friendly_name\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

Create a Service resource

```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 createService() {
  const service = await client.chat.v2.services.create({
    friendlyName: "FriendlyName",
  });

  console.log(service.sid);
}

createService();
```

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

service = client.chat.v2.services.create(friendly_name="FriendlyName")

print(service.sid)
```

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

using System;
using Twilio;
using Twilio.Rest.Chat.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 service = await ServiceResource.CreateAsync(friendlyName: "FriendlyName");

        Console.WriteLine(service.Sid);
    }
}
```

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

import com.twilio.Twilio;
import com.twilio.rest.chat.v2.Service;

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);
        Service service = Service.creator("FriendlyName").create();

        System.out.println(service.getSid());
    }
}
```

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

import (
	"fmt"
	"github.com/twilio/twilio-go"
	chat "github.com/twilio/twilio-go/rest/chat/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 := &chat.CreateServiceParams{}
	params.SetFriendlyName("FriendlyName")

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

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

$service = $twilio->chat->v2->services->create(
    "FriendlyName" // FriendlyName
);

print $service->sid;
```

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

service = @client
          .chat
          .v2
          .services
          .create(friendly_name: 'FriendlyName')

puts service.sid
```

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

twilio api:chat:v2:services:create \
   --friendly-name FriendlyName
```

```bash
curl -X POST "https://chat.twilio.com/v2/Services" \
--data-urlencode "FriendlyName=FriendlyName" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "consumption_report_interval": 100,
  "date_created": "2015-07-30T20:00:00Z",
  "date_updated": "2015-07-30T20:00:00Z",
  "default_channel_creator_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "default_channel_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "default_service_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "friendly_name": "FriendlyName",
  "limits": {
    "channel_members": 100,
    "user_channels": 250
  },
  "links": {
    "channels": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels",
    "users": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users",
    "roles": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles",
    "bindings": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings"
  },
  "notifications": {},
  "post_webhook_url": "post_webhook_url",
  "pre_webhook_url": "pre_webhook_url",
  "pre_webhook_retry_count": 2,
  "post_webhook_retry_count": 3,
  "reachability_enabled": false,
  "read_status_enabled": false,
  "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "typing_indicator_timeout": 100,
  "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "webhook_filters": [
    "webhook_filters"
  ],
  "webhook_method": "webhook_method",
  "media": {
    "size_limit_mb": 150,
    "compatibility_message": "media compatibility message"
  }
}
```

## Fetch a Service resource

`GET https://chat.twilio.com/v2/Services/{Sid}`

### Path parameters

```json
[{"name":"Sid","in":"path","description":"The SID of the Service resource to fetch.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^IS[0-9a-fA-F]{32}$"},"required":true}]
```

Fetch a Service resource

```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 fetchService() {
  const service = await client.chat.v2
    .services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .fetch();

  console.log(service.sid);
}

fetchService();
```

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

service = client.chat.v2.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()

print(service.sid)
```

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

using System;
using Twilio;
using Twilio.Rest.Chat.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 service =
            await ServiceResource.FetchAsync(pathSid: "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

        Console.WriteLine(service.Sid);
    }
}
```

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

import com.twilio.Twilio;
import com.twilio.rest.chat.v2.Service;

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);
        Service service = Service.fetcher("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch();

        System.out.println(service.getSid());
    }
}
```

```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.ChatV2.FetchService("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Sid != nil {
			fmt.Println(*resp.Sid)
		} else {
			fmt.Println(resp.Sid)
		}
	}
}
```

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

$service = $twilio->chat->v2
    ->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->fetch();

print $service->sid;
```

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

service = @client
          .chat
          .v2
          .services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
          .fetch

puts service.sid
```

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

twilio api:chat:v2:services:fetch \
   --sid ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
```

```bash
curl -X GET "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "consumption_report_interval": 100,
  "date_created": "2015-07-30T20:00:00Z",
  "date_updated": "2015-07-30T20:00:00Z",
  "default_channel_creator_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "default_channel_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "default_service_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "friendly_name": "friendly_name",
  "limits": {
    "channel_members": 100,
    "user_channels": 250
  },
  "links": {
    "channels": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels",
    "users": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users",
    "roles": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles",
    "bindings": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings"
  },
  "notifications": {},
  "post_webhook_url": "post_webhook_url",
  "pre_webhook_url": "pre_webhook_url",
  "pre_webhook_retry_count": 2,
  "post_webhook_retry_count": 3,
  "reachability_enabled": false,
  "read_status_enabled": false,
  "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "typing_indicator_timeout": 100,
  "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "webhook_filters": [
    "webhook_filters"
  ],
  "webhook_method": "webhook_method",
  "media": {
    "size_limit_mb": 150,
    "compatibility_message": "media compatibility message"
  }
}
```

## Read multiple Service resources

`GET https://chat.twilio.com/v2/Services`

### Query parameters

```json
[{"name":"PageSize","in":"query","description":"How many resources to return in each list page. The default is 50, and the maximum is 100.","schema":{"type":"integer","format":"int64","minimum":1,"maximum":100}},{"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"}}]
```

Read multiple Service resources

```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 listService() {
  const services = await client.chat.v2.services.list({ limit: 20 });

  services.forEach((s) => console.log(s.sid));
}

listService();
```

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

services = client.chat.v2.services.list(limit=20)

for record in services:
    print(record.sid)
```

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

using System;
using Twilio;
using Twilio.Rest.Chat.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 services = await ServiceResource.ReadAsync(limit: 20);

        foreach (var record in services) {
            Console.WriteLine(record.Sid);
        }
    }
}
```

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

import com.twilio.Twilio;
import com.twilio.rest.chat.v2.Service;
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<Service> services = Service.reader().limit(20).read();

        for (Service record : services) {
            System.out.println(record.getSid());
        }
    }
}
```

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

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

	resp, err := client.ChatV2.ListService(params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		for record := range resp {
			if resp[record].Sid != nil {
				fmt.Println(*resp[record].Sid)
			} else {
				fmt.Println(resp[record].Sid)
			}
		}
	}
}
```

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

$services = $twilio->chat->v2->services->read(20);

foreach ($services as $record) {
    print $record->sid;
}
```

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

services = @client
           .chat
           .v2
           .services
           .list(limit: 20)

services.each do |record|
   puts record.sid
end
```

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

twilio api:chat:v2:services:list
```

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

```json
{
  "meta": {
    "first_page_url": "https://chat.twilio.com/v2/Services?PageSize=50&Page=0",
    "key": "services",
    "next_page_url": null,
    "page": 0,
    "page_size": 50,
    "previous_page_url": null,
    "url": "https://chat.twilio.com/v2/Services?PageSize=50&Page=0"
  },
  "services": []
}
```

## Update a Service resource

`POST https://chat.twilio.com/v2/Services/{Sid}`

### Path parameters

```json
[{"name":"Sid","in":"path","description":"The SID of the Service resource to update.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^IS[0-9a-fA-F]{32}$"},"required":true}]
```

### Request body parameters

```json
{"schema":{"type":"object","title":"UpdateServiceRequest","properties":{"FriendlyName":{"type":"string","description":"A descriptive string that you create to describe the resource.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}},"DefaultServiceRoleSid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^RL[0-9a-fA-F]{32}$","description":"The service role assigned to users when they are added to the service. See the [Role resource](/docs/chat/rest/role-resource) for more info about roles."},"DefaultChannelRoleSid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^RL[0-9a-fA-F]{32}$","description":"The channel role assigned to users when they are added to a channel. See the [Role resource](/docs/chat/rest/role-resource) for more info about roles."},"DefaultChannelCreatorRoleSid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^RL[0-9a-fA-F]{32}$","description":"The channel role assigned to a channel creator when they join a new channel. See the [Role resource](/docs/chat/rest/role-resource) for more info about roles."},"ReadStatusEnabled":{"type":"boolean","description":"Whether to enable the [Message Consumption Horizon](/docs/chat/consumption-horizon) feature. The default is `true`."},"ReachabilityEnabled":{"type":"boolean","description":"Whether to enable the [Reachability Indicator](/docs/chat/reachability-indicator) for this Service instance. The default is `false`."},"TypingIndicatorTimeout":{"type":"integer","description":"How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received.  The default is 5 seconds."},"ConsumptionReportInterval":{"type":"integer","description":"DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints."},"Notifications.NewMessage.Enabled":{"type":"boolean","description":"Whether to send a notification when a new message is added to a channel. The default is `false`."},"Notifications.NewMessage.Template":{"type":"string","description":"The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`."},"Notifications.NewMessage.Sound":{"type":"string","description":"The name of the sound to play when a new message is added to a channel and `notifications.new_message.enabled` is `true`."},"Notifications.NewMessage.BadgeCountEnabled":{"type":"boolean","description":"Whether the new message badge is enabled. The default is `false`."},"Notifications.AddedToChannel.Enabled":{"type":"boolean","description":"Whether to send a notification when a member is added to a channel. The default is `false`."},"Notifications.AddedToChannel.Template":{"type":"string","description":"The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`."},"Notifications.AddedToChannel.Sound":{"type":"string","description":"The name of the sound to play when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`."},"Notifications.RemovedFromChannel.Enabled":{"type":"boolean","description":"Whether to send a notification to a user when they are removed from a channel. The default is `false`."},"Notifications.RemovedFromChannel.Template":{"type":"string","description":"The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`."},"Notifications.RemovedFromChannel.Sound":{"type":"string","description":"The name of the sound to play to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`."},"Notifications.InvitedToChannel.Enabled":{"type":"boolean","description":"Whether to send a notification when a user is invited to a channel. The default is `false`."},"Notifications.InvitedToChannel.Template":{"type":"string","description":"The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`."},"Notifications.InvitedToChannel.Sound":{"type":"string","description":"The name of the sound to play when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`."},"PreWebhookUrl":{"type":"string","format":"uri","description":"The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](/docs/chat/webhook-events) for more details."},"PostWebhookUrl":{"type":"string","format":"uri","description":"The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](/docs/chat/webhook-events) for more details."},"WebhookMethod":{"type":"string","format":"http-method","enum":["GET","POST"],"description":"The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks.  Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](/docs/chat/webhook-events) for more details."},"WebhookFilters":{"type":"array","description":"The list of webhook events that are enabled for this Service instance. See [Webhook Events](/docs/chat/webhook-events) for more details.","items":{"type":"string"}},"Limits.ChannelMembers":{"type":"integer","description":"The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000."},"Limits.UserChannels":{"type":"integer","description":"The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000."},"Media.CompatibilityMessage":{"type":"string","description":"The message to send when a media message has no text. Can be used as placeholder message."},"PreWebhookRetryCount":{"type":"integer","description":"The number of times to retry a call to the `pre_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. Default retry count is 0 times, which means the call won't be retried."},"PostWebhookRetryCount":{"type":"integer","description":"The number of times to retry a call to the `post_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. The default is 0, which means the call won't be retried."},"Notifications.LogEnabled":{"type":"boolean","description":"Whether to log notifications. The default is `false`."}}},"examples":{"update":{"value":{"lang":"json","value":"{\n  \"ConsumptionReportInterval\": 100,\n  \"DefaultChannelCreatorRoleSid\": \"RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n  \"DefaultChannelRoleSid\": \"RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n  \"DefaultServiceRoleSid\": \"RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n  \"FriendlyName\": \"friendly_name\",\n  \"Notifications.AddedToChannel.Enabled\": false,\n  \"Notifications.AddedToChannel.Template\": \"notifications.added_to_channel.template\",\n  \"Notifications.InvitedToChannel.Enabled\": false,\n  \"Notifications.InvitedToChannel.Template\": \"notifications.invited_to_channel.template\",\n  \"Notifications.NewMessage.Enabled\": false,\n  \"Notifications.NewMessage.Template\": \"notifications.new_message.template\",\n  \"Notifications.NewMessage.BadgeCountEnabled\": true,\n  \"Notifications.RemovedFromChannel.Enabled\": false,\n  \"Notifications.RemovedFromChannel.Template\": \"notifications.removed_from_channel.template\",\n  \"Notifications.LogEnabled\": true,\n  \"Limits.ChannelMembers\": 600,\n  \"Limits.UserChannels\": 500,\n  \"PostWebhookUrl\": \"post_webhook_url\",\n  \"PreWebhookUrl\": \"pre_webhook_url\",\n  \"PreWebhookRetryCount\": 2,\n  \"PostWebhookRetryCount\": 3,\n  \"ReachabilityEnabled\": false,\n  \"ReadStatusEnabled\": false,\n  \"TypingIndicatorTimeout\": 100,\n  \"WebhookFilters\": [\n    \"webhook_filters\"\n  ],\n  \"WebhookMethod\": \"webhook_method\",\n  \"Media.CompatibilityMessage\": \"new media compatibility message\"\n}","meta":"","code":"{\n  \"ConsumptionReportInterval\": 100,\n  \"DefaultChannelCreatorRoleSid\": \"RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n  \"DefaultChannelRoleSid\": \"RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n  \"DefaultServiceRoleSid\": \"RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n  \"FriendlyName\": \"friendly_name\",\n  \"Notifications.AddedToChannel.Enabled\": false,\n  \"Notifications.AddedToChannel.Template\": \"notifications.added_to_channel.template\",\n  \"Notifications.InvitedToChannel.Enabled\": false,\n  \"Notifications.InvitedToChannel.Template\": \"notifications.invited_to_channel.template\",\n  \"Notifications.NewMessage.Enabled\": false,\n  \"Notifications.NewMessage.Template\": \"notifications.new_message.template\",\n  \"Notifications.NewMessage.BadgeCountEnabled\": true,\n  \"Notifications.RemovedFromChannel.Enabled\": false,\n  \"Notifications.RemovedFromChannel.Template\": \"notifications.removed_from_channel.template\",\n  \"Notifications.LogEnabled\": true,\n  \"Limits.ChannelMembers\": 600,\n  \"Limits.UserChannels\": 500,\n  \"PostWebhookUrl\": \"post_webhook_url\",\n  \"PreWebhookUrl\": \"pre_webhook_url\",\n  \"PreWebhookRetryCount\": 2,\n  \"PostWebhookRetryCount\": 3,\n  \"ReachabilityEnabled\": false,\n  \"ReadStatusEnabled\": false,\n  \"TypingIndicatorTimeout\": 100,\n  \"WebhookFilters\": [\n    \"webhook_filters\"\n  ],\n  \"WebhookMethod\": \"webhook_method\",\n  \"Media.CompatibilityMessage\": \"new media compatibility message\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"ConsumptionReportInterval\"","#7EE787"],[":","#C9D1D9"]," ",["100","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"DefaultChannelCreatorRoleSid\"","#7EE787"],[":","#C9D1D9"]," ",["\"RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"DefaultChannelRoleSid\"","#7EE787"],[":","#C9D1D9"]," ",["\"RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"DefaultServiceRoleSid\"","#7EE787"],[":","#C9D1D9"]," ",["\"RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"FriendlyName\"","#7EE787"],[":","#C9D1D9"]," ",["\"friendly_name\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Notifications.AddedToChannel.Enabled\"","#7EE787"],[":","#C9D1D9"]," ",["false","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"Notifications.AddedToChannel.Template\"","#7EE787"],[":","#C9D1D9"]," ",["\"notifications.added_to_channel.template\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Notifications.InvitedToChannel.Enabled\"","#7EE787"],[":","#C9D1D9"]," ",["false","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"Notifications.InvitedToChannel.Template\"","#7EE787"],[":","#C9D1D9"]," ",["\"notifications.invited_to_channel.template\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Notifications.NewMessage.Enabled\"","#7EE787"],[":","#C9D1D9"]," ",["false","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"Notifications.NewMessage.Template\"","#7EE787"],[":","#C9D1D9"]," ",["\"notifications.new_message.template\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Notifications.NewMessage.BadgeCountEnabled\"","#7EE787"],[":","#C9D1D9"]," ",["true","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"Notifications.RemovedFromChannel.Enabled\"","#7EE787"],[":","#C9D1D9"]," ",["false","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"Notifications.RemovedFromChannel.Template\"","#7EE787"],[":","#C9D1D9"]," ",["\"notifications.removed_from_channel.template\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Notifications.LogEnabled\"","#7EE787"],[":","#C9D1D9"]," ",["true","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"Limits.ChannelMembers\"","#7EE787"],[":","#C9D1D9"]," ",["600","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"Limits.UserChannels\"","#7EE787"],[":","#C9D1D9"]," ",["500","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"PostWebhookUrl\"","#7EE787"],[":","#C9D1D9"]," ",["\"post_webhook_url\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"PreWebhookUrl\"","#7EE787"],[":","#C9D1D9"]," ",["\"pre_webhook_url\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"PreWebhookRetryCount\"","#7EE787"],[":","#C9D1D9"]," ",["2","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"PostWebhookRetryCount\"","#7EE787"],[":","#C9D1D9"]," ",["3","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"ReachabilityEnabled\"","#7EE787"],[":","#C9D1D9"]," ",["false","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"ReadStatusEnabled\"","#7EE787"],[":","#C9D1D9"]," ",["false","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"TypingIndicatorTimeout\"","#7EE787"],[":","#C9D1D9"]," ",["100","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"WebhookFilters\"","#7EE787"],[": [","#C9D1D9"],"\n    ",["\"webhook_filters\"","#A5D6FF"],"\n  ",["],","#C9D1D9"],"\n  ",["\"WebhookMethod\"","#7EE787"],[":","#C9D1D9"]," ",["\"webhook_method\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Media.CompatibilityMessage\"","#7EE787"],[":","#C9D1D9"]," ",["\"new media compatibility message\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

Update a Service resource

```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 updateService() {
  const service = await client.chat.v2
    .services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .update({ friendlyName: "FriendlyName" });

  console.log(service.sid);
}

updateService();
```

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

service = client.chat.v2.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update(
    friendly_name="FriendlyName"
)

print(service.sid)
```

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

using System;
using Twilio;
using Twilio.Rest.Chat.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 service = await ServiceResource.UpdateAsync(
            friendlyName: "FriendlyName", pathSid: "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

        Console.WriteLine(service.Sid);
    }
}
```

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

import com.twilio.Twilio;
import com.twilio.rest.chat.v2.Service;

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);
        Service service =
            Service.updater("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").setFriendlyName("FriendlyName").update();

        System.out.println(service.getSid());
    }
}
```

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

import (
	"fmt"
	"github.com/twilio/twilio-go"
	chat "github.com/twilio/twilio-go/rest/chat/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 := &chat.UpdateServiceParams{}
	params.SetFriendlyName("FriendlyName")

	resp, err := client.ChatV2.UpdateService("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Sid != nil {
			fmt.Println(*resp.Sid)
		} else {
			fmt.Println(resp.Sid)
		}
	}
}
```

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

$service = $twilio->chat->v2
    ->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->update(["friendlyName" => "FriendlyName"]);

print $service->sid;
```

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

service = @client
          .chat
          .v2
          .services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
          .update(friendly_name: 'FriendlyName')

puts service.sid
```

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

twilio api:chat:v2:services:update \
   --sid ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
   --friendly-name FriendlyName
```

```bash
curl -X POST "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
--data-urlencode "FriendlyName=FriendlyName" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "consumption_report_interval": 100,
  "date_created": "2015-07-30T20:00:00Z",
  "date_updated": "2015-07-30T20:00:00Z",
  "default_channel_creator_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "default_channel_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "default_service_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "friendly_name": "FriendlyName",
  "limits": {
    "channel_members": 500,
    "user_channels": 600
  },
  "links": {
    "channels": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels",
    "users": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users",
    "roles": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles",
    "bindings": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings"
  },
  "notifications": {
    "log_enabled": true,
    "added_to_channel": {
      "enabled": false,
      "template": "notifications.added_to_channel.template"
    },
    "invited_to_channel": {
      "enabled": false,
      "template": "notifications.invited_to_channel.template"
    },
    "new_message": {
      "enabled": false,
      "template": "notifications.new_message.template",
      "badge_count_enabled": true
    },
    "removed_from_channel": {
      "enabled": false,
      "template": "notifications.removed_from_channel.template"
    }
  },
  "post_webhook_url": "post_webhook_url",
  "pre_webhook_url": "pre_webhook_url",
  "pre_webhook_retry_count": 2,
  "post_webhook_retry_count": 3,
  "reachability_enabled": false,
  "read_status_enabled": false,
  "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "typing_indicator_timeout": 100,
  "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "webhook_filters": [
    "webhook_filters"
  ],
  "webhook_method": "webhook_method",
  "media": {
    "size_limit_mb": 150,
    "compatibility_message": "new media compatibility message"
  }
}
```

## Delete a Service resource

`DELETE https://chat.twilio.com/v2/Services/{Sid}`

### Path parameters

```json
[{"name":"Sid","in":"path","description":"The SID of the Service resource to delete.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^IS[0-9a-fA-F]{32}$"},"required":true}]
```

Delete a Service resource

```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 deleteService() {
  await client.chat.v2.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").remove();
}

deleteService();
```

```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.chat.v2.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
```

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

using System;
using Twilio;
using Twilio.Rest.Chat.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 ServiceResource.DeleteAsync(pathSid: "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
    }
}
```

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

import com.twilio.Twilio;
import com.twilio.rest.chat.v2.Service;

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);
        Service.deleter("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").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.ChatV2.DeleteService("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
	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->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->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
  .chat
  .v2
  .services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
  .delete
```

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

twilio api:chat:v2:services:remove \
   --sid ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
```

```bash
curl -X DELETE "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```
