Skip to content

Create URL Rewrite

Creates a URL rewrite — the Create action on the admin Marketing → Search & SEO → URL Rewrites screen.

TIP

New here? Read the URL Rewrites overview for what a URL rewrite does and how its fields behave.

Endpoint

EndpointMethod
/api/admin/marketing/url-rewritesPOST

Details

  • Requires an admin Bearer token and the marketing.search_seo.url_rewrites.create permission.
  • Returns the full rewrite payload.

Request body

FieldTypeRequiredNotes
entity_typestringyesproduct, category, or cms_page
request_pathstringyesSource path the shopper requests
target_pathstringyesPath the shopper is redirected to
redirect_typestringyes301 permanent / 302 temporary
localestringyesLocale code; must exist in the store's locales

Released under the MIT License.