跳到主内容
智客 ZICQ

技能库 智客分类:Agent 工作流 setup-webhook

设置 Webhook

配置 Vapi 服务器 URL 和 webhooks 接收实时呼叫事件、 记录、 工具呼叫和呼叫结束报告。 用于设置 Webhook 端点, 构建工具服务器, 或者将 Vapi 事件整合到您的应用程序中 .

879 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

配置 Vapi 服务器 URL 和 webhooks 以接收实时呼叫事件、记录、工具呼叫和呼叫结束报告

何时用

设置 Webhook 端点、 构建工具服务器或将 Vapi 事件纳入您的应用程序

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Vapi Webhook / Server URL Setup、Overview、Where to Set Server URLs、On an Assistant、On a Phone Number、At the Organization Level。 其中含规范建议的小节:输入输出示例。

文件分析

文件分析:除 SKILL.md 外,正文引用了 references/webhook-events.md,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

Configure Vapi server URLs and webhooks to receive real-time call events, transcripts, tool calls, and end-of-call reports. Use when setting up webhook endpoints, building tool servers, or integrating Vapi events into your application.

Vapi Webhook / Server URL SetupOverviewWhere to Set Server URLsOn an AssistantOn a Phone NumberAt the Organization LevelEvent TypesWebhook Server Example (Express.js)Webhook Server Example (Python / Flask)Webhook AuthenticationLocal DevelopmentInstall the CLI

兼容:Requires internet access and a Vapi API key (VAPI_API_KEY). · 许可:MIT

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
setup-webhook
description
Configure Vapi server URLs and webhooks to receive real-time call events, transcripts, tool calls, and end-of-call reports. Use when setting up webhook endpoints, building tool servers, or integrating Vapi events into your application.
compatibility
Requires internet access and a Vapi API key (VAPI_API_KEY).
许可
MIT
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 1
  • references/webhook-events.md

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「setup-webhook」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-9523fb8d1d6eca1e-%E8%AE%BE%E7%BD%AE-Webhook.html
请存为 .cursor/skills/setup-webhook/SKILL.md 或 .claude/skills/setup-webhook/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/vapiai/skills 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/vapiai/skills' --list

