hosting
POST /v1/sites/{siteId}/previews
Build a branch as a preview, without touching the live site.
Pagpapatotoo
Magpadala ng API key bilang isang bearer token. Kailangang taglayin ng key ang pahintulot na hosting.deploy.manage; ang key na wala nito ay tatanggihan gamit ang 403, hindi 404.
Ang endpoint na ito ay hindi nangangailangan ng id ng organisasyon. Natutukoy na ng iyong key ang organisasyong kinabibilangan nito, at nakatuon ang tugon dito.
Subukan ito
Palitan ang anuman sa loob ng mga panaklong na may anggulo ng iyong sariling mga halaga, at ang placeholder ng key na may key mula sa iyong dashboard.
curl -X POST https://api.zinndigital.com/v1/sites/{siteId}/previews \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "branch": <string> }'Nakalagda? Ang API console sa iyong dashboard ay awtomatikong naglalagay ng iyong tunay na ID ng organisasyon at sariling susi, at pinapatakbo ang kahilingan laban sa live na API upang makita mo ang aktwal na tugon. Buksan ang endpoint na ito sa console ng API
Mga Detalye
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`.
Mga Parameter
| Pangalan | Uri | Kailangan | Ano ito |
|---|---|---|---|
siteId (path) | Uuid | Oo | Site ID (UUIDv7). |
Katawan ng kahilingan
| Pangalan | Uri | Kailangan | Ano ito |
|---|---|---|---|
branch | string | Oo | The branch to build as a preview. Must not be the branch the site already serves — that would be a normal deploy. |
Tugon
| Pangalan | Uri | Kailangan | Ano ito |
|---|---|---|---|
id | Uuid | Oo | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
site_id | Uuid | Oo | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
target | DeployTarget | Oo | 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 | Oo | `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 | Oo | 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 | Oo | — |
branch | object | Oo | — |
commit | object | Oo | — |
commit_message | object | Oo | — |
live_url | object | Oo | — |
message | object | Oo | Why it failed, else null. Rendered to the customer verbatim. |
requested_by | string | Oo | — |
created_at | string | Oo | — |
started_at | object | Oo | — |
finished_at | object | Oo | — |
log | string | Oo | 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. |
Mga error na maibabalik ng endpoint na ito
401 · 403 · 404 · 409 · 422 · 429 · 503