Create phone number
A Messaging Service resource to add, fetch or remove phone numbers from a Messaging Service.
Path parameters
-
The SID of the Service to create the resource under.
Body
-
The SID of the Phone Number being added to the Service.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^PN[0-9a-fA-F]{32}$
.
POST /v1/Services/{ServiceSid}/PhoneNumbers
curl \
-X POST https://messaging.twilio.com/v1/Services/{ServiceSid}/PhoneNumbers \
--user "username:password" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d 'PhoneNumberSid=string'
Request example
{
"PhoneNumberSid": "string"
}
Request examples
{
"PhoneNumberSid": "string"
}
Response examples (201)
{
"account_sid": "string",
"capabilities": [
"string"
],
"country_code": "string",
"date_created": "2023-05-04T09:42:00+00:00",
"date_updated": "2023-05-04T09:42:00+00:00",
"phone_number": "string",
"service_sid": "string",
"sid": "string",
"url": "https://example.com"
}
Response examples (201)
{
"account_sid": "string",
"capabilities": [
"string"
],
"country_code": "string",
"date_created": "2024-05-04T09:42:00+00:00",
"date_updated": "2024-05-04T09:42:00+00:00",
"phone_number": "string",
"service_sid": "string",
"sid": "string",
"url": "https://example.com"
}