--- title: Redirect description: Manage 301 redirects for a merchant's online store. api_version: 2025-10 api_name: admin-rest api_type: rest source_url: html: https://shopify.dev/docs/api/admin-rest/latest/resources/redirect md: https://shopify.dev/docs/api/admin-rest/latest/resources/redirect.md --- ![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg) The REST Admin API is a legacy API as of October 1, 2024. Starting April 1, 2025, all new public apps must be built exclusively with the [GraphQL Admin API](https://shopify.dev/docs/api/admin-graphql). For details and migration steps, visit our [migration guide](https://shopify.dev/docs/apps/build/graphql/migrate). # Redirect Requires `content` access scope. A redirect causes a visitor on a specific path on the shop's site to be automatically sent to a different location, called the **target**. The target can be a new path on the shop's site or a full URL. The new URL can even be on a completely different domain. Redirect paths are unique, so a shop can't have more than one redirect with the same path. \# ## Endpoints * [post](https://shopify.dev/docs/api/admin-rest/latest/resources/redirect#post-redirects) [/admin/api/latest/redirects.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/redirect#post-redirects) Creates a redirect [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/urlRedirectCreate?example=creates-a-redirect) [urlRedirectCreate](https://shopify.dev/docs/api/admin-graphql/latest/mutations/urlRedirectCreate?example=creates-a-redirect) * [get](https://shopify.dev/docs/api/admin-rest/latest/resources/redirect#get-redirects?since-id=668809255) [/admin/api/latest/redirects.​json?since\_​id=668809255](https://shopify.dev/docs/api/admin-rest/latest/resources/redirect#get-redirects?since-id=668809255) Retrieves a list of URL redirects [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/urlRedirects?example=retrieves-a-list-of-url-redirects) [urlRedirects](https://shopify.dev/docs/api/admin-graphql/latest/queries/urlRedirects?example=retrieves-a-list-of-url-redirects) * [get](https://shopify.dev/docs/api/admin-rest/latest/resources/redirect#get-redirects-redirect-id) [/admin/api/latest/redirects/{redirect\_​id}.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/redirect#get-redirects-redirect-id) Retrieves a single redirect [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/urlRedirect?example=retrieves-a-single-redirect) [urlRedirect](https://shopify.dev/docs/api/admin-graphql/latest/queries/urlRedirect?example=retrieves-a-single-redirect) * [get](https://shopify.dev/docs/api/admin-rest/latest/resources/redirect#get-redirects-count) [/admin/api/latest/redirects/count.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/redirect#get-redirects-count) Retrieves a count of URL redirects [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/urlRedirectsCount?example=retrieves-a-count-of-url-redirects) [urlRedirectsCount](https://shopify.dev/docs/api/admin-graphql/latest/queries/urlRedirectsCount?example=retrieves-a-count-of-url-redirects) * [put](https://shopify.dev/docs/api/admin-rest/latest/resources/redirect#put-redirects-redirect-id) [/admin/api/latest/redirects/{redirect\_​id}.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/redirect#put-redirects-redirect-id) Updates an existing redirect [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/urlRedirectUpdate?example=updates-an-existing-redirect) [urlRedirectUpdate](https://shopify.dev/docs/api/admin-graphql/latest/mutations/urlRedirectUpdate?example=updates-an-existing-redirect) * [del](https://shopify.dev/docs/api/admin-rest/latest/resources/redirect#delete-redirects-redirect-id) [/admin/api/latest/redirects/{redirect\_​id}.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/redirect#delete-redirects-redirect-id) Deletes a redirect [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/urlRedirectDelete?example=deletes-a-redirect) [urlRedirectDelete](https://shopify.dev/docs/api/admin-graphql/latest/mutations/urlRedirectDelete?example=deletes-a-redirect) *** ## The Redirect resource ### Properties *** id read-only -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/objects/UrlRedirect#field-UrlRedirect.fields.id) [id](https://shopify.dev/docs/api/admin-graphql/latest/objects/UrlRedirect#field-UrlRedirect.fields.id) The ID for the redirect. *** path -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/objects/UrlRedirect#field-UrlRedirect.fields.path) [path](https://shopify.dev/docs/api/admin-graphql/latest/objects/UrlRedirect#field-UrlRedirect.fields.path) The old path to be redirected. When the user visits this path, they will be redirected to the target. (maximum: 1024 characters) *** target -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/objects/UrlRedirect#field-UrlRedirect.fields.target) [target](https://shopify.dev/docs/api/admin-graphql/latest/objects/UrlRedirect#field-UrlRedirect.fields.target) The target location where the user will be redirected. When the user visits the old path specified by the `path` property, they will be redirected to this location. This property can be set to any path on the shop's site, or to an external URL. (maximum: 255 characters) *** {} ## The Redirect resource ```json { "id": 304339089, "path": "/products.php", "target": "/products" } ``` *** ## postCreates a redirect [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/urlRedirectCreate?example=creates-a-redirect) [urlRedirectCreate](https://shopify.dev/docs/api/admin-graphql/latest/mutations/urlRedirectCreate?example=creates-a-redirect) Creates a redirect. When you provide a full URL as the value of the `path` property, it will be saved as an absolute path without the domain. For example, `"path": "http://www.example.com/springwear"` will be saved as `"path": "springwear"`. ### Parameters *** api\_version string required *** ### Examples Create a redirect Request body redirect​ Redirect resource Show redirect properties redirect.path:​"/ipod" -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/UrlRedirectInput#fields-path) [path](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/UrlRedirectInput#fields-path) The old path to be redirected. When the user visits this path, they will be redirected to the target. (maximum: 1024 characters) redirect.target:​"/pages/itunes" -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/UrlRedirectInput#fields-target) [target](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/UrlRedirectInput#fields-target) The target location where the user will be redirected. When the user visits the old path specified by the `path` property, they will be redirected to this location. This property can be set to any path on the shop's site, or to an external URL. (maximum: 255 characters) Create a redirect using a full URL for the path, which will be saved as an absolute path without a domain Request body redirect​ Redirect resource Show redirect properties redirect.path:​"http\://www\.apple.com/forums" -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/UrlRedirectInput#fields-path) [path](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/UrlRedirectInput#fields-path) The old path to be redirected. When the user visits this path, they will be redirected to the target. (maximum: 1024 characters) redirect.target:​"http\://forums.apple.com" -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/UrlRedirectInput#fields-target) [target](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/UrlRedirectInput#fields-target) The target location where the user will be redirected. When the user visits the old path specified by the `path` property, they will be redirected to this location. This property can be set to any path on the shop's site, or to an external URL. (maximum: 255 characters) Creating a redirect without a path or target fails and returns an error post ## /admin/api/2025-10/redirects.​json ```bash curl -d '{"redirect":{"path":"/ipod","target":"/pages/itunes"}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/redirects.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` {} ## Response JSON ```json HTTP/1.1 201 Created { "redirect": { "id": 984542200, "path": "/ipod", "target": "/pages/itunes" } } ``` ### examples * #### Create a redirect ##### ```curl curl -d '{"redirect":{"path":"/ipod","target":"/pages/itunes"}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/redirects.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const redirect = new admin.rest.resources.Redirect({session: session}); redirect.path = "/ipod"; redirect.target = "/pages/itunes"; await redirect.save({ update: true, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session redirect = ShopifyAPI::Redirect.new(session: test_session) redirect.path = "/ipod" redirect.target = "/pages/itunes" redirect.save! ``` ##### ```node // Session is built by the OAuth process const redirect = new shopify.rest.Redirect({session: session}); redirect.path = "/ipod"; redirect.target = "/pages/itunes"; await redirect.save({ update: true, }); ``` #### response ```json HTTP/1.1 201 Created{"redirect":{"id":984542200,"path":"/ipod","target":"/pages/itunes"}} ``` * #### Create a redirect using a full URL for the path, which will be saved as an absolute path without a domain ##### ```curl curl -d '{"redirect":{"path":"http://www.apple.com/forums","target":"http://forums.apple.com"}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/redirects.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const redirect = new admin.rest.resources.Redirect({session: session}); redirect.path = "http://www.apple.com/forums"; redirect.target = "http://forums.apple.com"; await redirect.save({ update: true, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session redirect = ShopifyAPI::Redirect.new(session: test_session) redirect.path = "http://www.apple.com/forums" redirect.target = "http://forums.apple.com" redirect.save! ``` ##### ```node // Session is built by the OAuth process const redirect = new shopify.rest.Redirect({session: session}); redirect.path = "http://www.apple.com/forums"; redirect.target = "http://forums.apple.com"; await redirect.save({ update: true, }); ``` #### response ```json HTTP/1.1 201 Created{"redirect":{"id":984542199,"path":"/forums","target":"http://forums.apple.com/"}} ``` * #### Creating a redirect without a path or target fails and returns an error ##### ```curl curl -d '{"redirect":{"body":"foobar"}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/redirects.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const redirect = new admin.rest.resources.Redirect({session: session}); redirect.body = "foobar"; await redirect.save({ update: true, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session redirect = ShopifyAPI::Redirect.new(session: test_session) redirect.body = "foobar" redirect.save! ``` ##### ```node // Session is built by the OAuth process const redirect = new shopify.rest.Redirect({session: session}); redirect.body = "foobar"; await redirect.save({ update: true, }); ``` #### response ```json HTTP/1.1 422 Unprocessable Entity{"errors":{"path":["can't be blank"],"target":["can't be blank","can't be the same as path"]}} ``` *** ## getRetrieves a list of URL redirects [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/urlRedirects?example=retrieves-a-list-of-url-redirects) [urlRedirects](https://shopify.dev/docs/api/admin-graphql/latest/queries/urlRedirects?example=retrieves-a-list-of-url-redirects) Retrieves a list of URL redirects. **Note:** This endpoint implements pagination by using links that are provided in the response header. To learn more, refer to [Make paginated requests to the REST Admin API](https://shopify.dev/api/usage/pagination-rest). ### Parameters *** api\_version string required *** fields Show only certain fields, specified by a comma-separated list of field names. *** limit ≤ 250 default 50 The maximum number of results to show. *** path Show redirects with a given path. *** since\_id Restrict results to after the specified ID. *** target Show redirects with a given target. *** ### Examples Retrieve a list of URL redirects after a specified ID Query parameters since\_​id=​668809255 Restrict results to after the specified ID. Retrieve a list of all redirects get ## /admin/api/2025-10/redirects.​json?since\_​id=​668809255 ```bash curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/redirects.json?since_id=668809255" \ -H "X-Shopify-Access-Token: {access_token}" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "redirects": [ { "id": 950115854, "path": "/ibook", "target": "/products/macbook" } ] } ``` ### examples * #### Retrieve a list of URL redirects after a specified ID ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/redirects.json?since_id=668809255" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.Redirect.all({ session: session, since_id: "668809255", }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Redirect.all( session: test_session, since_id: "668809255", ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.Redirect.all({ session: session, since_id: "668809255", }); ``` #### response ```json HTTP/1.1 200 OK{"redirects":[{"id":950115854,"path":"/ibook","target":"/products/macbook"}]} ``` * #### Retrieve a list of all redirects ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/redirects.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.Redirect.all({ session: session, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Redirect.all( session: test_session, ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.Redirect.all({ session: session, }); ``` #### response ```json HTTP/1.1 200 OK{"redirects":[{"id":304339089,"path":"/products.php","target":"/products"},{"id":668809255,"path":"/leopard","target":"/pages/macosx"},{"id":950115854,"path":"/ibook","target":"/products/macbook"}]} ``` *** ## getRetrieves a single redirect [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/urlRedirect?example=retrieves-a-single-redirect) [urlRedirect](https://shopify.dev/docs/api/admin-graphql/latest/queries/urlRedirect?example=retrieves-a-single-redirect) Retrieves a single redirect ### Parameters *** api\_version string required *** redirect\_id string required *** fields Show only certain fields, specified by a comma-separated list of field names. *** ### Examples Retrieve a single redirect by its ID Path parameters redirect\_​id=​668809255 string required get ## /admin/api/2025-10/redirects/668809255.​json ```bash curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/redirects/668809255.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "redirect": { "id": 668809255, "path": "/leopard", "target": "/pages/macosx" } } ``` ### examples * #### Retrieve a single redirect by its ID ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/redirects/668809255.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.Redirect.find({ session: session, id: 668809255, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Redirect.find( session: test_session, id: 668809255, ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.Redirect.find({ session: session, id: 668809255, }); ``` #### response ```json HTTP/1.1 200 OK{"redirect":{"id":668809255,"path":"/leopard","target":"/pages/macosx"}} ``` *** ## getRetrieves a count of URL redirects [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/urlRedirectsCount?example=retrieves-a-count-of-url-redirects) [urlRedirectsCount](https://shopify.dev/docs/api/admin-graphql/latest/queries/urlRedirectsCount?example=retrieves-a-count-of-url-redirects) Retrieves a count of URL redirects ### Parameters *** api\_version string required *** path Count redirects with given path. *** target Count redirects with given target. *** ### Examples Count all redirects get ## /admin/api/2025-10/redirects/count.​json ```bash curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/redirects/count.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "count": 3 } ``` ### examples * #### Count all redirects ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/redirects/count.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.Redirect.count({ session: session, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Redirect.count( session: test_session, ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.Redirect.count({ session: session, }); ``` #### response ```json HTTP/1.1 200 OK{"count":3} ``` *** ## putUpdates an existing redirect [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/urlRedirectUpdate?example=updates-an-existing-redirect) [urlRedirectUpdate](https://shopify.dev/docs/api/admin-graphql/latest/mutations/urlRedirectUpdate?example=updates-an-existing-redirect) Updates an existing [redirect](https://shopify.dev/api/admin-rest/latest/resources/redirect) ### Parameters *** api\_version string required *** redirect\_id string required *** ### Examples Update both the source (path) and target URIs of a redirect Path parameters redirect\_​id=​950115854 string required Request body redirect​ Redirect resource Show redirect properties redirect.id:​950115854 read-only The ID for the redirect. redirect.path:​"/powermac" -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/UrlRedirectInput#fields-path) [path](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/UrlRedirectInput#fields-path) The old path to be redirected. When the user visits this path, they will be redirected to the target. (maximum: 1024 characters) redirect.target:​"/pages/macpro" -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/UrlRedirectInput#fields-target) [target](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/UrlRedirectInput#fields-target) The target location where the user will be redirected. When the user visits the old path specified by the `path` property, they will be redirected to this location. This property can be set to any path on the shop's site, or to an external URL. (maximum: 255 characters) Update the source (path) URI of a redirect Path parameters redirect\_​id=​668809255 string required Request body redirect​ Redirect resource Show redirect properties redirect.id:​668809255 read-only The ID for the redirect. redirect.path:​"/tiger" -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/UrlRedirectInput#fields-path) [path](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/UrlRedirectInput#fields-path) The old path to be redirected. When the user visits this path, they will be redirected to the target. (maximum: 1024 characters) Update the target URI of a redirect Path parameters redirect\_​id=​668809255 string required Request body redirect​ Redirect resource Show redirect properties redirect.id:​668809255 read-only The ID for the redirect. redirect.target:​"/pages/macpro" -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/UrlRedirectInput#fields-target) [target](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/UrlRedirectInput#fields-target) The target location where the user will be redirected. When the user visits the old path specified by the `path` property, they will be redirected to this location. This property can be set to any path on the shop's site, or to an external URL. (maximum: 255 characters) put ## /admin/api/2025-10/redirects/950115854.​json ```bash curl -d '{"redirect":{"id":950115854,"path":"/powermac","target":"/pages/macpro"}}' \ -X PUT "https://your-development-store.myshopify.com/admin/api/2025-10/redirects/950115854.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "redirect": { "path": "/powermac", "target": "/pages/macpro", "id": 950115854 } } ``` ### examples * #### Update both the source (path) and target URIs of a redirect ##### ```curl curl -d '{"redirect":{"id":950115854,"path":"/powermac","target":"/pages/macpro"}}' \ -X PUT "https://your-development-store.myshopify.com/admin/api/2025-10/redirects/950115854.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const redirect = new admin.rest.resources.Redirect({session: session}); redirect.id = 950115854; redirect.path = "/powermac"; redirect.target = "/pages/macpro"; await redirect.save({ update: true, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session redirect = ShopifyAPI::Redirect.new(session: test_session) redirect.id = 950115854 redirect.path = "/powermac" redirect.target = "/pages/macpro" redirect.save! ``` ##### ```node // Session is built by the OAuth process const redirect = new shopify.rest.Redirect({session: session}); redirect.id = 950115854; redirect.path = "/powermac"; redirect.target = "/pages/macpro"; await redirect.save({ update: true, }); ``` #### response ```json HTTP/1.1 200 OK{"redirect":{"path":"/powermac","target":"/pages/macpro","id":950115854}} ``` * #### Update the source (path) URI of a redirect ##### ```curl curl -d '{"redirect":{"id":668809255,"path":"/tiger"}}' \ -X PUT "https://your-development-store.myshopify.com/admin/api/2025-10/redirects/668809255.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const redirect = new admin.rest.resources.Redirect({session: session}); redirect.id = 668809255; redirect.path = "/tiger"; await redirect.save({ update: true, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session redirect = ShopifyAPI::Redirect.new(session: test_session) redirect.id = 668809255 redirect.path = "/tiger" redirect.save! ``` ##### ```node // Session is built by the OAuth process const redirect = new shopify.rest.Redirect({session: session}); redirect.id = 668809255; redirect.path = "/tiger"; await redirect.save({ update: true, }); ``` #### response ```json HTTP/1.1 200 OK{"redirect":{"path":"/tiger","target":"/pages/macosx","id":668809255}} ``` * #### Update the target URI of a redirect ##### ```curl curl -d '{"redirect":{"id":668809255,"target":"/pages/macpro"}}' \ -X PUT "https://your-development-store.myshopify.com/admin/api/2025-10/redirects/668809255.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const redirect = new admin.rest.resources.Redirect({session: session}); redirect.id = 668809255; redirect.target = "/pages/macpro"; await redirect.save({ update: true, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session redirect = ShopifyAPI::Redirect.new(session: test_session) redirect.id = 668809255 redirect.target = "/pages/macpro" redirect.save! ``` ##### ```node // Session is built by the OAuth process const redirect = new shopify.rest.Redirect({session: session}); redirect.id = 668809255; redirect.target = "/pages/macpro"; await redirect.save({ update: true, }); ``` #### response ```json HTTP/1.1 200 OK{"redirect":{"target":"/pages/macpro","path":"/leopard","id":668809255}} ``` *** ## delDeletes a redirect [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/urlRedirectDelete?example=deletes-a-redirect) [urlRedirectDelete](https://shopify.dev/docs/api/admin-graphql/latest/mutations/urlRedirectDelete?example=deletes-a-redirect) Deletes a redirect ### Parameters *** api\_version string required *** redirect\_id string required *** ### Examples Delete an existing redirect Path parameters redirect\_​id=​668809255 string required del ## /admin/api/2025-10/redirects/668809255.​json ```bash curl -X DELETE "https://your-development-store.myshopify.com/admin/api/2025-10/redirects/668809255.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` {} ## Response JSON ```json HTTP/1.1 200 OK {} ``` ### examples * #### Delete an existing redirect ##### ```curl curl -X DELETE "https://your-development-store.myshopify.com/admin/api/2025-10/redirects/668809255.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.Redirect.delete({ session: session, id: 668809255, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Redirect.delete( session: test_session, id: 668809255, ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.Redirect.delete({ session: session, id: 668809255, }); ``` #### response ```json HTTP/1.1 200 OK{} ```