hosting
POST /v1/sites/{siteId}/wordpress/search-replace/preview
Count what a search and replace would change, without changing anything.
Authentication
Send an API key as a bearer token. The key must carry the sites.view permission; a key without it is refused with 403, not 404.
This endpoint takes no organisation id. Your key already identifies the organisation it belongs to, and the response is scoped to it.
Try it
Replace anything in angle brackets with your own values, and the key placeholder with a key from your dashboard.
curl -X POST https://api.zinndigital.com/v1/sites/{siteId}/wordpress/search-replace/preview \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "search": <string>, "replace": <string> }'Signed in? The API console in your dashboard fills in your real organisation id and your own key, and runs the request against the live API so you can see the actual response. Open this endpoint in the API console
Details
P3-094. A wp search-replace --dry-run with the run's own flags (--all-tables --precise --report-changed-only, and the same tables), so the count a customer confirms is the count the run rewrites. matches lists each table column with at least one match; total is wp-cli's own figure. Read-only: no backup, no activity row. Runs in the request; a database too large to scan within the request budget answers 503, and the rewrite itself can still be run. The same refusals as the run (wp_search_replace capability, WordPress installed, non-blank search). Requires sites.view and sites.panel_access.
Parameters
| Name | Type | Required | What it is |
|---|---|---|---|
siteId (path) | Uuid | Yes | Site ID (UUIDv7). |
Request body
| Name | Type | Required | What it is |
|---|---|---|---|
search | string | Yes | — |
replace | string | Yes | — |
tables | string[] | No | — |
Response
| Name | Type | Required | What it is |
|---|---|---|---|
total | integer | Yes | — |
matches | object[] | Yes | — |
Errors this endpoint can return
401 · 403 · 404 · 422 · 429 · 503