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 sites.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}/databases \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "name": <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
Creates a database and its user, and returns the generated password **exactly once**. The password is generated by this platform rather than chosen by the caller, because it is a machine-to-machine credential that nobody types and a human-chosen one is the weakest link in a stack the customer cannot patch. It is not stored in our records, not logged, and cannot be read back by any endpoint — a customer who loses it creates another database. The effective ceiling is applied before the vendor is called: a package type that does not permit databases, and an allowance that is already spent, are both `422` with a sentence the customer can act on. A name the package already carries is `409`. The vendor prefixes names per package, so the returned `name` is rarely the name that was asked for and the client must show the returned value. `404` for a site with no vendor hosting package. Requires `sites.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ì |
|---|---|---|---|
name | string | Có | The name to ask for. The server's own name is returned in `SiteHostingDatabase.name` and may differ; there is deliberately no password field here, because the platform generates… |
Phản hồi
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
database | SiteHostingDatabase | Có | The created database, exactly as `listSiteDatabases` will report it. |
password | string | Có | The generated password, shown once. Deliberately carries no example — a documented example of a credential field is the shape people copy. |
Các lỗi điểm cuối này có thể trả về
401 · 403 · 404 · 409 · 422 · 429 · 503