hosting
PUT /v1/sites/{siteId}/repo
Connect (or re-connect) a repository to a 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 PUT https://api.zinndigital.com/v1/sites/{siteId}/repo \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "provider": <string>, "repo": <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
Confirms the repository exists on the connected account, stores the connection, and creates or updates the provider-side push webhook — and, when `build_mode` is `ci`, commits the Zinn® build workflow to the repository. The provider work happens before the row is reported as connected, so a hook that could not be created never leaves a row claiming it was. 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ì |
|---|---|---|---|
provider | string | Có | — |
owner | string | Không | — |
repo | string | Có | — |
branch | string | Không | — |
build_mode | BuildMode | Không | How the published files are produced. `publish` serves the repository's own files — right for plain HTML and for a repo whose generator output is committed. `ci` runs the build… |
build_command | string | Không | — |
output_dir | string | Không | — |
publish_branch | string | Không | — |
auto_deploy | boolean | Không | — |
Phản hồi
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
site_id | Uuid | Có | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
provider | string | Có | The git provider — `github` or `gitlab`. A machine identifier. |
owner | string | Có | The account or namespace the repository lives under. |
repo | string | Có | — |
full_name | string | Có | `owner/repo`, or just the repo when the account owns its namespace. |
branch | string | Có | The branch a push deploys from. |
build_mode | BuildMode | Có | How the published files are produced. `publish` serves the repository's own files — right for plain HTML and for a repo whose generator output is committed. `ci` runs the build… |
build_command | string | Có | Blank in `publish` mode — a stored command nothing runs would read as a build. |
output_dir | string | Có | Which directory is published. Blank means the repository root. |
publish_branch | string | Có | Where CI commits the built output in `ci` mode. |
auto_deploy | boolean | Có | Whether a push deploys automatically. Off still records every delivery, so a customer can watch pushes arriving before letting us act on them. |
webhook_url | string | Có | The URL the provider was told to deliver to. Computed, never stored — a stored copy would keep naming the origin that was current when the row was written. Blank on an environme… |
webhook_registered | boolean | Có | Whether a provider-side hook actually exists. False here with a connection present means pushes are NOT being watched. |
last_delivery_at | object | Có | When the provider last delivered anything, or null for NEVER. Null is the single most useful diagnostic on this screen: "connected but never delivered" is what a mis-scoped toke… |
last_delivery_note | string | Có | What we did with the last delivery, including when we ignored it. Written for every delivery, because "never delivered" and "delivering, ignored" are different problems with dif… |
connected_account | string | Có | The label of the credential connection this repository is read with. |
Các lỗi điểm cuối này có thể trả về
401 · 403 · 404 · 422 · 429