Configure a virtual phone number

Request

POST https://api.46elks.com/a1/numbers/{id}

Request parameters

Parameter Example Description
sms_url http://yourapp.example/new_sms
{forward":"+46700000000"}
A webhook URL for incoming SMS or a JSON struct, see Receive an SMS for details.
mms_url http://yourapp.example/new_mms A webhook URL for incoming MMS or a JSON struct, see Receive an MMS for details.
voice_start http://yourapp.example/new_call
{"connect":"+46700000000"}
A webhook URL for incoming voice calls, see Receive a call for details.
sms_replies no
yes
no prevents automatic reply of messages if your endpoint gives a response back. yes is the default setting and allow automatic reply.
name Your name for the number Optional field where you can set a name for the number for your reference. Maximum length is 50 characters

If you want to remove a previously set sms_url, you can do so in the dashboard.
The special string "none" and " " (single space) also clears a field.

Response structure

Example JSON response
{
  "id": "n57c8f48af76bf986a14f251b35389e8b",
  "active": "yes",
  "country": "se",
  "number": "+46766861001",
  "capabilities": [ "sms", "voice", "mms" ],
  "sms_url": "https://yourapp.example/elks/sms",
  "mms_url": "https://yourapp.example/elks/mms",
  "voice_start": "https://yourapp.example/elks/calls",
  "name": "Support phone"
}
Parameter Type Description
id string ID of the allocated number
active string If the number is active or not, allways "yes" on newly allocated numbers
country string A two-letter (ISO alpha 2) country code.
number string The phone number in E.164 format.
capabilities list A comma-seperated string denoting the capabilities the number should have. For example "sms", "sms,voice" or "sms,mms,voice".
sms_url string If the number has SMS support this url it where the API will send incomming SMS.
voice_start string If the number has Voice support this url it where the API will send incomming calls to be handeled.
mms_url string if the number has mms support this url it where the api will send incomming mms.
name string if the number has the name field specified this field will be present containing the name.