# Service

Services are containers for your environments. You may only need one Service with many environments. When you begin working on a new application, you will likely want to create a new Service.

> \[!WARNING]
>
> The unique name of your service forms the first part of your Serverless domain and cannot be updated.

## Service Properties

```json
{"type":"object","refName":"serverless.v1.service","modelName":"serverless_v1_service","properties":{"sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^ZS[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 Service resource.","x-twilio":{"pii":{"handling":"standard","deleteSla":7}}},"unique_name":{"type":"string","nullable":true,"description":"A user-defined string that uniquely identifies the Service resource. It can be used in place of the Service resource's `sid` in the URL to address the Service resource.","x-twilio":{"pii":{"handling":"standard","deleteSla":7}}},"include_credentials":{"type":"boolean","nullable":true,"description":"Whether to inject Account credentials into a function invocation context."},"ui_editable":{"type":"boolean","nullable":true,"description":"Whether the Service resource's properties and subresources can be edited via the UI."},"domain_base":{"type":"string","nullable":true,"description":"The base domain name for this Service, which is a combination of the unique name and a randomly generated string."},"date_created":{"type":"string","format":"date-time","nullable":true,"description":"The date and time in GMT when the Service 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 Service resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format."},"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 URLs of the Service's nested resources."}}}
```

## Create a Service resource

`POST https://serverless.twilio.com/v1/Services`

### Request body parameters

```json
{"schema":{"type":"object","title":"CreateServiceRequest","required":["UniqueName","FriendlyName"],"properties":{"UniqueName":{"type":"string","description":"A user-defined string that uniquely identifies the Service resource. It can be used as an alternative to the `sid` in the URL path to address the Service resource. This value must be 50 characters or less in length and be unique.","x-twilio":{"pii":{"handling":"standard","deleteSla":7}}},"FriendlyName":{"type":"string","description":"A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters.","x-twilio":{"pii":{"handling":"standard","deleteSla":7}}},"IncludeCredentials":{"type":"boolean","description":"Whether to inject Account credentials into a function invocation context. The default value is `true`."},"UiEditable":{"type":"boolean","description":"Whether the Service's properties and subresources can be edited via the UI. The default value is `false`."}}},"examples":{"create":{"value":{"lang":"json","value":"{\n  \"FriendlyName\": \"service-friendly\",\n  \"UniqueName\": \"service-unique\"\n}","meta":"","code":"{\n  \"FriendlyName\": \"service-friendly\",\n  \"UniqueName\": \"service-unique\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"FriendlyName\"","#7EE787"],[":","#C9D1D9"]," ",["\"service-friendly\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"UniqueName\"","#7EE787"],[":","#C9D1D9"]," ",["\"service-unique\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

Create Service

```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.serverless.v1.services.create({
    friendlyName: "My New App",
    includeCredentials: true,
    uniqueName: "my-new-app",
  });

  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.serverless.v1.services.create(
    unique_name="my-new-app",
    friendly_name="My New App",
    include_credentials=True,
)

print(service.sid)
```

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

using System;
using Twilio;
using Twilio.Rest.Serverless.V1;
using System.Threading.Tasks;

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

        TwilioClient.Init(accountSid, authToken);

        var service = await ServiceResource.CreateAsync(
            uniqueName: "my-new-app", friendlyName: "My New App", includeCredentials: true);

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

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

import com.twilio.Twilio;
import com.twilio.rest.serverless.v1.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("my-new-app", "My New App").setIncludeCredentials(true).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"
	serverless "github.com/twilio/twilio-go/rest/serverless/v1"
	"os"
)

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

	params := &serverless.CreateServiceParams{}
	params.SetUniqueName("my-new-app")
	params.SetFriendlyName("My New App")
	params.SetIncludeCredentials(true)

	resp, err := client.ServerlessV1.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->serverless->v1->services->create(
    "my-new-app", // UniqueName
    "My New App", // FriendlyName
    ["includeCredentials" => true]
);

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
          .serverless
          .v1
          .services
          .create(
            unique_name: 'my-new-app',
            friendly_name: 'My New App',
            include_credentials: true
          )

puts service.sid
```

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

