Services Resource

A Service is the top-level scope of all other resources in the Programmable Chat REST API. It owns Channels, Users, Messages, Credentials, and all other data for a Chat implementation. Services allow the developer to:

  • Create multiple environments (dev, stage, prod) under the same Twilio account with segregated data
  • Scope access to resources through both the REST and client APIs
  • Configure various behaviors of the service per instance

A Service will also send HTTPS requests to URLs configured by the developer when interesting events happen. Check out the webhook reference to see what events you can subscribe to in your Service.

Twilio Console

You can manage your Programmable Chat Services using your Twilio console when logged in to the console.

Properties

Each service has these properties:

name description
sid A 34 character string that uniquely identifies this resource.
account_sid The unique id of the Account responsible for this service.
friendly_name The human-readable name of this service.
date_created The date that this resource was created
date_updated The date that this resource was last updated
default_service_role_sid The service role assigned to users when they are added to the service. See the Roles endpoint for more details.
default_channel_role_sid The channel role assigned to users when they are added to a channel. See the Roles endpoint for more details.
default_channel_creator_role_sid The channel role assigned to a channel creator when joining a new channel. See the Roles endpoint for more details.
typing_indicator_timeout The amount of time in seconds after a "started typing" event when clients should assume that user is no longer typing, even if no "ended typing" message was received. Default is 5 seconds.
read_status_enabled Enable the Message Constumption Horizon feature (true if enabled, false if not). Defaults to true.
consumption_report_interval The interval in seconds between consumption reports submission batches from client endpoints. Default is 10 seconds.
reachability_enabled Indicates whether the the Reachability feature is enabled for this Service instance. Defaults to false.
limits Configuration for service instance level limits. Configurable limits are Max Channels per User (default: 250; maximum allowed: 1,000) and Max Members per Channel (default: 100; maximum allowed: 1,000).
pre_webhook_url The webhook URL for PRE-Event webhooks. See Webhook Events for more details.
post_webhook_url The webhook URL for POST-Event webhooks. See Webhook Events for more details.
webhook_method The webhook request format to use for both PRE and POST webhooks. Must be POST or GET. See Webhook Events for more details. The default is POST.
webhook_filters The list of WebHook events that are enabled for this Service instance. See Webhook Events for more details.
notifications* Separate sub-parameters for push notifications settings for this Service instance - with each notification type having a Enabled, optional Template property and optional Sound property. See Push Notification Configuration for more details. Some push types may have additional configuration options.
url An absolute URL for this service.
links URLs to access the Channels, Roles, and Users for this service.

List All Services

GET /Services
Loading Code Samples...
Language
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
Format:
  • JSON
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var IpMessagingClient = require('twilio').IpMessagingClient;

var client = new IpMessagingClient(accountSid, authToken);

client.services.list().then(function(response) {
    console.log(response);
}).fail(function(error) {
    console.log(error);
});
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var Twilio = require('twilio').Twilio;

var client = new Twilio(accountSid, authToken);

client.chat.services.list().then(function(response) {
    console.log(response);
}).catch(function(error) {
    console.log(error);
});
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.IpMessaging;
using Twilio.IpMessaging.Model;

class Example {
    static void Main (string[] args) {
        // Find your Account Sid and Auth Token at twilio.com/user/account
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";

        //List all services
        var client = new IpMessagingClient(accountSid, authToken);
        ServiceResult result = client.ListServices();

        Console.WriteLine(result);
    }
}
<?php

// This line loads the library
require('Services/Twilio.php');

// Find your Account Sid and Token at twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

// Initialize the client
$client = new IPMessaging_Services_Twilio($sid, $token);

// Retrieve the service
$services = $client->services;

$all_services = print_r($services, true);
print $all_services;
require 'twilio-ruby'

# Initialize the client
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
ip_messaging_client = Twilio::REST::IpMessagingClient.new account_sid,
                                                          auth_token

# List the services
services = ip_messaging_client.services.list
puts services
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Chat.V2;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";

        TwilioClient.Init(accountSid, authToken);

        var services = ServiceResource.Read();

        foreach (var service in services)
        {
            Console.WriteLine(service.FriendlyName);
        }
    }
}
<?php

// This line loads the library
require '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

// Find your Account Sid and Token at twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

// Initialize the client
$client = new Client($sid, $token);

// Retrieve the services
$services = $client->chat->services->read();

foreach ($services as $service) {
    echo $service->friendlyName . PHP_EOL;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest.ip_messaging import TwilioIpMessagingClient

# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = TwilioIpMessagingClient(account, token)

for service in client.services.list():
    print(service.sid)
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

@client = Twilio::REST::Client.new(account_sid, auth_token)

@client.chat.v2.services.each do |s|
  puts "#{s.sid} #{s.friendly_name}"
end
import com.twilio.sdk.TwilioIPMessagingClient;
import com.twilio.sdk.resource.instance.ipmessaging.Service;
import com.twilio.sdk.resource.list.ipmessaging.ServiceList;
import com.twilio.sdk.TwilioRestException;

public class TwilioTest {
    // Find your Account Sid and Token at twilio.com/user/account
    public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    public static final String AUTH_TOKEN = "your_auth_token";
    public static final String SERVICE_SID = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

    public static void main(String args[]) throws TwilioRestException {
        // Initialize the client
        TwilioIPMessagingClient client = new TwilioIPMessagingClient(ACCOUNT_SID, AUTH_TOKEN);

        // List the services
        ServiceList list = client.getServices();
        System.out.println(list);
    }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = Client(account, token)

for service in client.chat.services.list():
    print(service.sid)
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.chat.v2.Service;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

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

    // List the services
    ResourceSet<Service> services = Service.reader().read();

    for (Service service : services) {
      System.out.println(service.getFriendlyName());
    }
  }
}
curl -G https://chat.twilio.com/v2/Services \
    -u '{twilio account sid}:{twilio auth token}'
{
  "services": [
    {
      "pre_webhook_url": null,
      "read_status_enabled": true,
      "typing_indicator_timeout": 5,
      "limits": {
        "channel_members": 100,
        "user_channels": 250
      },
      "default_service_role_sid": "RLxxx",
      "date_updated": "2016-08-30T13:13:10Z",
      "post_webhook_url": null,
      "reachability_enabled": false,
      "friendly_name": "Test service",
      "account_sid": "ACxxx",
      "consumption_report_interval": 10,
      "notifications": {
        "new_message": {
          "enabled": false
        },
        "invited_to_channel": {
          "enabled": false
        },
        "removed_from_channel": {
          "enabled": false
        },
        "added_to_channel": {
          "enabled": false
        }
      },
      "webhook_method": null,
      "default_channel_creator_role_sid": "RLxxx",
      "url": "https://chat.twilio.com/v2/Services/ISxxx",
      "sid": "ISxxx",
      "webhook_filters": null,
      "date_created": "2016-08-30T13:13:05Z",
      "default_channel_role_sid": "RLxxx",
      "links": {
        "channels": "https://chat.twilio.com/v2/Services/ISxxx/Channels",
        "users": "https://chat.twilio.com/v2/Services/ISxxx/Users",
        "roles": "https://chat.twilio.com/v2/Services/ISxxx/Roles"
      }
    }
  ],
  "meta": {
    "page": 0,
    "page_size": 50,
    "first_page_url": "https://chat.twilio.com/v2/Services?PageSize=50&Page=0",
    "previous_page_url": null,
    "url": "https://chat.twilio.com/v2/Services?PageSize=50&Page=0",
    "next_page_url": "https://chat.twilio.com/v2/Services?PageSize=50&Page=1&PageToken=PTISxxx",
    "key": "services"
  }
}
List all Services

