partner
POST /v1/partner/customers/{externalId}/site-moves
Move one of your customer's sites onto their money-site hosting, from an archive.
Аутентификација
Пошаљите API кључ као bearer токен. Кључ мора имати дозволу partner.domains; кључ без ње се одбија уз 403, а не 404.
Ова крајња тачка не прихвата id организације. Ваш кључ већ идентификује организацију којој припада, а одговор је ограничен на њу.
Испробајте
Замените све што је у угластим заградама сопственим вредностима, а чувар места кључа кључем са своје контролне табле.
curl -X POST https://api.zinndigital.com/v1/partner/customers/{externalId}/site-moves \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "subscription_id": <string>, "domain": <string>, "app": <string>, "archive_url": <string>, "archive_sha256": <string> }'Пријављени сте? API конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом API-ју како бисте могли да видите стварни одговор. Отворите ову крајњу тачку у API конзоли
Детаљи
Starts an asynchronous move of ONE site into the customer's hosting plan (docs/808 §12). Nothing is charged: the move spends a site slot the customer already pays for. The call is validated and answered at once (202); the work runs as a durable workflow and is read back with getPartnerSiteMove. The archive. archive_url is an https link our hosting box downloads directly (never through this API): a .tar.gz (or .zip) holding the document root under www/ and, for a site with a database, a MySQL dump named dump.sql at the top level — the V1 backup layout. The link must answer without cookies and must survive a HEAD plus up to three GETs (a retried download fetches again). archive_sha256 is checked on the box before anything is applied; a mismatch fails the move with archive_checksum_mismatch without touching the site. The site. It is created in the customer's organization on the plan named by subscription_id, on domain, with app (a key from getPartnerCapabilities site_moves.plans[].apps). Or pass replace_site_id — one of listPartnerHostingSlots replaceable_sites — to import into that empty site and move it onto domain instead of taking a new slot. domain may be the replaced site's own name (an empty_starter is built on the customer's real domain); that is not domain_in_use. A replaced empty_starter that has content on it when the move starts fails with replace_site_not_empty, and nothing on it is touched. The domain's DNS is never touched: it keeps pointing where it points until you repoint it, and it may stay in your (or your customer's) Cloudflare for good. A subdomain whose apex is somebody else's live site is fine. Refusals (422, details[0].code): no_free_slot, subscription_not_found, app_not_supported_by_plan, plan_cannot_import, domain_invalid, domain_in_use, archive_url_invalid, archive_checksum_invalid, replace_site_not_replaceable, move_already_running, idempotency_key_required, moves_not_open, no_capacity, dns_invalid, not_linked. There is no size limit (D28455): room is made for a large archive, and the move is slower, never refused. DNS (contract v2). dns says where the zone is held and who changes it: with auto_switch: true YOU repoint the record when the move reaches step: ready_to_switch (then call go-live); otherwise the customer is shown and e-mailed the exact records, the change is detected automatically, and the move goes live on its own. A retry with the same Idempotency-Key returns the same move. Requires partner.domains.
Параметри
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
externalId (path) | string | Да | YOUR id for that customer — whatever your own system calls them. It is what makes linking idempotent, and it is scoped to your partner programme: another partner's id is a 404… |
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. |
Тело захтева
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
subscription_id | string | Да | The customer's hosting subscription the site moves onto — a subscription_id from listPartnerHostingSlots. |
domain | string | Да | The hostname the site serves on, apex or subdomain. Its DNS stays where it is. |
app | string | Да | What the site is built with: wordpress, php (a plain PHP or static-HTML document root) or an application key the plan lists in site_moves.plans[].apps. |
php_version | string | Не | Optional PHP version, e.g. 8.3. Omit for the plan's default. |
archive_url | string | Да | The https link to the archive. Never echoed back. |
archive_sha256 | string | Да | Lower-case hex SHA-256 of the archive file, checked before it is applied. |
archive_bytes | integer | Не | The archive's size in bytes, when you know it. |
replace_site_id | object | Не | Import into this empty site instead of taking a new slot — one of listPartnerHostingSlots replaceable_sites. |
source_ref | string | Не | Your own id for the site being moved, echoed back on every read. |
dns | PartnerSiteMoveDns | Не | Where the domain's zone is held and who changes it. Omitted, it is unknown and the customer-switch path applies (exact records shown and e-mailed, change detected). |
source | object | Не | Facts about the source site the post-import fix-ups use. |
Одговор
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
id | string | Да | — |
status | string<queued, importing, imported, going_live, live, failed, cancelled> | Да | imported — built and answering on preview_url; switch DNS, then call goLivePartnerSiteMove. live — the domain is served by us over HTTPS; only now delete the original. |
domain | string | Да | — |
app | string | Да | — |
subscription_id | string | Да | — |
v2_site_id | object | Да | Our site id, once the site exists. |
source_ref | string | Да | — |
replaced_site | boolean | Да | Whether the move imported into an existing empty site. |
preview_url | string | Да | An https address that serves the imported site with no DNS change, or "" until imported. |
origin | object | Да | What the domain's web record must point at. Publish an A to each a address; aaaa is empty while the box has no IPv6 — publish no AAAA then. |
tls | object | Да | — |
checks | object | Да | What we measured on the preview after the import. |
error_code | string | Да | — |
error | string | Да | — |
created_at | string | Да | — |
updated_at | string | Да | — |
live_at | object | Да | — |
step | string<queued, creating_site, waiting_for_space, downloading, importing_files, importing_database, checking, ready_to_switch, waiting_for_dns, switching, securing, live, failed, cancelled> | Не | Where the move is, finer than status — show it with progress and elapsed_seconds so a long import never looks crashed. There is no size limit and no clock on a move's size… |
progress | object | Не | Measured on the hosting box while it applies the archive. null means not known yet — never zero. |
started_at | string | Не | — |
step_started_at | object | Не | — |
elapsed_seconds | integer | Не | — |
retryable | boolean | Не | — |
dns_case | string<partner_switch, customer_switch, unknown> | Не | — |
dns_holder | string | Не | — |
switch | object | Не | EXACTLY what to publish for the domain to be served by us. |
rollback_advised | boolean | Не | Your switch did not take within the attempt: restore the records you saved in dns.current. The original never stopped serving. |
waiting_since | object | Не | — |
reminders_sent | integer | Не | — |
extra_disk_mb | integer | Не | Free disk space (MB) this move gave the site on top of its plan so the move could land whatever its size (D28455). 0 when the plan's own space was enough. Always present. |
extra_disk_expires_at | object | Не | When extra_disk_mb ends: 7 days after live_at (D28457). null while the move is still running (the extra is open-ended until it goes live) or when there is no extra.… |
Грешке које ова крајња тачка може вратити
401 · 403 · 404 · 422 · 429