twilio api:serverless:v1:services:create \
   --unique-name my-new-app \
   --friendly-name "My New App" \
   --include-credentials
```

```bash
curl -X POST "https://serverless.twilio.com/v1/Services" \
--data-urlencode "UniqueName=my-new-app" \
--data-urlencode "FriendlyName=My New App" \
--data-urlencode "IncludeCredentials=true" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "sid": "ZS00000000000000000000000000000000",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "friendly_name": "My New App",
  "unique_name": "my-new-app",
  "include_credentials": true,
  "ui_editable": false,
  "domain_base": "service-unique-1234",
  "date_created": "2018-11-10T20:00:00Z",
  "date_updated": "2018-11-10T20:00:00Z",
  "url": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000",
  "links": {
    "environments": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments",
    "functions": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Functions",
    "assets": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Assets",
    "builds": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Builds"
  }
}
```

## Fetch a Service resource

`GET https://serverless.twilio.com/v1/Services/{Sid}`

### Path parameters

```json
[{"name":"Sid","in":"path","description":"The `sid` or `unique_name` of the Service resource to fetch.","schema":{"type":"string"},"required":true}]
```

Fetch a Service

```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.serverless.v1.services("Sid").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.serverless.v1.services("Sid").fetch()

print(service.sid)
```

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

using System;
using Twilio;
using Twilio.Rest.Serverless.V1;
using System.Threading.Tasks;

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

        TwilioClient.Init(accountSid, authToken);

        var service = await ServiceResource.FetchAsync(pathSid: "Sid");

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

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

import com.twilio.Twilio;
import com.twilio.rest.serverless.v1.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("Sid").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.ServerlessV1.FetchService("Sid")
	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->serverless->v1->services("Sid")->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
          .serverless
          .v1
          .services('Sid')
          .fetch

puts service.sid
```

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

twilio api:serverless:v1:services:fetch \
   --sid Sid
```

```bash
curl -X GET "https://serverless.twilio.com/v1/Services/Sid" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "sid": "Sid",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "friendly_name": "test-service",
  "unique_name": "test-service-1",
  "include_credentials": true,
  "ui_editable": false,
  "domain_base": "test-service-1-1234",
  "date_created": "2018-11-10T20:00:00Z",
  "date_updated": "2018-11-10T20:00:00Z",
  "url": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000",
  "links": {
    "environments": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments",
    "functions": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Functions",
    "assets": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Assets",
    "builds": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Builds"
  }
}
```

## Read multiple Service resources

`GET https://serverless.twilio.com/v1/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 1000.","schema":{"type":"integer","format":"int64","minimum":1,"maximum":1000}},{"name":"Page","in":"query","description":"The page index. This value is simply for client state.","schema":{"type":"integer","minimum":0}},{"name":"PageToken","in":"query","description":"The page token. This is provided by the API.","schema":{"type":"string"}}]
```

List multiple Services

```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.serverless.v1.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.serverless.v1.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.Serverless.V1;
using System.Threading.Tasks;

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

        TwilioClient.Init(accountSid, authToken);

        var 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.serverless.v1.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"
	serverless "github.com/twilio/twilio-go/rest/serverless/v1"
	"os"
)

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

	params := &serverless.ListServiceParams{}
	params.SetLimit(20)

	resp, err := client.ServerlessV1.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->serverless->v1->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
           .serverless
           .v1
           .services
           .list(limit: 20)

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

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

twilio api:serverless:v1:services:list
```

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

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

## Update a Service resource

`POST https://serverless.twilio.com/v1/Services/{Sid}`

### Path parameters

```json
[{"name":"Sid","in":"path","description":"The `sid` or `unique_name` of the Service resource to update.","schema":{"type":"string"},"required":true}]
```

### Request body parameters

