開發者資源
Zeabur 提供完整的 API 和開發工具,讓你以程式化方式管理服務、自動化部署流程,以及整合到自己的應用中。
API 總覽
Zeabur 的 API 以 GraphQL 為核心,為 Dashboard、CLI 和所有第一方產品提供底層支援。同時也提供 REST 端點用於特定操作(檔案上傳、容器操作等)。
| API | 用途 | 端點 |
|---|---|---|
| GraphQL API | 專案 / 服務 / 環境管理、部署、日誌 | https://api.zeabur.com/graphql |
| Upload API | 以 Pre-signed URL 上傳 ZIP 部署 | https://api.zeabur.com/v2/upload |
| Email REST API | 郵件發送與管理 | https://api.zeabur.com/api/v1/zsend |
💡
完整的非 GraphQL API 規格(JSON Schema / OpenAPI)可在 Schema Repository 查看。
認證
所有 API 都使用 Bearer Token 認證。在 Dashboard > 設定 > API 金鑰 產生金鑰後,在請求的 Authorization Header 中帶入:
curl -X POST https://api.zeabur.com/graphql \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"query":"query { me { username } }"}'詳細操作請參閱 API 金鑰。
即時訂閱
需要串流日誌或監聽專案活動?Zeabur 透過 graphql-ws 協議提供 WebSocket 即時訂閱。
- 全球端點:
wss://api.zeabur.com/graphql - 中國端點:
wss://api.zeabur.cn/graphql
詳細的連線方式、認證流程和程式碼範例請參閱 WebSocket 即時訂閱。
工具
- Zeabur CLI:在終端以
npx zeabur一行指令登入並部署服務。 - Apollo Explorer:線上瀏覽並測試所有 GraphQL API,也可下載完整 Schema 供 IDE 使用。
產品專屬 API
部分 Zeabur 產品有獨立的 API 文件:
- Zeabur Email REST API — 郵件發送 API 端點參考
- Email API 金鑰 — Email API 專用金鑰管理與權限
- Email Webhook — 收信 / 退信等事件回呼設定