Create A Service

`POST /Services`

Parameters

name description
FriendlyName (optional) Human-readable name for this service instance
Loading Code Samples...
Language
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
Format:
  • JSON
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const IpMessagingClient = require('twilio').IpMessagingClient;

const client = new IpMessagingClient(accountSid, authToken);

client.services
  .create({
    friendlyName: 'friendly_name',
  })
  .then(response => {
    console.log(response);
  })
  .fail(error => {
    console.log(error);
  });
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const Twilio = require('twilio').Twilio;

const client = new Twilio(accountSid, authToken);

client.chat.services
  .create({
    friendlyName: 'My Chat service',
  })
  .then(response => {
    console.log(response);
  })
  .catch(error => {
    console.log(error);
  });
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.IpMessaging;
using Twilio.IpMessaging.Model;

class Example {
    static void Main (string[] args) {
        // Find your Account Sid and Auth Token at twilio.com/user/account
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        const string friendlyName = "friendlyName";

        // Create a service
        var client = new IpMessagingClient(accountSid, authToken);
        Service service = client.CreateService(friendlyName);

        Console.WriteLine(service);
    }
}
<?php

// This line loads the library
require('Services/Twilio.php');

// Find your Account Sid and Token at twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

// Initialize the client
$client = new IPMessaging_Services_Twilio($sid, $token);

// Create the service
$service = $client->services->create(array(
    "FriendlyName" => "NEW_SERVICE",
));
print $service->sid;
require 'twilio-ruby'

# Initialize the client
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
ip_messaging_client = Twilio::REST::IpMessagingClient.new account_sid,
                                                          auth_token

# Create the service
service = ip_messaging_client.services.create(friendly_name: 'FRIENDLY_NAME')
puts service
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Chat.V2;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        const string friendlyName = "friendlyName";

        TwilioClient.Init(accountSid, authToken);

        var service = ServiceResource.Create(friendlyName);

        Console.WriteLine(service.FriendlyName);
    }
}
<?php

// This line loads the library
require '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

// Find your Account Sid and Token at twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

// Initialize the client
$client = new Client($sid, $token);

// Create the service
$service = $client->chat
    ->services
    ->create("NEW_SERVICE");

print $service->friendlyName;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest.ip_messaging import TwilioIpMessagingClient

# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = TwilioIpMessagingClient(account, token)

service = client.services.create(friendly_name="FRIENDLY_NAME")
print(service)
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

client = Twilio::REST::Client.new(account_sid, auth_token)

# Create a new service and make note of that service's SID.
new_service = client.chat.v2
                    .services.create(friendly_name: 'An example service')
puts "Created Chat service #{new_service.sid}"
import com.twilio.sdk.TwilioIPMessagingClient;
import com.twilio.sdk.resource.instance.ipmessaging.Service;
import com.twilio.sdk.TwilioRestException;

import java.util.HashMap;
import java.util.Map;

public class TwilioTest {
    // Find your Account Sid and Token at twilio.com/user/account
    public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    public static final String AUTH_TOKEN = "your_auth_token";

    public static void main(String args[]) throws TwilioRestException {
        // Initialize the client
        TwilioIPMessagingClient client = new TwilioIPMessagingClient(ACCOUNT_SID, AUTH_TOKEN);

        // Create the service
        final Map<String, String> serviceParams = new HashMap<String, String>();
        serviceParams.put("FriendlyName", "ServiceName");
        Service service = client.getServices().create(serviceParams);
        System.out.println(service);
    }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = Client(account, token)

service = client.chat.services.create(friendly_name="FRIENDLY_NAME")

print(service.sid)
// 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 Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

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

    // Create the service
    Service service = Service.creator("ServiceName").create();

    System.out.println(service.getFriendlyName());
  }
}
curl -XPOST https://chat.twilio.com/v2/Services \
    -d "FriendlyName=AllansService" \
    -u '{twilio account sid}:{twilio auth token}'
    {
      "pre_webhook_url": null,
      "read_status_enabled": true,
      "typing_indicator_timeout": 5,
      "limits": {
        "channel_members": 100,
        "user_channels": 250
      },
      "default_service_role_sid": "RLxxx",
      "date_updated": "2016-08-30T13:13:10Z",
      "post_webhook_url": null,
      "reachability_enabled": false,
      "friendly_name": "Test service",
      "account_sid": "ACxxx",
      "consumption_report_interval": 10,
      "notifications": {
        "new_message": {
          "enabled": false
        },
        "invited_to_channel": {
          "enabled": false
        },
        "removed_from_channel": {
          "enabled": false
        },
        "added_to_channel": {
          "enabled": false
        }
      },
      "webhook_method": null,
      "default_channel_creator_role_sid": "RLxxx",
      "url": "https://chat.twilio.com/v2/Services/ISxxx",
      "sid": "ISxxx",
      "webhook_filters": null,
      "date_created": "2016-08-30T13:13:05Z",
      "default_channel_role_sid": "RLxxx",
      "links": {
        "channels": "https://chat.twilio.com/v2/Services/ISxxx/Channels",
        "users": "https://chat.twilio.com/v2/Services/ISxxx/Users",
        "roles": "https://chat.twilio.com/v2/Services/ISxxx/Roles"
      }
    }
Create a Service

Retrieve a Service

`GET /Services/ISxxx`
Loading Code Samples...
Language
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
Format:
  • JSON
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const IpMessagingClient = require('twilio').IpMessagingClient;

const client = new IpMessagingClient(accountSid, authToken);

client
  .services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
  .get()
  .then(response => {
    console.log(response);
  })
  .fail(error => {
    console.log(error);
  });
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const Twilio = require('twilio').Twilio;

const client = new Twilio(accountSid, authToken);

client.chat
  .services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
  .fetch()
  .then(response => {
    console.log(response);
  })
  .catch(error => {
    console.log(error);
  });
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.IpMessaging;
using Twilio.IpMessaging.Model;

