Help with the apiRequest
# support
a
I'm not able to return a variable from a request using the apiRequest tool. I see that it's available, but the assistant can't see it or use it. Has anyone ever got this issue? Response Body for the GET Request: [ { "id": 13, "created_at": "2025-08-17T13:44:36.479866+00:00", "name": "Artur", "description": "add post", "phone": "0000000" } ] https://cdn.discordapp.com/attachments/1413339353375178793/1413339354226495559/Screenshot_2025-09-05_024137.png?ex=68bb9258&is=68ba40d8&hm=fce5bb2c6fe54edfeb717489755593f0c23ebc7b8d28a2c6f6b2474426fe22b4&
v
Try this alias mapping for your API Request tool:
Copy code
yaml
caller_name: {{ $[0].name }}
Make sure this alias is set in your output schema or variable extraction section. This will extract the
name
from the first object in your response array and make it available as
{{caller_name}}
for your assistant to use. If the variable is still missing, double-check the alias path and ensure your output schema matches the response structure. [See more in the documentation.](https://docs.vapi.ai/workflows/nodes/api-request#usage) Source: - [API Request Node Documentation](https://docs.vapi.ai/workflows/nodes/api-request#usage)
v
Message marked as helpful by @Artur Pires! 🎉
a
Is there a way to get the caller's number as soon as they call?
c
Yes, you can get the caller's number when a call starts ringing using phone number hooks. Specifically, you can set up a
call.ringing
event hook which triggers as soon as a call comes in[1](https://docs.vapi.ai/phone-numbers/phone-number-hooks). Here's how to configure it:
Copy code
curl -X PATCH "https://api.vapi.ai/phone-number/<id>" \     -H "Authorization: Bearer <auth>" \     -H "Content-Type: application/json" \     -d '{  "hooks": [{    "on": "call.ringing",    "do": [{      "type": "say",      "exact": "inbound calling detected"    }]  }]}'
At this point, you can: 1. Access the caller's information in the webhook payload 2. Take actions like: - Playing a message - Transferring the call - Handling the call based on the caller's number
3 Views