Create a new Service resource.
The top-level resource for a Serverless application, which serves as a container for the application environments.
Create a new Service resource.
Body
-
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. -
A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters.
-
Whether to inject Account credentials into a function invocation context. The default value is
true
. -
Whether the Service's properties and subresources can be edited via the UI. The default value is
false
.
POST
/v1/Services
curl \
--request POST 'https://serverless.twilio.com/v1/Services' \
--user "username:password" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'UniqueName=service-unique&FriendlyName=service-friendly'
Request example
{"UniqueName"=>"service-unique", "FriendlyName"=>"service-friendly"}
Response examples (201)
{
"sid": "ZS00000000000000000000000000000000",
"url": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000",
"links": {
"assets": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Assets",
"builds": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Builds",
"functions": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Functions",
"environments": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments"
},
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"domain_base": "service-unique-1234",
"ui_editable": false,
"unique_name": "service-unique",
"date_created": "2018-11-10T20:00:00Z",
"date_updated": "2018-11-10T20:00:00Z",
"friendly_name": "service-friendly",
"include_credentials": true
}