class Example {
	static void Main (string[] args) {
    	// Find your Account Sid and Auth Token at twilio.com/user/account
    	const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    	const string authToken = "your_auth_token";
    	const string serviceSid = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

    	// Retrieve a service
    	var client = new IpMessagingClient(accountSid, authToken);
    	Service service = client.GetService(serviceSid);
    	Console.WriteLine(service);
 	}
}
<?php

// This line loads the library
require('Services/Twilio.php');

// Find your Account Sid and Token at twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

// Initialize the client
$client = new IPMessaging_Services_Twilio($sid, $token);

// Retrieve the service
$service = $client->services->get("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
print $service;
require 'twilio-ruby'

# Initialize the client
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
ip_messaging_client = Twilio::REST::IpMessagingClient.new(account_sid, auth_token)

#Retrieve the service
service = ip_messaging_client.services.get('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
puts service
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Chat.V2;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        const string serviceSid = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

        TwilioClient.Init(accountSid, authToken);

        var service = ServiceResource.Fetch(serviceSid);

        Console.WriteLine(service.FriendlyName);
    }
}
<?php

// This line loads the library
require '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

// Find your Account Sid and Token at twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

// Initialize the client
$client = new Client($sid, $token);

// Retrieve the service
$service = $client->chat
    ->services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    ->fetch();

print $service->friendlyName;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest.ip_messaging import TwilioIpMessagingClient

# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = TwilioIpMessagingClient(account, token)

# Retrieve the service
service = client.services.get(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
print(service)
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
service_sid = 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Retrieve the service
service = @client.chat.v2.services(service_sid).fetch
puts "Chat service #{service_sid} has Friendly Name \"#{service.friendly_name}\""
import com.twilio.sdk.TwilioIPMessagingClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.ipmessaging.Service;

public class TwilioTest {
    // Find your Account Sid and Token at twilio.com/user/account
    public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    public static final String AUTH_TOKEN = "your_auth_token";
    public static final String SERVICE_SID = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

    public static void main(String args[]) throws TwilioRestException {
        // Initialize the client
        TwilioIPMessagingClient client = new TwilioIPMessagingClient(ACCOUNT_SID, AUTH_TOKEN);

        // Retrieve the service
        Service service = client.getService(SERVICE_SID);
        System.out.println(service);
    }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = Client(account, token)

# Retrieve the service
service = client.chat.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").fetch()

print(service.friendly_name)
// 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 Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static final String SERVICE_SID = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

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

    // Retrieve the service
    Service service = Service.fetcher(SERVICE_SID).fetch();

    System.out.println(service.getFriendlyName());
  }
}
curl -G https://chat.twilio.com/v2/Services/ISxxx \
    -u '{twilio account sid}:{twilio auth token}'
    {
      "pre_webhook_url": null,
      "read_status_enabled": true,
      "typing_indicator_timeout": 5,
      "limits": {
        "channel_members": 100,
        "user_channels": 250
      },
      "default_service_role_sid": "RLxxx",
      "date_updated": "2016-08-30T13:13:10Z",
      "post_webhook_url": null,
      "reachability_enabled": false,
      "friendly_name": "Test service",
      "account_sid": "ACxxx",
      "consumption_report_interval": 10,
      "notifications": {
        "new_message": {
          "enabled": false
        },
        "invited_to_channel": {
          "enabled": false
        },
        "removed_from_channel": {
          "enabled": false
        },
        "added_to_channel": {
          "enabled": false
        }
      },
      "webhook_method": null,
      "default_channel_creator_role_sid": "RLxxx",
      "url": "https://chat.twilio.com/v2/Services/ISxxx",
      "sid": "ISxxx",
      "webhook_filters": null,
      "date_created": "2016-08-30T13:13:05Z",
      "default_channel_role_sid": "RLxxx",
      "links": {
        "channels": "https://chat.twilio.com/v2/Services/ISxxx/Channels",
        "users": "https://chat.twilio.com/v2/Services/ISxxx/Users",
        "roles": "https://chat.twilio.com/v2/Services/ISxxx/Roles"
      }
    }
Retrieve a Service

Update A Service

`POST /Services/ISxxx`

Parameters

Name Description
FriendlyName Human-readable name for this service instance
DefaultDeploymentRoleSid Service (Deployment) role assigned on initial login / create user (see Roles data model for the details)
DefaultChannelRoleSid Channel role assigned on channel join (see Roles data model for the details)
DefaultChannelCreatorRoleSid Channel role assigned to creator of channel when joining for first time
ReadStatusEnabled true if the member read status feature is enabled, false if not. Defaults to true.
ReachabilityEnabled true if the reachability feature should be enabled. Defaults to false
ConsumptionReportInterval The duration in seconds indicating the interval between consumption reports sent from client endpoints.
TypingIndicatorTimeout The duration in seconds indicating the timeout after “started typing” event when client should assume that user is not typing anymore even if no “ended typing” message received
Limits.UserChannels The maximum number of Channels Users can be a Member of within this Service. The maximum value allowed is 1,000
Limits.ChannelMembers The maximum number of Members that can be added to Channels within this Service. The maximum allowed value is 1,000
PreWebhookUrl The webhook URL for PRE-Event webhooks. See Webhook Events for more details.
PostWebhookUrl The webhook URL for POST-Event webhooks. See Webhook Events for more details.
WebhookMethod The webhook request format to use. Must be POST or GET. See Webhook Events for more details.
WebhookFilters The list of WebHook events that are enabled for this Service instance. See Webhook Events for more details.
Notifications Notification configuration for the Service instance. See Push Notification Configuration for more information.
Loading Code Samples...
Language
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
Format:
  • JSON
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var IpMessagingClient = require('twilio').IpMessagingClient;

var client = new IpMessagingClient(accountSid, authToken);

client.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update({
    friendlyName: 'NAME'
}).then(function(response) {
    console.log(response);
}).fail(function(error) {
    console.log(error);
});
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var Twilio = require('twilio').Twilio;

var client = new Twilio(accountSid, authToken);

client.chat.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update({
    friendlyName: 'My new Chat service'
}).then(function(response) {
    console.log(response);
}).catch(function(error) {
    console.log(error);
});
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.IpMessaging;
using Twilio.IpMessaging.Model;
using System.Collections.Generic;

