Create a redirect
POST
/ admin/ v1/ stores/ {store_id}/ redirects- content:write
- Idempotency-Key supported
Create a redirect. The path is normalized (decoded, lowercase, no trailing slash); a path redirecting to itself (redirect_loop) or a redirect into or out of another one (redirect_chain) is refused.
Path parameters
store_idstringrequiredThe store's ID, like
store_01k8qs5s…. Apps get it with the install, in the OAuth redirect and the token response.
Headers
Idempotency-KeystringSend the same key to retry safely: the first answer is replayed for 24 hours.
shop-api-versionYYYY-MMThe version to answer in. Without it, your app’s pinned version, else the newest.
Body
pathstringrequiredThe old path; a full URL of another site counts by its path and query.
targetstringrequiredA path on the store or an http(s) URL.
Returns
201 Created.
Errors
- 403
forbiddenMissing permission. - 409The path already redirects (
path_taken), or the store has 100,000 redirects. - 422
validation_failedValidation failed, a loop or a chain.