npx skills add 'https://github.com/vapiai/skills' --skill 'setup-webhook'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: setup-webhook description: Configure Vapi server URLs and webhooks to receive real-time call events, transcripts, tool calls, and end-of-call reports. Use when setting up webhook endpoints, building tool servers, or integrating Vapi events into your application. license: MIT compatibility: Requires internet access and a Vapi API key (VAPI_API_KEY). metadata: author: vapi version: "1.0" --- # Vapi Webhook / Server URL Setup Configure server URLs to receive real-time events from Vapi during calls — transcripts, tool calls, status changes, and end-of-call reports. > **Setup:** Ensure `VAPI_API_KEY` is set. See the `setup-api-key` skill if needed. ## Overview Vapi uses "Server URLs" (webhooks) to communicate with your application. Unlike traditional one-way webhooks, Vapi server URLs support bidirectional communication — your server can respond with data that affects the call. ## Where to Set Server URLs ### On an Assistant ```bash curl -X PATCH https://api.vapi.ai/assistant/{id} \ -H "Authorization: Bearer $VAPI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "server": { "url": "https://your-server.com/vapi/webhook", "credentialId": "cred_abc123" } }' ``` Create the optional `credentialId` in **Dashboard > Custom Credentials**. Omit it only for a deliberately public endpoint. ### On a Phone Number Phone-number updates also use a `server` object with `url` and optional `credentialId`. When updating through the API, first retrieve the number and preserve its existing `provider` discriminator in the PATCH body. The dashboard is the safest choice when the provider is unknown. ### At the Organization Level Set a default server URL in the Vapi Dashboard under **Settings > Server URL**. Priority order: Tool server URL > Assistant server URL > Phone Number server URL > Organization server URL. ## Event Types | Event | Description | Expects Response? | |-------|-------------|-------------------| | `assistant-request` | Request for dynamic assistant config | Yes — return assistant config | | `tool-calls` | Assistant is calling a tool | Yes — return tool results | | `status-update` | Call status changed | No | | `transcript` | Real-time transcript update | No | | `end-of-call-report` | Call completed with summary | No | | `hang` | Assistant failed to respond | No | | `speech-update` | Speech activity detected | No | ## Webhook Server Example (Express.js) ```typescript import express from "express"; const app = express(); app.use(express.json()); app.post("/vapi/webhook", (req, res) => { const { message } = req.body; switch (message.type) { case "assistant-request": // Dynamically configure the assistant based on the caller res.json({ assistant: { name: "Dynamic Assistant", firstMessage: `Hello ${message.call.customer?.name || "there"}!`, model: { provider: "openai", model: "gpt-4.1", messages: [ { role: "system", content: "You are a helpful assistant." }, ], }, voice: { provider: "vapi", voiceId: "Elliot", version: 2 }, transcriber: { provider: "deepgram", model: "nova-3", language: "en" }, }, }); break; case "tool-calls": // Handle tool calls from the assistant const results = (message.toolCallList || []).map((toolCall: any) => ({ toolCallId: toolCall.id, result: handleToolCall( toolCall.name, toolCall.parameters || toolCall.arguments ), })); res.json({ results }); break; case "end-of-call-report": // Process the call report console.log("Call ended:", { callId: message.call.id, endedReason: message.endedReason, cost: message.cost, analysis: message.analysis, artifact: message.artifact, }); res.json({}); break; case "status-update": console.log("Call status:", message.status); res.json({}); break; case "transcript": console.log(`[${message.role}]: ${message.transcript}`); res.json({}); break; default: res.json({}); } }); function handleToolCall(name: string, args: any): string { // Implement your tool logic here return `Result for ${name}`; } app.listen(3000, () => console.log("Webhook server running on port 3000")); ``` ## Webhook Server Example (Python / Flask) ```python from flask import Flask, request, jsonify app = Flask(__name__) @app.route("/vapi/webhook", methods=["POST"]) def vapi_webhook(): data = request.json message = data.get("message", {}) msg_type = message.get("type") if msg_type == "assistant-request": return jsonify({ "assistant": { "name": "Dynamic Assistant", "firstMessage": "Hello! How can I help?", "model": { "provider": "openai", "model": "gpt-4.1", "messages": [ {"role": "system", "content": "You are a helpful assistant."} ], }, "voice": {"provider": "vapi", "voiceId": "Elliot", "version": 2}, "transcriber": {"provider": "deepgram", "model": "nova-3", "language": "en"}, } }) elif msg_type == "tool-calls": results = [] for tool_call in message.get("toolCallList", []): results.append({ "toolCallId": tool_call["id"], "result": f"Handled {tool_call['name']}", }) return jsonify({"results": results}) elif msg_type == "end-of-call-report": print(f"Call ended: {message['call']['id']}") print(f"Summary: {message.get('analysis', {}).get('summary')}") return jsonify({}) if __name__ == "__main__": app.run(port=3000) ``` ## Webhook Authentication Use a Vapi Custom Credential and place its ID in `server.credentialId`. Vapi supports Bearer Token, OAuth 2.0 client credentials, and HMAC credentials. Verify requests according to the credential you configured; HMAC header names, algorithms, timestamps, and payload formats are configurable, so do not assume a fixed `x-vapi-signature` format. For a bearer credential, compare the incoming `Authorization: Bearer ` value with the token stored securely by your server. Never put the secret itself in an assistant or phone-number payload. ## Local Development Use the Vapi CLI with a public tunnel. The CLI forwards from port 4242 to your app, but it does not create the public URL itself: ```bash # Install the CLI curl -sSL https://vapi.ai/install.sh | bash # Terminal 1: expose the CLI listener ngrok http 4242 # Terminal 2: forward events from the CLI to your app vapi listen --forward-to localhost:3000/vapi/webhook ``` Set the Vapi server URL to the public ngrok URL. To skip the CLI and tunnel directly to the Express or Flask server instead: ```bash ngrok http 3000 # Copy the ngrok URL and set it as your server URL ``` ## End-of-Call Report Fields The `end-of-call-report` event includes: | Field | Description | |-------|-------------| | `call` | Full call object with metadata | | `endedReason` | Why the call ended | | `artifact` | Recording, transcript, messages, and other enabled artifacts | | `analysis` | Configured summaries, structured data, and success evaluation | | `cost` | Total call cost | | `startedAt` / `endedAt` | Call timing, when included | ## References - [Common Server URL Events](references/webhook-events.md) — Common event payloads and responses - [Setting Server URLs](https://docs.vapi.ai/server-url/setting-server-urls) — Placement and priority - [Server Authentication](https://docs.vapi.ai/server-url/server-authentication) — Custom Credentials - [Local Development](https://docs.vapi.ai/server-url/developing-locally) — Testing webhooks locally ## Additional Resources Vapi provides a **documentation MCP server** that gives compatible AI agents access to the Vapi knowledge base. Use its documentation search for advanced configuration, troubleshooting, SDK details, and anything beyond this skill. To add the Vapi documentation MCP server manually in Claude Code, run: ```bash claude mcp add vapi-docs -- npx -y mcp-remote https://docs.vapi.ai/_mcp/server ``` See the [Vapi MCP integration guide](https://docs.vapi.ai/cli/mcp) for setup instructions across supported agents.

相关技能

Agent 工作流

技能创建者Skill Creator

创造有效技能指南。 当用户想创造出新的技能(或更新现有的技能),以专业知识,工作流程,或工具集成来扩展克洛德的能力时,应该使用这种技能.

Agent 工作流

克劳德胡布Clawdhub

使用ClawdHub CLI搜索,安装,更新并发布从taladhub.com的代理技能. 需要获取苍蝇上的新技能时使用,将安装的技能同步到最新版本或特定版本,或者发布 npm-instainddhub CLI 的新/更新的技能文件夹.

Agent 工作流

团队指挥Agent Team Orchestration

管弦乐团多代理团队,任务设定周期,交接协议,审查工作流程. 使用时间: (1)建立2+特派员队伍,具有不同专业,(2)确定任务路线和生命周期(收录框_ spec_建设_审查_完成),(3)在特派员之间制定交接协议,(4)建立审查和质量关口,(5)管理特派员之间的交流和文物共享.

Agent 工作流

超级力量Superpowers

Spec-first,TDD,子代理驱动的软件开发工作流程. 当:(1)构建任何新功能或应用——触发脑暴_计划_子代理执行回路,(2)调试出一个bug或测试失败——触发系统性的根起过程,(3)用户说"让我们构建","帮助我计划","我想添加X",或"这个被打破",(4)完成一个功…