zapier

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Troubleshooting

故障排查

If requests fail, run
zero doctor check-connector --env-name ZAPIER_TOKEN
or
zero doctor check-connector --url https://actions.zapier.com/api/v2/check/ --method GET
如果请求失败,请运行
zero doctor check-connector --env-name ZAPIER_TOKEN
zero doctor check-connector --url https://actions.zapier.com/api/v2/check/ --method GET

How to Use

使用方法

All examples below assume you have
ZAPIER_TOKEN
set. Authentication uses the
x-api-key
header.
以下所有示例均假设你已设置
ZAPIER_TOKEN
。认证使用
x-api-key
请求头。

1. Check API Key

1. 检查API密钥

Verify that your API key is valid.
bash
curl -s "https://actions.zapier.com/api/v2/check/" --header "x-api-key: $ZAPIER_TOKEN" | jq .
验证你的API密钥是否有效。
bash
curl -s "https://actions.zapier.com/api/v2/check/" --header "x-api-key: $ZAPIER_TOKEN" | jq .

2. List Exposed Actions

2. 列出已暴露的操作

Retrieve all actions you have configured and exposed in your Zapier AI Actions dashboard.
bash
curl -s "https://actions.zapier.com/api/v1/exposed/" --header "x-api-key: $ZAPIER_TOKEN" | jq '.results[] | {id, description, params}'
检索你在Zapier AI Actions控制台中配置并暴露的所有操作。
bash
curl -s "https://actions.zapier.com/api/v1/exposed/" --header "x-api-key: $ZAPIER_TOKEN" | jq '.results[] | {id, description, params}'

3. Execute an AI Action

3. 执行AI操作

Execute a configured action using natural language instructions. Replace
ACTION_ID
with the action ID from the list above.
bash
curl -s -X POST "https://actions.zapier.com/api/v2/ai-actions/ACTION_ID/execute/" --header "Content-Type: application/json" --header "x-api-key: $ZAPIER_TOKEN" -d '{"instructions": "Send a message saying hello to the #general channel"}' | jq .
使用自然语言指令执行已配置的操作。将
ACTION_ID
替换为上述列表中的操作ID。
bash
curl -s -X POST "https://actions.zapier.com/api/v2/ai-actions/ACTION_ID/execute/" --header "Content-Type: application/json" --header "x-api-key: $ZAPIER_TOKEN" -d '{"instructions": "Send a message saying hello to the #general channel"}' | jq .

4. Execute with Parameter Hints

4. 带参数提示执行

Supply parameter hints to guide the AI in filling action fields. Supported modes:
locked
(use exact value),
guess
(AI matches text),
choose_from
(AI selects from list),
ignored
(skip parameter).
Write to
/tmp/zapier_request.json
:
json
{
  "instructions": "Send an email about the weekly report",
  "params": {
    "to": {
      "mode": "locked",
      "value": "team@example.com"
    },
    "subject": {
      "mode": "locked",
      "value": "Weekly Report"
    }
  }
}
Then run:
bash
curl -s -X POST "https://actions.zapier.com/api/v2/ai-actions/ACTION_ID/execute/" --header "Content-Type: application/json" --header "x-api-key: $ZAPIER_TOKEN" -d @/tmp/zapier_request.json | jq .
提供参数提示以引导AI填充操作字段。支持的模式:
locked
(使用精确值)、
guess
(AI匹配文本)、
choose_from
(AI从列表中选择)、
ignored
(跳过参数)。
写入
/tmp/zapier_request.json
json
{
  "instructions": "Send an email about the weekly report",
  "params": {
    "to": {
      "mode": "locked",
      "value": "team@example.com"
    },
    "subject": {
      "mode": "locked",
      "value": "Weekly Report"
    }
  }
}
然后运行:
bash
curl -s -X POST "https://actions.zapier.com/api/v2/ai-actions/ACTION_ID/execute/" --header "Content-Type: application/json" --header "x-api-key: $ZAPIER_TOKEN" -d @/tmp/zapier_request.json | jq .

5. Preview an Action (Dry Run)

5. 预览操作(试运行)

Preview what the action would do without actually executing it. Add
preview_only=true
as a query parameter.
bash
curl -s -X POST "https://actions.zapier.com/api/v2/ai-actions/ACTION_ID/execute/?preview_only=true" --header "Content-Type: application/json" --header "x-api-key: $ZAPIER_TOKEN" -d '{"instructions": "Create a new row in the Sales spreadsheet with name John and amount 500"}' | jq .
预览操作的执行结果而不实际运行它。添加
preview_only=true
作为查询参数。
bash
curl -s -X POST "https://actions.zapier.com/api/v2/ai-actions/ACTION_ID/execute/?preview_only=true" --header "Content-Type: application/json" --header "x-api-key: $ZAPIER_TOKEN" -d '{"instructions": "Create a new row in the Sales spreadsheet with name John and amount 500"}' | jq .

6. Execute a V1 Exposed Action

6. 执行V1版本的暴露操作

Execute an action using the V1 endpoint. Replace
ACTION_ID
with the exposed action ID.
bash
curl -s -X POST "https://actions.zapier.com/api/v1/dynamic/exposed/ACTION_ID/execute/" --header "Content-Type: application/json" --header "x-api-key: $ZAPIER_TOKEN" -d '{"instructions": "Send a Slack message to #dev saying deployment complete"}' | jq .
使用V1端点执行操作。将
ACTION_ID
替换为暴露的操作ID。
bash
curl -s -X POST "https://actions.zapier.com/api/v1/dynamic/exposed/ACTION_ID/execute/" --header "Content-Type: application/json" --header "x-api-key: $ZAPIER_TOKEN" -d '{"instructions": "Send a Slack message to #dev saying deployment complete"}' | jq .

Guidelines

使用指南

  1. Configure actions first: Before using the API, you must configure and enable actions in the Zapier AI Actions dashboard. The API can only execute actions you have set up
  2. Use natural language: The
    instructions
    field accepts plain English descriptions of what you want to do. The AI interprets and maps instructions to the correct action parameters
  3. Parameter modes: Use
    locked
    mode when you know the exact value,
    guess
    when the AI should match text to available options, and
    choose_from
    to provide a list of valid IDs
  4. Preview before executing: Use
    preview_only=true
    to verify the AI correctly interprets your instructions before running the action
  5. Response statuses: Check the
    status
    field in responses - values are
    success
    ,
    error
    ,
    empty
    , or
    preview
  6. Rate limits: Zapier enforces rate limits on API calls. Implement backoff if you receive HTTP 429 responses
  7. Action IDs: Each configured action has a unique ID. Use the list endpoint to discover available action IDs
  1. 先配置操作:在使用API之前,你必须在 Zapier AI Actions控制台 中配置并启用操作。API只能执行你已设置好的操作
  2. 使用自然语言
    instructions
    字段接受你想要执行操作的普通英文描述。AI会解析并将指令映射到正确的操作参数
  3. 参数模式:当你知道精确值时使用
    locked
    模式,当AI需要将文本与可用选项匹配时使用
    guess
    模式,使用
    choose_from
    模式来提供有效ID列表
  4. 执行前预览:使用
    preview_only=true
    在运行操作前验证AI是否正确解析了你的指令
  5. 响应状态:检查响应中的
    status
    字段——值包括
    success
    error
    empty
    preview
  6. 速率限制:Zapier对API调用实施速率限制。如果收到HTTP 429响应,请实现退避机制
  7. 操作ID:每个已配置的操作都有唯一ID。使用列表端点查看可用的操作ID