hosting
POST /v1/sites/{siteId}/previews
Build a branch as a preview, without touching the live site.
Xác thực
Gửi khóa API dưới dạng mã thông báo bearer. Khóa này phải có quyền hosting.deploy.manage; khóa không có quyền này sẽ bị từ chối với mã lỗi 403, không phải 404.
Endpoint này không nhận ID tổ chức. Khóa của bạn đã xác định tổ chức mà nó thuộc về và phản hồi được giới hạn trong phạm vi đó.
Dùng thử
Thay thế bất kỳ nội dung nào trong ngoعل (angle brackets) bằng giá trị của riêng bạn và trình giữ chỗ key bằng một key từ trang tổng quan của bạn.
curl -X POST https://api.zinndigital.com/v1/sites/{siteId}/previews \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "branch": <string> }'Đã đăng nhập? Bảng điều khiển API trong trang quản lý của bạn sẽ tự điền ID tổ chức thực tế và khóa của riêng bạn, sau đó chạy yêu cầu đối với API trực tiếp để bạn có thể xem phản hồi thực tế. Mở điểm cuối này trong bảng điều khiển API
Chi tiết
A preview NEVER binds the site's hostname: it is reachable at the provider's own per-deployment URL and nowhere else, which is the whole promise of a preview. Previewing the branch the site already serves is refused rather than quietly promoted to a production deploy. Requires `hosting.deploy.manage`.
Tham số
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
siteId (path) | Uuid | Có | Site ID (UUIDv7). |
Nội dung yêu cầu
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
branch | string | Có | The branch to build as a preview. Must not be the branch the site already serves — that would be a normal deploy. |
Phản hồi
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
id | Uuid | Có | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
site_id | Uuid | Có | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
target | DeployTarget | Có | Where the site is published from. `fleet` is our own managed fleet; the rest are managed edge hosts, deployed to from a pooled account of ours or the customer's own connected on… |
status | DeployStatus | Có | `idle` means the site has never been deployed. It is reported, never stored — a stored idle would be a second way to say "no deployments" that could contradict the first. |
trigger | DeployTrigger | Có | What caused the deploy. Stored because `requested_by` cannot answer it for a push — the actor there is a webhook delivery, not a person. |
repo | object | Có | — |
branch | object | Có | — |
commit | object | Có | — |
commit_message | object | Có | — |
live_url | object | Có | — |
message | object | Có | Why it failed, else null. Rendered to the customer verbatim. |
requested_by | string | Có | — |
created_at | string | Có | — |
started_at | object | Có | — |
finished_at | object | Có | — |
log | string | Có | The build log, one timestamped line per step. Truncated from the FRONT when long — the end of a build log is where the failure is. |
Các lỗi điểm cuối này có thể trả về
401 · 403 · 404 · 409 · 422 · 429 · 503