This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
工作流 REST API
使用 EAS REST API 从你自己的系统触发工作流并检查其状态。
EAS REST API 提供用于触发工作流和读取运行详情的端点。所有端点都位于 https://api.expo.dev 下。请求和响应都是 JSON 格式。
🌐 The EAS REST API exposes endpoints for triggering a workflow and reading run details. All endpoints live under https://api.expo.dev. Requests and responses are JSON.
验证
🌐 Authentication
两个端点都需要 EAS 访问令牌,以承载令牌的形式发送在 Authorization 头中。
🌐 Both endpoints require an EAS access token, sent as a bearer token in the Authorization header.
对于生产集成,请在拥有项目的账户上创建一个机器人用户并赋予其限定角色。然后,该令牌代表机器人用户,而不是个人。你可以撤销它而不影响任何用户。个人访问令牌也适用于一次性脚本。
🌐 For production integrations, create a robot user on the account that owns the project and give it a scoped role. The token then represents the robot user, not a person. You can revoke it without affecting any user. A personal access token also works for one-off scripts.
Authorization: Bearer <EXPO_TOKEN> Content-Type: application/json
触发工作流
🌐 Trigger a workflow
POST /v2/workflows/dispatch
解析给定 Git 引用的工作流文件,根据工作流中声明的 workflow_dispatch 模式验证 inputs,并将一个新的运行加入队列。
🌐 Resolves the workflow file on the given Git ref, validates inputs against the workflow_dispatch schema declared in the workflow, and enqueues a new run.
请求体
🌐 Request body
响应
🌐 Response
返回 200 OK,包含新的工作流运行 ID 和仪表板中运行的链接:
🌐 Returns 200 OK with the new workflow run ID and a link to the run in the dashboard:
{ "data": { "id": "019d9d17-013a-7e05-89aa-4aa83ff68c32", "url": "https://expo.dev/accounts/acme/projects/example/workflows/019d9d17-013a-7e05-89aa-4aa83ff68c32" } }
示例
🌐 Example
错误
🌐 Errors
获取工作流运行
🌐 Get a workflow run
GET /v2/workflows/runs/:workflowRunId
返回工作流运行及其包含的作业。触发运行后,可以使用此端点轮询以获取完成情况,或在自己的用户界面中呈现运行的详细信息。
🌐 Returns the workflow run and the jobs it contains. Use this endpoint to poll for completion after triggering a run, or to render a run's details in your own UI.
响应
🌐 Response
{ "data": { "id": "019d9d17-013a-7e05-89aa-4aa83ff68c32", "status": "in-progress", "url": "https://expo.dev/accounts/acme/projects/example/workflows/019d9d17-013a-7e05-89aa-4aa83ff68c32", "gitCommitHash": "564b61ebdd403d28b5dc616a12ce160b91585b5b", "gitCommitMessage": "Add home screen", "requestedGitRef": "refs/heads/main", "triggerEventType": "MANUAL", "createdAt": "2026-05-22T15:04:11.000Z", "updatedAt": "2026-05-22T15:05:42.000Z", "jobs": [ { "id": "019d9d17-1a3f-7c10-bdee-5f2811a9d6ad", "key": "build_ios", "name": "Build iOS", "type": "build", "status": "in-progress", "requiredJobKeys": [], "environment": "production", "outputs": {}, "errors": [], "buildId": "f9609423-5072-4ea2-a0a5-c345eedf2c2a", "submissionId": null, "createdAt": "2026-05-22T15:04:11.000Z", "updatedAt": "2026-05-22T15:04:42.000Z" } ] } }
运行的 status 是以下之一:
🌐 The run's status is one of:
jobs 中的每个条目都包含其自己的 status,其中之一是:
🌐 Each entry in jobs includes its own status, one of:
outputs 包含作业使用工作流文件中的 outputs: 设置的任何值。任何引用的密钥将在响应中显示为占位符。type: build 类型的作业包括 buildId,而 type: submission 类型的作业包括 submissionId。每个 ID 都链接到底层的 EAS Build 或 EAS Submit 记录。
示例
🌐 Example
将以下内容保存为 shell 脚本(或粘贴到终端)以触发运行并轮询,直到其达到终止状态:
🌐 Save the following as a shell script (or paste into your terminal) to trigger a run and poll until it reaches a terminal status:
RUN_ID=$(curl -s -X POST "https://api.expo.dev/v2/workflows/dispatch" \ -H "Authorization: Bearer $EXPO_TOKEN" \ -H "Content-Type: application/json" \ -d '{"appId":"...","gitRef":"main","fileName":"deploy.yml"}' \ | jq -r '.data.id') while true; do STATUS=$(curl -s "https://api.expo.dev/v2/workflows/runs/$RUN_ID" \ -H "Authorization: Bearer $EXPO_TOKEN" \ | jq -r '.data.status') echo "status: $STATUS" case "$STATUS" in success|failure|canceled) break ;; esac sleep 10 done
错误
🌐 Errors
下一步
🌐 Next step
工作流 YAML 文件的参考,包括 workflow_dispatch 触发器和输入模式。