class Example {
    static void Main (string[] args) {
        // Find your Account Sid and Auth Token at twilio.com/user/account
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        const string serviceSid = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string friendlyName = "friendlyName";
        const string defaultServiceRoleSid = "defaultServiceRoleSid";
        const string defaultChannelRoleSid = "defaultChannelRoleSid";
        const string defaultChannelCreatorRoleSid = "defaultChannelCreatorRoleSid";
        const int typingIndicatorTimeout = 5;
        Dictionary<string, string> webhooksParams = new Dictionary<string, string>();

        // Update a service
        var client = new IpMessagingClient(accountSid, authToken);
        Service service = client.UpdateService(serviceSid,
            friendlyName,
            defaultServiceRoleSid,
            defaultChannelRoleSid,
            defaultChannelCreatorRoleSid,
            typingIndicatorTimeout,
            webhooksParams);

        Console.WriteLine(service);
    }
}
<?php

// This line loads the library
require('Services/Twilio.php');

// Find your Account Sid and Token at twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

// Initialize the client
$client = new IPMessaging_Services_Twilio($sid, $token);

// Update the service
$service = $client->services->get("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
$response = $service->update(array(
    "FriendlyName" => "NEW_FRIENDLY_NAME",
));
print $response;
require 'twilio-ruby'

# Initialize the client
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
ip_messaging_client = Twilio::REST::IpMessagingClient.new(account_sid, auth_token)

# Update the service
service = ip_messaging_client.services.get('FRIENDLY_NAME')
response = service.update(friendly_name: 'NEW_SID')
puts response
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Chat.V2;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        const string serviceSid = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string friendlyName = "friendlyName";
        const string defaultServiceRoleSid = "defaultServiceRoleSid";
        const string defaultChannelRoleSid = "defaultChannelRoleSid";
        const string defaultChannelCreatorRoleSid = "defaultChannelCreatorRoleSid";
        const int typingIndicatorTimeout = 5;

        TwilioClient.Init(accountSid, authToken);

        var service = ServiceResource.Update(serviceSid,
                                             friendlyName,
                                             defaultServiceRoleSid,
                                             defaultChannelRoleSid,
                                             defaultChannelCreatorRoleSid,
                                             typingIndicatorTimeout: typingIndicatorTimeout);

        Console.WriteLine(service.FriendlyName);
    }
}
<?php

// This line loads the library
require '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

// Find your Account Sid and Token at twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

// Initialize the client
$client = new Client($sid, $token);

// Update the service
$service = $client->chat
    ->services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    ->update(
        array("friendlyName" => "NEW_FRIENDLY_NAME")
    );

echo $service->friendlyName;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest.ip_messaging import TwilioIpMessagingClient

# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = TwilioIpMessagingClient(account, token)

service = client.services.get(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
response = service.update(friendly_name="NEW_FRIENDLY_NAME")
print(response)
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
service_sid = 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Update the service with something new.
new_role_sid = 'RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
service = @client.chat.v2.services(service_sid)
response = service.update(default_service_role_sid: new_role_sid)
puts "Updated role sid to #{response.default_service_role_sid}!"
import com.twilio.sdk.TwilioIPMessagingClient;
import com.twilio.sdk.resource.instance.ipmessaging.Service;
import com.twilio.sdk.TwilioRestException;

import java.util.HashMap;
import java.util.Map;

public class TwilioTest {
    // Find your Account Sid and Token at twilio.com/user/account
    public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    public static final String AUTH_TOKEN = "your_auth_token";
    public static final String SERVICE_SID = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

    public static void main(String args[]) throws TwilioRestException {
        // Initialize the client
        TwilioIPMessagingClient client = new TwilioIPMessagingClient(ACCOUNT_SID, AUTH_TOKEN);

        // Retrieve the service
        Service service = client.getService(SERVICE_SID);

        // Update the service
        final Map<String, String> serviceParams = new HashMap<String, String>();
        serviceParams.put("FriendlyName", "NewServiceName");
        service.update(serviceParams);
        System.out.println(service);
    }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = Client(account, token)

service = client.chat.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update(
    friendly_name="NEW_FRIENDLY_NAME"
)

print(service.friendly_name)
// 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 Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static final String SERVICE_SID = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

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

    // Update the service
    Service service = Service.updater(SERVICE_SID).setFriendlyName("NewServiceName").update();

    System.out.println(service.getFriendlyName());
  }
}
curl -XPOST https://chat.twilio.com/v2/Services/ISxxx \
    -d "FriendlyName=AllansService" \
    -u '{twilio account sid}:{twilio auth token}'
{
  "pre_webhook_url": null,
  "read_status_enabled": true,
  "typing_indicator_timeout": 5,
  "limits": {
    "channel_members": 100,
    "user_channels": 250
  },
  "default_service_role_sid": "RLxxx",
  "date_updated": "2016-08-30T13:13:10Z",
  "post_webhook_url": null,
  "reachability_enabled": false,
  "friendly_name": "Test service",
  "account_sid": "ACxxx",
  "consumption_report_interval": 10,
  "notifications": {
    "new_message": {
      "enabled": false
    },
    "invited_to_channel": {
      "enabled": false
    },
    "removed_from_channel": {
      "enabled": false
    },
    "added_to_channel": {
      "enabled": false
    }
  },
  "webhook_method": null,
  "default_channel_creator_role_sid": "RLxxx",
  "url": "https://chat.twilio.com/v2/Services/ISxxx",
  "sid": "ISxxx",
  "webhook_filters": null,
  "date_created": "2016-08-30T13:13:05Z",
  "default_channel_role_sid": "RLxxx",
  "links": {
    "channels": "https://chat.twilio.com/v2/Services/ISxxx/Channels",
    "users": "https://chat.twilio.com/v2/Services/ISxxx/Users",
    "roles": "https://chat.twilio.com/v2/Services/ISxxx/Roles"
  }
}
Update a Service

Delete A Service

`DELETE /Services/ISxxx`
Loading Code Samples...
Language
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
Format:
  • JSON
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var IpMessagingClient = require('twilio').IpMessagingClient;

var client = new IpMessagingClient(accountSid, authToken);

client.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete().then(function(response) {
    console.log(response);
}).fail(function(error) {
    console.log(error);
});
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var Twilio = require('twilio').Twilio;

var client = new Twilio(accountSid, authToken);

client.chat.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove().then(function(response) {
    console.log(response);
}).catch(function(error) {
    console.log(error);
});
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.IpMessaging;
using Twilio.IpMessaging.Model;
using Twilio;

class Example {
	static void Main (string[] args) {
    	// Find your Account Sid and Auth Token at twilio.com/user/account
    	const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    	const string authToken = "your_auth_token";
    	const string serviceSid = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

    	// Delete a service
    	var client = new IpMessagingClient(accountSid, authToken);
    	DeleteStatus status = client.DeleteService(serviceSid);
    	Console.WriteLine(status);
    }
}
<?php

// This line loads the library
require('Services/Twilio.php');

// Find your Account Sid and Token at twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

// Initialize the client
$client = new IPMessaging_Services_Twilio($sid, $token);

