Skip to content

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_idstringrequired

    The store's ID, like store_01k8qs5s…. Apps get it with the install, in the OAuth redirect and the token response.

Headers

  • Idempotency-Keystring

    Send the same key to retry safely: the first answer is replayed for 24 hours.

  • shop-api-versionYYYY-MM

    The version to answer in. Without it, your app’s pinned version, else the newest.

Body

  • pathstringrequired

    The old path; a full URL of another site counts by its path and query.

  • targetstringrequired

    A path on the store or an http(s) URL.

Returns

201 Created.

Errors

  • 403forbiddenMissing permission.
  • 409The path already redirects (path_taken), or the store has 100,000 redirects.
  • 422validation_failedValidation failed, a loop or a chain.