Receive a call

Configuration

Set the parameter voice_start on your voice-enabled Virtual Phone Number to https://yourapp.example/elks/calls (or wherever your webhook code is). We'll make an HTTP POST request to this URL every time someone calls your number.

Alternatively, you can set the value of voice_start to a stringified JSON object of call actions.

Request

POST https://yourapp.example/elks/calls
Example payload
direction=incoming&
callid=c45072a1eeafebccc3dffbd4d27b5ebcc&
from=%2B46706861004&
to=%2B46706860000

Request parameters

Parameter Description
callid The unique ID of the call in our systems.
from The sender of the call.
to The phone number receiving the call.
created The time in UTC when the call object was created in our systems.

Response structure

You must respond with a valid JSON struct of call actions. For example:

{
  "play": "http://yourapp.example/message.mp3",
  "next": {
    "connect": "+46766860001",
    "busy": {
      "connect": "+46766860002"
    }
  }
}

Your webhook code must respond with a HTTP status in the range 200-204. If not, the API will consider the request failed and keep trying for at least 6 hours and at least 5 times per callback.