Create validation request

POST /2010-04-01/Accounts/{AccountSid}/OutgoingCallerIds.json

An OutgoingCallerId resource represents a single verified number that may be used as a caller ID when making outgoing calls via the REST API and within the TwiML verb.

Path parameters

  • AccountSid string Required

    The SID of the Account responsible for the new caller ID resource.

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

application/x-www-form-urlencoded

Body

  • PhoneNumber string(phone-number) Required

    The phone number to verify in E.164 format, which consists of a + followed by the country code and subscriber number.

  • FriendlyName string

    A descriptive string that you create to describe the new caller ID resource. It can be up to 64 characters long. The default value is a formatted version of the phone number.

  • CallDelay integer

    The number of seconds to delay before initiating the verification call. Can be an integer between 0 and 60, inclusive. The default is 0.

  • Extension string

    The digits to dial after connecting the verification call.

  • StatusCallback string(uri)

    The URL we should call using the status_callback_method to send status information about the verification process to your application.

  • StatusCallbackMethod string(http-method)

    The HTTP method we should use to call status_callback. Can be: GET or POST, and the default is POST.

    Values are GET or POST.

Responses

  • 200 application/json

    OK

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • account_sid string | null

      The SID of the Account responsible for the Caller ID.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

    • call_sid string | null

      The SID of the Call the Caller ID is associated with.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^CA[0-9a-fA-F]{32}$.

    • friendly_name string | null

      The string that you assigned to describe the resource.

    • phone_number string(phone-number) | null

      The phone number to verify in E.164 format, which consists of a + followed by the country code and subscriber number.

    • validation_code string | null

      The 6 digit validation code that someone must enter to validate the Caller ID when phone_number is called.

POST /2010-04-01/Accounts/{AccountSid}/OutgoingCallerIds.json
curl \
 --request POST 'https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/OutgoingCallerIds.json' \
 --user "username:password" \
 --header "Content-Type: application/x-www-form-urlencoded" \
 --data 'CallDelay=100&Extension=extension&PhoneNumber=%2B18001234567&FriendlyName=friendly_name&StatusCallback=http%3A%2F%2Fwww.example.com&StatusCallbackMethod=GET'
Request example
{"CallDelay"=>100, "Extension"=>"extension", "PhoneNumber"=>"+18001234567", "FriendlyName"=>"friendly_name", "StatusCallback"=>"http://www.example.com", "StatusCallbackMethod"=>"GET"}
Response examples (200)
{
  "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "phone_number": "+18001234567",
  "friendly_name": "friendly_name",
  "validation_code": "111111"
}