```json
{"schema":{"type":"object","title":"UpdateServiceRequest","properties":{"IncludeCredentials":{"type":"boolean","description":"Whether to inject Account credentials into a function invocation context."},"FriendlyName":{"type":"string","description":"A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters.","x-twilio":{"pii":{"handling":"standard","deleteSla":7}}},"UiEditable":{"type":"boolean","description":"Whether the Service resource's properties and subresources can be edited via the UI. The default value is `false`."}}},"examples":{"update":{"value":{"lang":"json","value":"{\n  \"FriendlyName\": \"service-friendly-update\",\n  \"IncludeCredentials\": true,\n  \"UiEditable\": true\n}","meta":"","code":"{\n  \"FriendlyName\": \"service-friendly-update\",\n  \"IncludeCredentials\": true,\n  \"UiEditable\": true\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"FriendlyName\"","#7EE787"],[":","#C9D1D9"]," ",["\"service-friendly-update\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"IncludeCredentials\"","#7EE787"],[":","#C9D1D9"]," ",["true","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"UiEditable\"","#7EE787"],[":","#C9D1D9"]," ",["true","#79C0FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

Update a Service to be editable in the Console UI

```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.serverless.v1
    .services("Sid")
    .update({ uiEditable: true });

  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.serverless.v1.services("Sid").update(ui_editable=True)

print(service.sid)
```

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

using System;
using Twilio;
using Twilio.Rest.Serverless.V1;
using System.Threading.Tasks;

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

        TwilioClient.Init(accountSid, authToken);

        var service = await ServiceResource.UpdateAsync(uiEditable: true, pathSid: "Sid");

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

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

import com.twilio.Twilio;
import com.twilio.rest.serverless.v1.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("Sid").setUiEditable(true).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"
	serverless "github.com/twilio/twilio-go/rest/serverless/v1"
	"os"
)

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

	params := &serverless.UpdateServiceParams{}
	params.SetUiEditable(true)

	resp, err := client.ServerlessV1.UpdateService("Sid",
		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->serverless->v1
    ->services("Sid")
    ->update(["uiEditable" => true]);

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
          .serverless
          .v1
          .services('Sid')
          .update(ui_editable: true)

puts service.sid
```

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

twilio api:serverless:v1:services:update \
   --sid Sid \
   --ui-editable
```

```bash
curl -X POST "https://serverless.twilio.com/v1/Services/Sid" \
--data-urlencode "UiEditable=true" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "sid": "Sid",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "friendly_name": "service-friendly-update",
  "unique_name": "service-unique-update",
  "include_credentials": true,
  "ui_editable": true,
  "domain_base": "service-unique-update-1234",
  "date_created": "2018-11-10T20:00:00Z",
  "date_updated": "2018-11-10T20:00:00Z",
  "url": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000",
  "links": {
    "environments": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments",
    "functions": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Functions",
    "assets": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Assets",
    "builds": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Builds"
  }
}
```

## Delete a Service resource

`DELETE https://serverless.twilio.com/v1/Services/{Sid}`

### Path parameters

```json
[{"name":"Sid","in":"path","description":"The `sid` or `unique_name` of the Service resource to delete.","schema":{"type":"string"},"required":true}]
```

Delete a Service

```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.serverless.v1.services("Sid").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.serverless.v1.services("Sid").delete()
```

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

using System;
using Twilio;
using Twilio.Rest.Serverless.V1;
using System.Threading.Tasks;

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

        TwilioClient.Init(accountSid, authToken);

        await ServiceResource.DeleteAsync(pathSid: "Sid");
    }
}
```

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

import com.twilio.Twilio;
import com.twilio.rest.serverless.v1.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("Sid").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.ServerlessV1.DeleteService("Sid")
	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->serverless->v1->services("Sid")->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
  .serverless
  .v1
  .services('Sid')
  .delete
```

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

twilio api:serverless:v1:services:remove \
   --sid Sid
```

```bash
curl -X DELETE "https://serverless.twilio.com/v1/Services/Sid" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```
