rival-black
rival-black2d ago

Extract call id from workflow used for incoming calls

Hello, is it possible to get the call id somehow before or at the start of the workflow? I checked some answers like to use call.id(call object does not exist in workflow, call.id is always empty), or create a webhook on call start(there isn't any option to create webhook in VAPI UI at the moment). Is it possible to somehow get the call id?
14 Replies
Vapi Support Bot
Thank you for your question! To clarify, are you looking to access the call ID within the workflow logic itself (e.g., in a script or node), or do you need to retrieve it externally via API or dashboard right as the call starts? This will help me suggest the most relevant approach for your use case. Sources: - Vapi API Reference: Get Call - Vapi Issue Reporting: Finding Your Call ID
⤵️ Mention @Vapi Support Bot for follow-ups 🐥
rival-black
rival-blackOP2d ago
I'd prefer to have access to it within the workflow, but if I can get it using an API as the call starts it would be ok as well. (Of course I do not want to find the call id manually just to clarify) @Duckie
Vapi Support Bot
Thank you for clarifying your preference. To help suggest the best approach: Are you using any custom nodes (like API Request) or scripting within your workflow, or are you limited to the standard workflow builder UI? This will help determine if there’s a way to programmatically access the call ID at the start of the workflow. Sources: - Vapi API Reference: Get Call - Vapi Workflows: API Request Node
rival-black
rival-blackOP2d ago
I use the standard workflow builder UI @Duckie
Vapi Support Bot
Currently, the standard workflow builder UI does not provide access to the call ID within workflow nodes. If you need the call ID as soon as a call starts, the recommended approach is to set up a Server URL (webhook) programmatically for your phone number—this will send call events (including the call ID) to your endpoint automatically. Unfortunately, this cannot be configured directly in the UI at this time.
Reference: Vapi Workflows: API Request Node Source: - Vapi Workflows: API Request Node
rival-black
rival-blackOP2d ago
Can you show me how to set up a Server URL (webhook) programmatically for my phone number? The link you send me doesn't work, it says page not found. @Duckie
Vapi Support Bot
To set up a Server URL (webhook) for your phone number programmatically, use the following cURL command (replace placeholders with your actual values):
curl -X PATCH https://api.vapi.ai/phone-number/YOUR_PHONE_NUMBER_ID \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"server": {
"url": "https://your-server.com/webhook",
"timeoutSeconds": 20
}
}'
curl -X PATCH https://api.vapi.ai/phone-number/YOUR_PHONE_NUMBER_ID \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"server": {
"url": "https://your-server.com/webhook",
"timeoutSeconds": 20
}
}'
This will configure your phone number to send call events (including the call ID) to your webhook as soon as a call starts.
Reference: Setting Server URLs Sources: - Setting Server URLs - Update Phone Number API
rival-black
rival-blackOP15h ago
Server URL works but hits my URL like 50 times per call. Is there a way to hit my webhook only ONCE when the call starts? @Duckie
Vapi Support Bot
To receive your webhook only once when the call starts, filter for the call-started event using the CLI. Update your listener command as follows:
vapi listen --forward-to http://localhost:3000/webhook --filter "call-started"
vapi listen --forward-to http://localhost:3000/webhook --filter "call-started"
This will ensure your webhook is triggered only for the call-started event, preventing multiple hits per call.
Reference: See event filtering in the webhook CLI documentation. Source: - Vapi CLI Webhook Documentation
rival-black
rival-blackOP15h ago
I set up server url on VAPI UI. Is it possible to add the event listener from there as well? @Duckie
Vapi Support Bot
Thank you for your question! Just to clarify: Are you looking for a way to filter webhook events (e.g., only receive the call-started event) directly from the VAPI UI, or are you open to using the CLI for this filtering? This will help me provide the most relevant guidance for your setup. Source: - Vapi CLI Webhook Documentation
rival-black
rival-blackOP15h ago
directly from the VAPI UI @Duckie
Vapi Support Bot
Currently, the VAPI UI does not support filtering webhook events (such as only receiving call-started) directly from the interface.
All events are sent to your configured server URL without filtering options in the UI. If you need event filtering, this can only be done using the CLI with the --filter flag at this time.
For updates or feature requests, you may want to follow Vapi's changelog or contact support.
See webhook CLI documentation for details Source: - Vapi CLI Webhook Documentation
Kyle
Kyle11h ago
Hi, currently workflows is under development.

Did you find this page helpful?