Agents
Webhook and number
The Webhook & number tab sets where the agent's call events are posted and which phone number the agent answers and calls from.
Fields
| Field | Type | Default | What it does |
|---|---|---|---|
webhook_url | string | "" | The lifecycle events of this agent’s calls (call.queued, call.placed, call.started, call.ended and call.completed with the full call record) are posted here. An https URL on the public internet. |
webhook_headers | object | {} | Up to 20 extra request headers sent with every post to webhook_url, such as an Authorization token. Values come back masked (••••••••). See Webhook headers. |
phone_number | string | "" | An E.164 number from your workspace (another number is refused with 422). Inbound calls to it are answered by this agent, and it is the default caller ID for the agent’s outbound calls. |
{
"webhook_url": "https://crm.example.com/vaakyo/call-events",
"webhook_headers": {"Authorization": "Bearer crm-token-123"},
"phone_number": "+918035001234"
}
Webhook URL
The agent’s webhook URL receives the lifecycle of this agent’s calls: call.queued, call.placed (dialling), call.started (in progress), call.ended and call.completed (the final record, after analytics). For other events (voicemail, transfers, tool calls, errors), add a workspace endpoint that lists them; see Webhook events.
- Requests are signed with your workspace’s default signing secret. See its hint and rotate it under Webhooks in the console (a new secret is shown once).
- Deliveries are sent once and logged like any other webhook.
- If a workspace endpoint is also subscribed, both receive the event.
See Webhooks for the payload, the signature and delivery.
Webhook headers
Use webhook_headers when the receiving server expects its own credentials, such as an API token or a Basic auth header. They are added to every request to the agent’s webhook URL.
- Values are secrets. Responses show
••••••••in place of each value, and the audit log masks them. To keep a stored value, send the masked value back unchanged; to change one, send the new value. To remove a header, leave it out. - Header names must be valid HTTP header names, and each value is one line of at most 2000 characters.
- Vaakyo sets
Content-Type,User-Agentand theX-Vaakyo-*headers itself, so these names (andHost,Content-Length,Connection,Transfer-Encoding,X-Voxa-*) are refused with422. - Headers are not stored with the delivery log.
- A shared copy of the agent leaves the headers out, like the webhook URL.
PUT /api/v1/agents/{id} replaces the whole configuration, so send the agent you fetched with the headers added (masked values in it are kept):
curl -s https://api.vaakyo.com/api/v1/agents/$AGENT_ID -H "Authorization: Bearer $VAAKYO_API_KEY" \
| jq '.webhook_headers = (.webhook_headers + {"Authorization": "Bearer crm-token-123"})' > agent.json
curl -X PUT https://api.vaakyo.com/api/v1/agents/$AGENT_ID \
-H "Authorization: Bearer $VAAKYO_API_KEY" \
-H "Content-Type: application/json" \
-d @agent.json
Phone number
A number answers with one agent at a time. When you save an agent with a number that another agent in your workspace already has, the number moves to the new agent and is cleared from the old one. A number that is not on your workspace returns 422 with that number is not on this workspace: use one of your numbers (Phone numbers).
To connect a number and also point its incoming calls at Vaakyo, use Phone numbers in the console. See Inbound calls.
On outbound calls, from_number in the place-call request wins over the agent’s number. If neither is set, Vaakyo uses your only number, or else a shared one; with several numbers and none chosen the request fails with 400. See Outbound calls.