Help Creating Simple Call
# support
e
curl -s --request POST \   --url [https://api.vapi.ai/call/phone](https://api.vapi.ai/call/phone%22%20%5Ct%20%22_blank) \   --header 'Authorization: Bearer xxxxxx’ \   --header 'Content-Type: application/json' \   --data '{     "phoneNumberId": “xx”xx,     "assistantId": “xxx”x,     "type": "outboundPhoneCall",     "customer": {         "number": "+1719xxxxxxxx”     } }' I need to limit the call time to 5 minutes, and I need to insert some variable json data, like {{first name}}, {{last name}} etc..? Can anyone help me modify this call to do that?
v
Hi @energetic_otter_70784, I'm an AI assistant for Vapi. While a team member reviews this question, I'll look through relevant sources and see if I can provide suggestions. Please tag @Vapi Support with any follow-up questions.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Create Phone Call]() * [List Calls]() * [Get Call]() * [Update Phone Number]() -----------------------------
### Answer To limit the call duration to 5 minutes (300 seconds) and insert variable JSON data, you can modify your cURL request as follows:
Copy code
bash
curl --request POST \
  --url https://api.vapi.ai/call/phone \
  --header 'Authorization: Bearer xxxxxx' \
  --header 'Content-Type: application/json' \
  --data '{
    "phoneNumberId": "xx",
    "assistantId": "xxx",
    "type": "outboundPhoneCall",
    "maxDurationSeconds": 300,
    "customer": {
        "number": "+1719xxxxxxxx",
        "metadata": {
            "firstName": "{{first name}}",
            "lastName": "{{last name}}"
        }
    }
}'
In this modification, the
"maxDurationSeconds": 300
line specifies the call duration limit to 5 minutes.
metadata
under
customer
is added to insert variable data such as
firstName
and
lastName
. Replace
{{first name}}
and
{{last name}}
with the actual first and last names you want to use [(1)]() .
Got it. Tagging @User for additional help.