// Delete the service
$response = $client->services->delete("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
print $response;
require 'twilio-ruby'

# Initialize the client
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
ip_messaging_client = Twilio::REST::IpMessagingClient.new(account_sid, auth_token)

# Delete the service
service = ip_messaging_client.services.get('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
response = service.delete()
puts response
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Chat.V2;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        const string serviceSid = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

        TwilioClient.Init(accountSid, authToken);

        var status = ServiceResource.Delete(serviceSid);

        Console.WriteLine(status);
    }
}
<?php

// This line loads the library
require '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

// Find your Account Sid and Token at twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

// Initialize the client
$client = new Client($sid, $token);

//Delete the service
$client->chat
    ->services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    ->delete();
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest.ip_messaging import TwilioIpMessagingClient

# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = TwilioIpMessagingClient(account, token)

service = client.services.get(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
response = service.delete()
print(response)
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
service_sid = 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

@client = Twilio::REST::Client.new(account_sid, auth_token)

# Delete the service
service = @client.chat.v2.services(service_sid)
response = service.delete
puts response
import com.twilio.sdk.TwilioIPMessagingClient;
import com.twilio.sdk.resource.instance.ipmessaging.Service;
import com.twilio.sdk.resource.list.ipmessaging.ServiceList;
import com.twilio.sdk.TwilioRestException;

public class TwilioTest {
    // Find your Account Sid and Token at twilio.com/user/account
    public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    public static final String AUTH_TOKEN = "your_auth_token";
    public static final String SERVICE_SID = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

    public static void main(String args[]) throws TwilioRestException {
        // Initialize the client
        TwilioIPMessagingClient client = new TwilioIPMessagingClient(ACCOUNT_SID, AUTH_TOKEN);

        // Retrieve the service
        Service service = client.getService(SERVICE_SID);

        // Delete the service
        boolean didDelete = service.delete();
        System.out.println(didDelete);
    }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = Client(account, token)

response = client.chat.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete()

print(response)
// 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 Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static final String SERVICE_SID = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

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

    // Delete the service
    boolean didDelete = Service.deleter(SERVICE_SID).delete();
    System.out.println(didDelete);
  }
}
curl -XDELETE https://chat.twilio.com/v2/Services/ISxxx \
    -u '{twilio account sid}:{twilio auth token}'
HTTP/1.1 204 NO CONTENT
Delete a Service

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.

1 / 1
Loading Code Samples...
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
Format:
  • JSON
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var IpMessagingClient = require('twilio').IpMessagingClient;

var client = new IpMessagingClient(accountSid, authToken);

client.services.list().then(function(response) {
    console.log(response);
}).fail(function(error) {
    console.log(error);
});
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var Twilio = require('twilio').Twilio;

var client = new Twilio(accountSid, authToken);

client.chat.services.list().then(function(response) {
    console.log(response);
}).catch(function(error) {
    console.log(error);
});
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.IpMessaging;
using Twilio.IpMessaging.Model;

class Example {
    static void Main (string[] args) {
        // Find your Account Sid and Auth Token at twilio.com/user/account
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";

        //List all services
        var client = new IpMessagingClient(accountSid, authToken);
        ServiceResult result = client.ListServices();

        Console.WriteLine(result);
    }
}
<?php

// This line loads the library
require('Services/Twilio.php');

// Find your Account Sid and Token at twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

// Initialize the client
$client = new IPMessaging_Services_Twilio($sid, $token);

// Retrieve the service
$services = $client->services;

$all_services = print_r($services, true);
print $all_services;
require 'twilio-ruby'

# Initialize the client
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
ip_messaging_client = Twilio::REST::IpMessagingClient.new account_sid,
                                                          auth_token

# List the services
services = ip_messaging_client.services.list
puts services
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Chat.V2;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";

        TwilioClient.Init(accountSid, authToken);

        var services = ServiceResource.Read();

        foreach (var service in services)
        {
            Console.WriteLine(service.FriendlyName);
        }
    }
}
<?php

// This line loads the library
require '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

// Find your Account Sid and Token at twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

// Initialize the client
$client = new Client($sid, $token);

// Retrieve the services
$services = $client->chat->services->read();

foreach ($services as $service) {
    echo $service->friendlyName . PHP_EOL;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest.ip_messaging import TwilioIpMessagingClient

# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = TwilioIpMessagingClient(account, token)

for service in client.services.list():
    print(service.sid)
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

@client = Twilio::REST::Client.new(account_sid, auth_token)

@client.chat.v2.services.each do |s|
  puts "#{s.sid} #{s.friendly_name}"
end
import com.twilio.sdk.TwilioIPMessagingClient;
import com.twilio.sdk.resource.instance.ipmessaging.Service;
import com.twilio.sdk.resource.list.ipmessaging.ServiceList;
import com.twilio.sdk.TwilioRestException;

public class TwilioTest {
    // Find your Account Sid and Token at twilio.com/user/account
    public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    public static final String AUTH_TOKEN = "your_auth_token";
    public static final String SERVICE_SID = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

    public static void main(String args[]) throws TwilioRestException {
        // Initialize the client
        TwilioIPMessagingClient client = new TwilioIPMessagingClient(ACCOUNT_SID, AUTH_TOKEN);

        // List the services
        ServiceList list = client.getServices();
        System.out.println(list);
    }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = Client(account, token)

for service in client.chat.services.list():
    print(service.sid)
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.chat.v2.Service;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

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

    // List the services
    ResourceSet<Service> services = Service.reader().read();

    for (Service service : services) {
      System.out.println(service.getFriendlyName());
    }
  }
}
curl -G https://chat.twilio.com/v2/Services \
    -u '{twilio account sid}:{twilio auth token}'
{
  "services": [
    {
      "pre_webhook_url": null,
      "read_status_enabled": true,
      "typing_indicator_timeout": 5,
      "limits": {
        "channel_members": 100,
        "user_channels": 250
      },
      "default_service_role_sid": "RLxxx",
      "date_updated": "2016-08-30T13:13:10Z",
      "post_webhook_url": null,
      "reachability_enabled": false,
      "friendly_name": "Test service",
      "account_sid": "ACxxx",
      "consumption_report_interval": 10,
      "notifications": {
        "new_message": {
          "enabled": false
        },
        "invited_to_channel": {
          "enabled": false
        },
        "removed_from_channel": {
          "enabled": false
        },
        "added_to_channel": {
          "enabled": false
        }
      },
      "webhook_method": null,
      "default_channel_creator_role_sid": "RLxxx",
      "url": "https://chat.twilio.com/v2/Services/ISxxx",
      "sid": "ISxxx",
      "webhook_filters": null,
      "date_created": "2016-08-30T13:13:05Z",
      "default_channel_role_sid": "RLxxx",
      "links": {
        "channels": "https://chat.twilio.com/v2/Services/ISxxx/Channels",
        "users": "https://chat.twilio.com/v2/Services/ISxxx/Users",
        "roles": "https://chat.twilio.com/v2/Services/ISxxx/Roles"
      }
    }
  ],
  "meta": {
    "page": 0,
    "page_size": 50,
    "first_page_url": "https://chat.twilio.com/v2/Services?PageSize=50&Page=0",
    "previous_page_url": null,
    "url": "https://chat.twilio.com/v2/Services?PageSize=50&Page=0",
    "next_page_url": "https://chat.twilio.com/v2/Services?PageSize=50&Page=1&PageToken=PTISxxx",
    "key": "services"
  }
}
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
Format:
  • JSON
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const IpMessagingClient = require('twilio').IpMessagingClient;

