Extract call id from workflow used for incoming ca...
# support
s
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?
v
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](https://docs.vapi.ai/api-reference/calls/get?explorer=true) - [Vapi Issue Reporting: Finding Your Call ID](https://docs.vapi.ai/issue-reporting)
s
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)
@Vapi Support Bot
v
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](https://docs.vapi.ai/api-reference/calls/get?explorer=true) - [Vapi Workflows: API Request Node](https://docs.vapi.ai/workflows/nodes/api-request)
s
I use the standard workflow builder UI @Vapi Support Bot
v
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](https://docs.vapi.ai/workflows/nodes/api-request) Source: - [Vapi Workflows: API Request Node](https://docs.vapi.ai/workflows/nodes/api-request)
s
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. @Vapi Support Bot
v
To set up a Server URL (webhook) for your phone number programmatically, use the following cURL command (replace placeholders with your actual values):
Copy code
bash
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](https://docs.vapi.ai/server-url/setting-server-urls) Sources: - [Setting Server URLs](https://docs.vapi.ai/server-url/setting-server-urls) - [Update Phone Number API](https://docs.vapi.ai/api-reference/phone-numbers/update?explorer=true)
s
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? @Vapi Support Bot
v
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:
Copy code
bash
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](https://docs.vapi.ai/cli/webhook). Source: - [Vapi CLI Webhook Documentation](https://docs.vapi.ai/cli/webhook)
s
I set up server url on VAPI UI. Is it possible to add the event listener from there as well? @Vapi Support Bot
v
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](https://docs.vapi.ai/cli/webhook)
s
directly from the VAPI UI @Vapi Support Bot
v
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](https://docs.vapi.ai/cli/webhook) Source: - [Vapi CLI Webhook Documentation](https://docs.vapi.ai/cli/webhook)
c
Hi, currently workflows is under development.
3 Views