Documentation menu

DocumentationLeads and integrations

Custom actions: your agent uses your API

Let your AI agent call your own API during a conversation: create orders, track deliveries, open tickets. The VeyCall action standard, n8n and existing APIs.

Custom actions let your agent use your own systems during a conversation: create an order, check a delivery, open a ticket, look up an account. The agent collects the details each action needs, calls your API, and uses the answer in its reply, in calls and in writing. Custom actions come with the API and webhooks activation.

Add an action

Open your agent, go to the Actions step and pick a type. Give the action a name, say when the agent should use it, and list the information it must collect first (name, type, description, required or not). Turn on Ask the customer to confirm first for anything that changes something, like an order or a booking: the agent repeats the details and waits for a yes. Use Test to try it with sample values; every call is logged.

  • VeyCall endpoint: your API follows the VeyCall action standard below. The simplest to build.
  • n8n workflow: add the VeyCall Action Trigger node to a workflow; activating it adds the action to your agent, and the last node's output goes back to the agent. No code.
  • My existing API: any API, public or with a key (in a header, a bearer token, user and password, or in the address). Set the method, the address and a JSON body with {parameter} placeholders (also {customer.name}, {customer.phone}, {customer.email}, {conversation.id}), and the fields to keep from the answer.
  • MCP server: the tools of a remote MCP server, chosen one by one. See MCP servers.

The VeyCall action standard

VeyCall sends a signed POST with the same envelope every time:

POST https://your-api.example.com/veycall
content-type: application/json
x-veycall-action: create_order
x-veycall-timestamp: 1795000000
x-veycall-signature: v1=5f1c...

{
  "action": "create_order",
  "parameters": { "product": "Lina dress", "quantity": 2 },
  "customer": { "name": "Marie Dupont", "phone": "+33612345678", "email": "marie@example.com" },
  "conversation": { "id": "conv_...", "channel": "whatsapp" },
  "agent": { "id": "agent_...", "name": "Laura" },
  "language": "en-US",
  "test": false
}

Your API answers with JSON. say is what the agent can tell the customer, in its own words; data is what it keeps for the rest of the conversation; error explains a refusal, and the agent offers the customer another way. Any other JSON is given to the agent as data.

{ "ok": true, "say": "Order 4821 recorded, delivery on Thursday.", "data": { "order_id": 4821 } }

{ "ok": false, "error": "This product is out of stock." }

Check that the call comes from VeyCall

When you add a VeyCall endpoint, the dashboard shows its signing secret once (you can get a new one later). The signature works like VeyCall's webhooks: an HMAC-SHA256 of timestamp.body.

import { createHmac, timingSafeEqual } from "node:crypto";

// rawBody: the request body exactly as received (a string, before JSON.parse).
function isFromVeyCall(headers, rawBody, secret) {
  const ts = headers["x-veycall-timestamp"];
  if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false; // older than 5 minutes
  const expected = "v1=" + createHmac("sha256", secret).update(ts + "." + rawBody).digest("hex");
  const got = headers["x-veycall-signature"] ?? "";
  return got.length === expected.length && timingSafeEqual(Buffer.from(got), Buffer.from(expected));
}

Limits and safety

  • Answer within 8 seconds during a call (the agent says "one moment, I'm checking" meanwhile) and 15 seconds in writing.
  • Public HTTPS addresses only. Your key or secret stays on VeyCall's server: the agent and the customer never see it.
  • Answers are trimmed to about 3,000 characters before they reach the agent: send what it needs, not your whole database.
  • "test": true marks calls from the Test button, so your API can skip real orders.

Actions can also be managed with the API (/agents/{agent_id}/actions), with an organization API key.