hosting
POST /v1/site-blueprints
Capture a built site as a reusable blueprint.
การยืนยันตัวตน
ส่ง API key ในรูปแบบ bearer token คีย์ดังกล่าวต้องมีสิทธิ์ sites.blueprint.manage หากไม่มีสิทธิ์ ระบบจะปฏิเสธด้วยรหัส 403 แทนที่จะเป็น 404
ปลายทางนี้ไม่ต้องใช้รหัสองค์กร คีย์ของคุณระบุองค์กรที่เป็นเจ้าของอยู่แล้ว และการตอบกลับจะถูกจำกัดขอบเขตไว้เฉพาะองค์กรนั้น
ทดลองใช้เลย
แทนที่สิ่งใดๆ ที่อยู่ภายในวงเล็บแหลมด้วยค่าของคุณเอง และตัวยึดตำแหน่งคีย์ด้วยคีย์จากแดชบอร์ดของคุณ
curl -X POST https://api.zinndigital.com/v1/site-blueprints \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "site_id": <Uuid>, "name": <string> }'เข้าสู่ระบบแล้วใช่ไหม คอนโซล API ในแดชบอร์ดของคุณจะเติมรหัสองค์กรจริงและคีย์ของคุณเองโดยอัตโนมัติ และทำการส่งคำขอไปยัง API จริง เพื่อให้คุณเห็นผลลัพธ์ที่เป็นข้อมูลจริง เปิดจุดสิ้นสุดนี้ในคอนโซล API
รายละเอียด
Starts a durable capture — a backup of the named site, plus a screenshot of its home page — and answers `202` with the new row in `capturing`. Poll the list. Two shapes. Omit `backup_id` and a **new backup is taken**, which spends one of the site's three per-rolling-day on-demand slots and is refused with a `429` naming when the next opens. Give `backup_id` and an **existing stored backup is adopted**: the blueprint is `ready` immediately and no allowance is spent, which is what a customer wants when this morning's site is broken and last night's is the template. The site must be `active` — a template of a half-built or failed site is not a thing anybody means to make — and its hosting must be able to produce a backup at all. Requires `sites.blueprint.manage`.
พารามิเตอร์
| ชื่อ | ประเภท | จำเป็นต้องมี | ลักษณะของสิ่งนี้ |
|---|---|---|---|
Idempotency-Key (header) | string | ไม่ใช่ | Client-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats. |
เนื้อหาคำขอ
| ชื่อ | ประเภท | จำเป็นต้องมี | ลักษณะของสิ่งนี้ |
|---|---|---|---|
site_id | Uuid | ใช่ | The built site to capture. Must be `active`. |
name | string | ใช่ | — |
notes | string | ไม่ใช่ | — |
backup_id | Uuid | null | ไม่ใช่ | An existing **stored** backup of that site to adopt, instead of taking a new one. Adopting spends none of the site's three-per-rolling-day on-demand allowance and makes the blue… |
การตอบกลับ
| ชื่อ | ประเภท | จำเป็นต้องมี | ลักษณะของสิ่งนี้ |
|---|---|---|---|
id | Uuid | ใช่ | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
name | string | ใช่ | — |
notes | string | ใช่ | The customer's own note, so they can tell their templates apart. |
status | SiteBlueprintStatus | ใช่ | Where a capture got to. `ready` means the backup behind the blueprint is restorable, not merely that the row was written — a backup that ended "on host only" (no object storage… |
message | string | ไม่ใช่ | Why a capture failed, in human English. Empty otherwise. Rendered to the customer verbatim. |
stack_type | StackType | ใช่ | The stack the source site ran, **copied at capture time**. This is the compatibility axis: a blueprint can only be deployed onto a site of the same stack. Copied rather than rea… |
runtime | Runtime | ใช่ | The runtime the web server serves the site with. |
product_line | string | ใช่ | The line the source site was on. **Advisory** — shown so a customer can tell a PBN template from a mainstream one — and deliberately NOT part of the compatibility guard: moving… |
source_domain | string | ใช่ | The domain of the site this was captured from, kept after that site is gone. |
source_site_id | Uuid | null | ใช่ | The site it came from, or null once that site has been deleted. |
has_screenshot | boolean | ใช่ | Whether a picture exists. ⛔ Deliberately a boolean and not a URL: minting a presigned URL is a round trip to object storage, and doing it per row on a list endpoint would put an… |
deployable | boolean | ใช่ | Whether a site can be built from this **today**. Three conditions, not one: the capture finished, a backup is linked, and that backup is still restorable. A `ready` blueprint wh… |
deployment_count | integer | ใช่ | How many sites have been built from this blueprint. |
created_at | string | ใช่ | — |
updated_at | string | ใช่ | — |
ข้อผิดพลาดที่เอนด์พอยต์นี้สามารถส่งกลับได้
401 · 403 · 404 · 409 · 422 · 429 · 503