const client = new IpMessagingClient(accountSid, authToken);

client.services
  .create({
    friendlyName: 'friendly_name',
  })
  .then(response => {
    console.log(response);
  })
  .fail(error => {
    console.log(error);
  });
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const Twilio = require('twilio').Twilio;

const client = new Twilio(accountSid, authToken);

client.chat.services
  .create({
    friendlyName: 'My Chat service',
  })
  .then(response => {
    console.log(response);
  })
  .catch(error => {
    console.log(error);
  });
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.IpMessaging;
using Twilio.IpMessaging.Model;

class Example {
    static void Main (string[] args) {
        // Find your Account Sid and Auth Token at twilio.com/user/account
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        const string friendlyName = "friendlyName";

        // Create a service
        var client = new IpMessagingClient(accountSid, authToken);
        Service service = client.CreateService(friendlyName);

        Console.WriteLine(service);
    }
}
<?php

// This line loads the library
require('Services/Twilio.php');

// Find your Account Sid and Token at twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

// Initialize the client
$client = new IPMessaging_Services_Twilio($sid, $token);

// Create the service
$service = $client->services->create(array(
    "FriendlyName" => "NEW_SERVICE",
));
print $service->sid;
require 'twilio-ruby'

# Initialize the client
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
ip_messaging_client = Twilio::REST::IpMessagingClient.new account_sid,
                                                          auth_token

# Create the service
service = ip_messaging_client.services.create(friendly_name: 'FRIENDLY_NAME')
puts service
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Chat.V2;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        const string friendlyName = "friendlyName";

        TwilioClient.Init(accountSid, authToken);

        var service = ServiceResource.Create(friendlyName);

        Console.WriteLine(service.FriendlyName);
    }
}
<?php

// This line loads the library
require '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

// Find your Account Sid and Token at twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

// Initialize the client
$client = new Client($sid, $token);

// Create the service
$service = $client->chat
    ->services
    ->create("NEW_SERVICE");

print $service->friendlyName;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest.ip_messaging import TwilioIpMessagingClient

# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = TwilioIpMessagingClient(account, token)

service = client.services.create(friendly_name="FRIENDLY_NAME")
print(service)
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

client = Twilio::REST::Client.new(account_sid, auth_token)

# Create a new service and make note of that service's SID.
new_service = client.chat.v2
                    .services.create(friendly_name: 'An example service')
puts "Created Chat service #{new_service.sid}"
import com.twilio.sdk.TwilioIPMessagingClient;
import com.twilio.sdk.resource.instance.ipmessaging.Service;
import com.twilio.sdk.TwilioRestException;

import java.util.HashMap;
import java.util.Map;

public class TwilioTest {
    // Find your Account Sid and Token at twilio.com/user/account
    public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    public static final String AUTH_TOKEN = "your_auth_token";

    public static void main(String args[]) throws TwilioRestException {
        // Initialize the client
        TwilioIPMessagingClient client = new TwilioIPMessagingClient(ACCOUNT_SID, AUTH_TOKEN);

        // Create the service
        final Map<String, String> serviceParams = new HashMap<String, String>();
        serviceParams.put("FriendlyName", "ServiceName");
        Service service = client.getServices().create(serviceParams);
        System.out.println(service);
    }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = Client(account, token)

service = client.chat.services.create(friendly_name="FRIENDLY_NAME")

print(service.sid)
// 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 Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

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

    // Create the service
    Service service = Service.creator("ServiceName").create();

    System.out.println(service.getFriendlyName());
  }
}
curl -XPOST https://chat.twilio.com/v2/Services \
    -d "FriendlyName=AllansService" \
    -u '{twilio account sid}:{twilio auth token}'
    {
      "pre_webhook_url": null,
      "read_status_enabled": true,
      "typing_indicator_timeout": 5,
      "limits": {
        "channel_members": 100,
        "user_channels": 250
      },
      "default_service_role_sid": "RLxxx",
      "date_updated": "2016-08-30T13:13:10Z",
      "post_webhook_url": null,
      "reachability_enabled": false,
      "friendly_name": "Test service",
      "account_sid": "ACxxx",
      "consumption_report_interval": 10,
      "notifications": {
        "new_message": {
          "enabled": false
        },
        "invited_to_channel": {
          "enabled": false
        },
        "removed_from_channel": {
          "enabled": false
        },
        "added_to_channel": {
          "enabled": false
        }
      },
      "webhook_method": null,
      "default_channel_creator_role_sid": "RLxxx",
      "url": "https://chat.twilio.com/v2/Services/ISxxx",
      "sid": "ISxxx",
      "webhook_filters": null,
      "date_created": "2016-08-30T13:13:05Z",
      "default_channel_role_sid": "RLxxx",
      "links": {
        "channels": "https://chat.twilio.com/v2/Services/ISxxx/Channels",
        "users": "https://chat.twilio.com/v2/Services/ISxxx/Users",
        "roles": "https://chat.twilio.com/v2/Services/ISxxx/Roles"
      }
    }
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
Format:
  • JSON
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const IpMessagingClient = require('twilio').IpMessagingClient;

const client = new IpMessagingClient(accountSid, authToken);

client
  .services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
  .get()
  .then(response => {
    console.log(response);
  })
  .fail(error => {
    console.log(error);
  });
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const Twilio = require('twilio').Twilio;

const client = new Twilio(accountSid, authToken);

client.chat
  .services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
  .fetch()
  .then(response => {
    console.log(response);
  })
  .catch(error => {
    console.log(error);
  });
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.IpMessaging;
using Twilio.IpMessaging.Model;

class Example {
	static void Main (string[] args) {
    	// Find your Account Sid and Auth Token at twilio.com/user/account
    	const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    	const string authToken = "your_auth_token";
    	const string serviceSid = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

    	// Retrieve a service
    	var client = new IpMessagingClient(accountSid, authToken);
    	Service service = client.GetService(serviceSid);
    	Console.WriteLine(service);
 	}
}
<?php

// This line loads the library
require('Services/Twilio.php');

// Find your Account Sid and Token at twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

