The Service Resource is currently available as a Public Beta product. This means that some features for configuring your Messaging Service via the REST API are not yet implemented, and others may be changed before the product is declared Generally Available. Messaging Service Configuration through the Twilio Console is Generally Available.
Public Beta products are not covered by a Twilio SLA.
The resources for sending Messages with a Messaging Service are Generally Available.
The PhoneNumber subresource of a Service instance represents a phone number you have associated to the Service.
When sending a message with your Messaging Service, Twilio will select a phone number from the service for delivery.
Inbound messages received on any phone number associated to a Messaging Service are passed to the inbound request URL of the Service with the TWiML parameters that describe the message.
sid
type: SID<PN>The unique string that we created to identify the PhoneNumber resource.
^PN[0-9a-fA-F]{32}$
34
34
account_sid
type: SID<AC>The SID of the Account that created the PhoneNumber resource.
^AC[0-9a-fA-F]{32}$
34
34
service_sid
type: SID<MG>The SID of the Service the resource is associated with.
^MG[0-9a-fA-F]{32}$
34
34
date_created
type: string<date-time>The date and time in GMT when the resource was created specified in ISO 8601 format.
date_updated
type: string<date-time>The date and time in GMT when the resource was last updated specified in ISO 8601 format.
phone_number
type: string<phone-number>The phone number in E.164 format, which consists of a + followed by the country code and subscriber number.
capabilities
type: array[string]An array of values that describe whether the number can receive calls or messages. Can be: Voice
, SMS
, and MMS
.
POST https://messaging.twilio.com/v1/Services/{ServiceSid}/PhoneNumbers
Add a Phone Number to your Messaging Service by creating a PhoneNumber resource.
Each Service can have no more than 400 phone numbers by default. If you think you might need a higher limit, contact Twilio Support about a Messaging Service number limit increase, and include an explanation of your use case.
ServiceSid
type: SID<MG>The SID of the Service to create the resource under.
^MG[0-9a-fA-F]{32}$
34
34
PhoneNumberSid
type: SID<PN>RequiredThe SID of the Phone Number being added to the Service.
^PN[0-9a-fA-F]{32}$
34
34
Create a PhoneNumber Resource to add it to a Messaging Service
GET https://messaging.twilio.com/v1/Services/{ServiceSid}/PhoneNumbers/{Sid}
GET https://messaging.twilio.com/v1/Services/{ServiceSid}/PhoneNumbers
ServiceSid
type: SID<MG>The SID of the Service to read the resources from.
^MG[0-9a-fA-F]{32}$
34
34
PageSize
type: integerHow many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Page
type: integerThe page index. This value is simply for client state.
0
DELETE https://messaging.twilio.com/v1/Services/{ServiceSid}/PhoneNumbers/{Sid}
Removing a phone number from the Service does not release the number from your account. You must release a phone number from your Account to disassociate and delete the phone number from the Service.
Returns a "204 NO CONTENT" if the phone number was successfully removed from the service.