详细分析 ▾
运行时依赖
版本
- Initial release of the Vercel API integration skill with managed OAuth via Maton. - Enables management of Vercel projects, deployments, domains, teams, and environment variables. - Includes comprehensive connection management for Vercel OAuth through Maton Control Panel. - Provides sample Python code for common API operations such as listing projects and creating connections. - API gateway automatically handles authentication and token injection. - Full documentation and endpoint references included for quick start and advanced usage.
安装命令 点击复制
技能文档
Access the Vercel API with managed OAuth authentication. Manage projects, deployments, domains, teams, and environment variables.
Quick 开始
# List projects
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/vercel/v9/projects?limit=10')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Base URL
https://gateway.maton.ai/vercel/{native-api-path}
Replace {native-api-path} with the actual Vercel API endpoint path (e.g., v9/projects, v6/deployments). The gateway proxies requests to api.vercel.com and automatically injects your OAuth token.
Authentication
All requests require the Maton API key in the Authorization header:
Authorization: Bearer $MATON_API_KEY
Environment 变量: 设置 API 键 作为 MATON_API_KEY:
export MATON_API_KEY="YOUR_API_KEY"
Getting API 键
- 签名 在...中 或 创建 账户 在 maton.ai
- Go 到 maton.ai/settings
- 复制 API 键
连接 Management
Manage your Vercel OAuth connections at https://ctrl.maton.ai.
列表 Connections
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections?app=vercel&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
创建 连接
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'vercel'}).encode()
req = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
获取 连接
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
响应:
{
"connection": {
"connection_id": "cf5e9c78-dff3-495f-a1d4-e0c6eeeafa9a",
"status": "ACTIVE",
"creation_time": "2025-12-08T07:20:53.488460Z",
"last_updated_time": "2026-01-31T20:03:32.593153Z",
"url": "https://connect.maton.ai/?session_token=...",
"app": "vercel",
"metadata": {}
}
}
Open the returned url in a browser to complete OAuth authorization.
删除 连接
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Specifying 连接
If you have multiple Vercel connections, specify which one to use with the Maton-Connection header:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/vercel/v9/projects')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Maton-Connection', 'cf5e9c78-dff3-495f-a1d4-e0c6eeeafa9a')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
If omitted, the gateway uses the default (oldest) active connection.
API Reference
用户
获取 Current 用户
GET /vercel/v2/user
响应:
{
"user": {
"id": "srL5ucia16R88imgFgrn9XHH",
"email": "user@example.com",
"username": "username",
"name": "User Name",
"avatar": null,
"defaultTeamId": "team_abc123",
"billing": {
"plan": "hobby",
"status": "active"
}
}
}
Teams
列表 Teams
GET /vercel/v2/teams
响应:
{
"teams": [
{
"id": "team_1xPDNnVvmKxzxPs2x2XQRoKu",
"slug": "my-team",
"name": "My Team",
"createdAt": 1732138693523,
"membership": {
"role": "OWNER"
},
"billing": {
"plan": "hobby",
"status": "active"
}
}
],
"pagination": {
"count": 1,
"next": null,
"prev": null
}
}
Projects
列表 Projects
GET /vercel/v9/projects?limit=20
响应:
{
"projects": [
{
"id": "prj_ET9o8o6WAQTfWbtF8NeFe4XF9uYG",
"name": "my-project",
"accountId": "team_abc123",
"framework": "nextjs",
"nodeVersion": "22.x",
"createdAt": 1733304037737,
"updatedAt": 1766947708146,
"targets": {},
"latestDeployments": []
}
],
"pagination": {
"count": 20,
"next": 1733304037737,
"prev": null
}
}
获取 Project
GET /vercel/v9/projects/{projectId}
响应:
{
"id": "prj_ET9o8o6WAQTfWbtF8NeFe4XF9uYG",
"name": "my-project",
"accountId": "team_abc123",
"framework": "nextjs",
"nodeVersion": "22.x",
"createdAt": 1733304037737,
"updatedAt": 1766947708146,
"buildCommand": null,
"devCommand": null,
"installCommand": null,
"outputDirectory": null,
"rootDirectory": null,
"serverlessFunctionRegion": "iad1"
}
创建 Project
POST /vercel/v9/projects
Content-Type: application/json{
"name": "my-new-project",
"framework": "nextjs",
"gitRepository": {
"type": "github",
"repo": "username/repo"
}
}
更新 Project
PATCH /vercel/v9/projects/{projectId}
Content-Type: application/json{
"name": "updated-project-name",
"buildCommand": "npm run build"
}
删除 Project
DELETE /vercel/v9/projects/{projectId}
Deployments
列表 Deployments
GET /vercel/v6/deployments?limit=20
查询 Parameters:
limit- 数字 的 results (默认: 20)projectId- 过滤 由 project IDtarget- 过滤 由 target (production,预览)state- 过滤 由 state (BUILDING,就绪,错误,CANCELED)
响应:
{
"deployments": [
{
"uid": "dpl_8gFe6M8XZsQ1ohP86VWTemcBAmZJ",
"name": "my-project",
"url": "my-project-abc123.vercel.app",
"created": 1759739951209,
"state": "READY",
"readyState": "READY",
"target": "production",
"source": "git",
"creator": {
"uid": "srL5ucia16R88imgFgrn9XHH",
"username": "username"
},
"meta": {
"githubCommitRef": "main",
"githubCommitSha": "6e88c2d..."
}
}
],
"pagination": {
"count": 20,
"next": 1759739951209,
"prev": null
}
}
获取 Deployment
GET /vercel/v13/deployments/{deploymentId}
响应:
{
"id": "dpl_8gFe6M8XZsQ1ohP86VWTemcBAmZJ",
"name": "my-project",
"url": "my-project-abc123.vercel.app",
"created": 1759739951209,
"buildingAt": 1759739952144,
"ready": 1759740085170,
"state": "READY",
"readyState": "READY",
"target": "production",
"source": "git",
"creator": {
"uid": "srL5ucia16R88imgFgrn9XHH",
"username": "username"
}
}
获取 Deployment Build Logs
GET /vercel/v3/deployments/{deploymentId}/events
响应:
[
{
"created": 1759739951860,
"deploymentId": "dpl_8gFe6M8XZsQ1ohP86VWTemcBAmZJ",
"text": "Running build in Washington, D.C., USA (East) – iad1",
"type": "stdout",
"info": {
"type": "build",
"name": "bld_b3go7zd2k"
}
}
]
取消 Deployment
PATCH /vercel/v12/deployments/{deploymentId}/cancel
Environment Variables
列表 Environment Variables
GET /vercel/v10/projects/{projectId}/env
响应:
{
"envs": [
{
"id": "6EwQRCd32PVNHORP",
"key": "API_KEY",
"value": "...",
"type": "encrypted",
"target": ["production", "preview", "development"],
"createdAt": 1732148489672,
"updatedAt": 1745542152381
}
]
}
创建 Environment 变量
POST /vercel/v10/projects/{projectId}/env
Content-Type: application/json{
"key": "MY_ENV_VAR",
"value": "my-value",
"type": "encrypted",
"target": ["production", "preview"]
}
更新 Environment 变量
PATCH /vercel/v10/projects/{projectId}/env/{envId}
Content-Type: application/json{
"value": "updated-value"
}
删除 Environment 变量
DELETE /vercel/v10/projects/{projectId}/env/{envId}
Domains
列表 Domains
GET /vercel/v5/domains
响应:
{
"domains": [
{
"name": "example.com",
"apexName": "example.com",
"projectId": "prj_abc123",
"verified": true,
"createdAt": 1732138693523
}
],
"pagination": {
"count": 10,
"next": null,
"prev": null
}
}
获取 Domain
GET /vercel/v5/domains/{domain}
添加 Domain
POST /vercel/v5/domains
Content-Type: application/json{
"name": "example.com"
}
移除 Domain
DELETE /vercel/v6/domains/{domain}
Artifacts (Remote Caching)
获取 Artifacts Status
GET /vercel/v8/artifacts/status
响应:
{
"status": "enabled"
}
分页
Vercel uses cursor-based pagination with next and prev cursors:
GET /vercel/v9/projects?limit=20&until=1733304037737
Parameters:
limit- Results per page (varies 由 endpoint, typically max 100)until- Cursor 对于 下一个 page (使用下一个从 响应)since- Cursor 对于 上一个 page (使用prev从 响应)
响应 includes:
{
"pagination": {
"count": 20,
"next": 1733304037737,
"prev": 1759739951209
}
}
Code Examples
JavaScript
const response = await fetch(
'https://gateway.maton.ai/vercel/v9/projects?limit=10',
{
headers: {
'Authorization': Bearer ${process.env.MATON_API_KEY}
}
}
);
const data = await response.json();
Python
import os
import requestsresponse = requests.get(
'https://gateway.maton.ai/vercel/v9/projects',
headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'},
params={'limit': 10}
)
data = response.json()
列表 Deployments 对于 Project
import os
import requestsproject_id = 'prj_abc123'
response = requests.get(
'https://gateway.maton.ai/vercel/v6/deployments',
headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'},
params={'projectId': project_id, 'limit': 10}
)
deployments = response.json()['deployments']
Notes
- API versions vary 由 endpoint (v2, v5, v6, v9, v10, v13, etc.)
- Timestamps 在...中 milliseconds since Unix epoch
- Project IDs 开始 带有
prj_, deployment IDs 开始 带有dpl_, team IDs 开始 带有team_ - Deployment states:
BUILDING,就绪,错误,CANCELED,QUEUED - Environment 变量 types:
plain,encrypted,secret,sensitive - Environment targets:
production,预览,development - IMPORTANT: 当...时 使用 curl commands, 使用
curl -g当...时 URLs contain brackets 到 disable glob parsing - IMPORTANT: 当...时 piping curl 输出 到
jq, environment variables 可能 不 expand correctly 在...中 一些 shells
错误 Handling
| Status | Meaning |
|---|---|
| 400 | Missing Vercel connection or invalid request |
| 401 | Invalid or missing Maton API key |
| 403 | Insufficient permissions |
| 404 | Resource not found |
| 429 | Rate limited |
| 4xx/5xx | Passthrough error from Vercel API |
Resources
免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制