// Initialize the client
$client = new IPMessaging_Services_Twilio($sid, $token);

// Retrieve the service
$service = $client->services->get("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
print $service;
require 'twilio-ruby'

# Initialize the client
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
ip_messaging_client = Twilio::REST::IpMessagingClient.new(account_sid, auth_token)

#Retrieve the service
service = ip_messaging_client.services.get('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
puts service
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Chat.V2;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        const string serviceSid = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

        TwilioClient.Init(accountSid, authToken);

        var service = ServiceResource.Fetch(serviceSid);

        Console.WriteLine(service.FriendlyName);
    }
}
<?php

// This line loads the library
require '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

// Find your Account Sid and Token at twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

// Initialize the client
$client = new Client($sid, $token);

// Retrieve the service
$service = $client->chat
    ->services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    ->fetch();

print $service->friendlyName;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest.ip_messaging import TwilioIpMessagingClient

# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = TwilioIpMessagingClient(account, token)

# Retrieve the service
service = client.services.get(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
print(service)
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
service_sid = 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Retrieve the service
service = @client.chat.v2.services(service_sid).fetch
puts "Chat service #{service_sid} has Friendly Name \"#{service.friendly_name}\""
import com.twilio.sdk.TwilioIPMessagingClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.ipmessaging.Service;

public class TwilioTest {
    // Find your Account Sid and Token at twilio.com/user/account
    public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    public static final String AUTH_TOKEN = "your_auth_token";
    public static final String SERVICE_SID = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

    public static void main(String args[]) throws TwilioRestException {
        // Initialize the client
        TwilioIPMessagingClient client = new TwilioIPMessagingClient(ACCOUNT_SID, AUTH_TOKEN);

        // Retrieve the service
        Service service = client.getService(SERVICE_SID);
        System.out.println(service);
    }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = Client(account, token)

# Retrieve the service
service = client.chat.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").fetch()

print(service.friendly_name)
// 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 Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static final String SERVICE_SID = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

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

    // Retrieve the service
    Service service = Service.fetcher(SERVICE_SID).fetch();

    System.out.println(service.getFriendlyName());
  }
}
curl -G https://chat.twilio.com/v2/Services/ISxxx \
    -u '{twilio account sid}:{twilio auth token}'
    {
      "pre_webhook_url": null,
      "read_status_enabled": true,
      "typing_indicator_timeout": 5,
      "limits": {
        "channel_members": 100,
        "user_channels": 250
      },
      "default_service_role_sid": "RLxxx",
      "date_updated": "2016-08-30T13:13:10Z",
      "post_webhook_url": null,
      "reachability_enabled": false,
      "friendly_name": "Test service",
      "account_sid": "ACxxx",
      "consumption_report_interval": 10,
      "notifications": {
        "new_message": {
          "enabled": false
        },
        "invited_to_channel": {
          "enabled": false
        },
        "removed_from_channel": {
          "enabled": false
        },
        "added_to_channel": {
          "enabled": false
        }
      },
      "webhook_method": null,
      "default_channel_creator_role_sid": "RLxxx",
      "url": "https://chat.twilio.com/v2/Services/ISxxx",
      "sid": "ISxxx",
      "webhook_filters": null,
      "date_created": "2016-08-30T13:13:05Z",
      "default_channel_role_sid": "RLxxx",
      "links": {
        "channels": "https://chat.twilio.com/v2/Services/ISxxx/Channels",
        "users": "https://chat.twilio.com/v2/Services/ISxxx/Users",
        "roles": "https://chat.twilio.com/v2/Services/ISxxx/Roles"
      }
    }
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
Format:
  • JSON
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var IpMessagingClient = require('twilio').IpMessagingClient;

var client = new IpMessagingClient(accountSid, authToken);

client.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update({
    friendlyName: 'NAME'
}).then(function(response) {
    console.log(response);
}).fail(function(error) {
    console.log(error);
});
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var Twilio = require('twilio').Twilio;

var client = new Twilio(accountSid, authToken);

client.chat.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update({
    friendlyName: 'My new Chat service'
}).then(function(response) {
    console.log(response);
}).catch(function(error) {
    console.log(error);
});
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.IpMessaging;
using Twilio.IpMessaging.Model;
using System.Collections.Generic;

class Example {
    static void Main (string[] args) {
        // Find your Account Sid and Auth Token at twilio.com/user/account
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        const string serviceSid = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string friendlyName = "friendlyName";
        const string defaultServiceRoleSid = "defaultServiceRoleSid";
        const string defaultChannelRoleSid = "defaultChannelRoleSid";
        const string defaultChannelCreatorRoleSid = "defaultChannelCreatorRoleSid";
        const int typingIndicatorTimeout = 5;
        Dictionary<string, string> webhooksParams = new Dictionary<string, string>();

        // Update a service
        var client = new IpMessagingClient(accountSid, authToken);
        Service service = client.UpdateService(serviceSid,
            friendlyName,
            defaultServiceRoleSid,
            defaultChannelRoleSid,
            defaultChannelCreatorRoleSid,
            typingIndicatorTimeout,
            webhooksParams);

        Console.WriteLine(service);
    }
}
<?php

// This line loads the library
require('Services/Twilio.php');

// Find your Account Sid and Token at twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

// Initialize the client
$client = new IPMessaging_Services_Twilio($sid, $token);

// Update the service
$service = $client->services->get("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
$response = $service->update(array(
    "FriendlyName" => "NEW_FRIENDLY_NAME",
));
print $response;
require 'twilio-ruby'

# Initialize the client
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
ip_messaging_client = Twilio::REST::IpMessagingClient.new(account_sid, auth_token)

# Update the service
service = ip_messaging_client.services.get('FRIENDLY_NAME')
response = service.update(friendly_name: 'NEW_SID')
puts response
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Chat.V2;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        const string serviceSid = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string friendlyName = "friendlyName";
        const string defaultServiceRoleSid = "defaultServiceRoleSid";
        const string defaultChannelRoleSid = "defaultChannelRoleSid";
        const string defaultChannelCreatorRoleSid = "defaultChannelCreatorRoleSid";
        const int typingIndicatorTimeout = 5;

        TwilioClient.Init(accountSid, authToken);

        var service = ServiceResource.Update(serviceSid,
                                             friendlyName,
                                             defaultServiceRoleSid,
                                             defaultChannelRoleSid,
                                             defaultChannelCreatorRoleSid,
                                             typingIndicatorTimeout: typingIndicatorTimeout);

        Console.WriteLine(service.FriendlyName);
    }
}
<?php

// This line loads the library
require '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

// Find your Account Sid and Token at twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

// Initialize the client
$client = new Client($sid, $token);

// Update the service
$service = $client->chat
    ->services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    ->update(
        array("friendlyName" => "NEW_FRIENDLY_NAME")
    );

echo $service->friendlyName;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest.ip_messaging import TwilioIpMessagingClient

# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = TwilioIpMessagingClient(account, token)

service = client.services.get(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
response = service.update(friendly_name="NEW_FRIENDLY_NAME")
print(response)
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
service_sid = 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Update the service with something new.
new_role_sid = 'RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
service = @client.chat.v2.services(service_sid)
response = service.update(default_service_role_sid: new_role_sid)
puts "Updated role sid to #{response.default_service_role_sid}!"
import com.twilio.sdk.TwilioIPMessagingClient;
import com.twilio.sdk.resource.instance.ipmessaging.Service;
import com.twilio.sdk.TwilioRestException;

import java.util.HashMap;
import java.util.Map;

public class TwilioTest {
    // Find your Account Sid and Token at twilio.com/user/account
    public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    public static final String AUTH_TOKEN = "your_auth_token";
    public static final String SERVICE_SID = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

    public static void main(String args[]) throws TwilioRestException {
        // Initialize the client
        TwilioIPMessagingClient client = new TwilioIPMessagingClient(ACCOUNT_SID, AUTH_TOKEN);

        // Retrieve the service
        Service service = client.getService(SERVICE_SID);

        // Update the service
        final Map<String, String> serviceParams = new HashMap<String, String>();
        serviceParams.put("FriendlyName", "NewServiceName");
        service.update(serviceParams);
        System.out.println(service);
    }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = Client(account, token)

service = client.chat.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update(
    friendly_name="NEW_FRIENDLY_NAME"
)

print(service.friendly_name)
// 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 Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static final String SERVICE_SID = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

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

    // Update the service
    Service service = Service.updater(SERVICE_SID).setFriendlyName("NewServiceName").update();

    System.out.println(service.getFriendlyName());
  }
}
curl -XPOST https://chat.twilio.com/v2/Services/ISxxx \
    -d "FriendlyName=AllansService" \
    -u '{twilio account sid}:{twilio auth token}'
{
  "pre_webhook_url": null,
  "read_status_enabled": true,
  "typing_indicator_timeout": 5,
  "limits": {
    "channel_members": 100,
    "user_channels": 250
  },
  "default_service_role_sid": "RLxxx",
  "date_updated": "2016-08-30T13:13:10Z",
  "post_webhook_url": null,
  "reachability_enabled": false,
  "friendly_name": "Test service",
  "account_sid": "ACxxx",
  "consumption_report_interval": 10,
  "notifications": {
    "new_message": {
      "enabled": false
    },
    "invited_to_channel": {
      "enabled": false
    },
    "removed_from_channel": {
      "enabled": false
    },
    "added_to_channel": {
      "enabled": false
    }
  },
  "webhook_method": null,
  "default_channel_creator_role_sid": "RLxxx",
  "url": "https://chat.twilio.com/v2/Services/ISxxx",
  "sid": "ISxxx",
  "webhook_filters": null,
  "date_created": "2016-08-30T13:13:05Z",
  "default_channel_role_sid": "RLxxx",
  "links": {
    "channels": "https://chat.twilio.com/v2/Services/ISxxx/Channels",
    "users": "https://chat.twilio.com/v2/Services/ISxxx/Users",
    "roles": "https://chat.twilio.com/v2/Services/ISxxx/Roles"
  }
}
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
Format:
  • JSON
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var IpMessagingClient = require('twilio').IpMessagingClient;

var client = new IpMessagingClient(accountSid, authToken);

client.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete().then(function(response) {
    console.log(response);
}).fail(function(error) {
    console.log(error);
});
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var Twilio = require('twilio').Twilio;

var client = new Twilio(accountSid, authToken);

client.chat.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove().then(function(response) {
    console.log(response);
}).catch(function(error) {
    console.log(error);
});
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.IpMessaging;
using Twilio.IpMessaging.Model;
using Twilio;

class Example {
	static void Main (string[] args) {
    	// Find your Account Sid and Auth Token at twilio.com/user/account
    	const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    	const string authToken = "your_auth_token";
    	const string serviceSid = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

    	// Delete a service
    	var client = new IpMessagingClient(accountSid, authToken);
    	DeleteStatus status = client.DeleteService(serviceSid);
    	Console.WriteLine(status);
    }
}
<?php

// This line loads the library
require('Services/Twilio.php');

// Find your Account Sid and Token at twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

// Initialize the client
$client = new IPMessaging_Services_Twilio($sid, $token);

// Delete the service
$response = $client->services->delete("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
print $response;
require 'twilio-ruby'

# Initialize the client
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
ip_messaging_client = Twilio::REST::IpMessagingClient.new(account_sid, auth_token)

# Delete the service
service = ip_messaging_client.services.get('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
response = service.delete()
puts response
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Chat.V2;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        const string serviceSid = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

        TwilioClient.Init(accountSid, authToken);

        var status = ServiceResource.Delete(serviceSid);

        Console.WriteLine(status);
    }
}
<?php

// This line loads the library
require '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

// Find your Account Sid and Token at twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

// Initialize the client
$client = new Client($sid, $token);

//Delete the service
$client->chat
    ->services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    ->delete();
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest.ip_messaging import TwilioIpMessagingClient

# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = TwilioIpMessagingClient(account, token)

service = client.services.get(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
response = service.delete()
print(response)
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
service_sid = 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

@client = Twilio::REST::Client.new(account_sid, auth_token)

# Delete the service
service = @client.chat.v2.services(service_sid)
response = service.delete
puts response
import com.twilio.sdk.TwilioIPMessagingClient;
import com.twilio.sdk.resource.instance.ipmessaging.Service;
import com.twilio.sdk.resource.list.ipmessaging.ServiceList;
import com.twilio.sdk.TwilioRestException;

public class TwilioTest {
    // Find your Account Sid and Token at twilio.com/user/account
    public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    public static final String AUTH_TOKEN = "your_auth_token";
    public static final String SERVICE_SID = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

    public static void main(String args[]) throws TwilioRestException {
        // Initialize the client
        TwilioIPMessagingClient client = new TwilioIPMessagingClient(ACCOUNT_SID, AUTH_TOKEN);

        // Retrieve the service
        Service service = client.getService(SERVICE_SID);

        // Delete the service
        boolean didDelete = service.delete();
        System.out.println(didDelete);
    }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = Client(account, token)

response = client.chat.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete()

print(response)
// 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 Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static final String SERVICE_SID = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

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

    // Delete the service
    boolean didDelete = Service.deleter(SERVICE_SID).delete();
    System.out.println(didDelete);
  }
}
curl -XDELETE https://chat.twilio.com/v2/Services/ISxxx \
    -u '{twilio account sid}:{twilio auth token}'
HTTP/1.1 204 NO CONTENT