--- title: urlRedirects - GraphQL Admin description: A list of redirects for a shop. api_version: 2026-01 api_name: admin type: query api_type: graphql source_url: html: 'https://shopify.dev/docs/api/admin-graphql/latest/queries/urlRedirects' md: 'https://shopify.dev/docs/api/admin-graphql/latest/queries/urlRedirects.md' --- # url​Redirects query A list of redirects for a shop. ## UrlRedirectConnection arguments [UrlRedirectConnection!](https://shopify.dev/docs/api/admin-graphql/latest/connections/UrlRedirectConnection) * after * before * first * last * query * reverse * savedSearchId * sortKey *** ## Possible returns * edges * nodes * pageInfo *** ## Examples * ### Retrieves a list of URL redirects #### Query ```graphql query UrlRedirects { urlRedirects(first: 100) { edges { node { id path target } } } } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/2026-01/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query UrlRedirects { urlRedirects(first: 100) { edges { node { id path target } } } }" }' ``` #### React Router ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query UrlRedirects { urlRedirects(first: 100) { edges { node { id path target } } } }`, ); const json = await response.json(); return json.data; } ``` #### Ruby ```ruby session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Graphql::Admin.new( session: session ) query = <<~QUERY query UrlRedirects { urlRedirects(first: 100) { edges { node { id path target } } } } QUERY response = client.query(query: query) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: `query UrlRedirects { urlRedirects(first: 100) { edges { node { id path target } } } }`, }); ``` #### Response ```json { "urlRedirects": { "edges": [ { "node": { "id": "gid://shopify/UrlRedirect/510765931", "path": "/page%20with%20many%20spaces", "target": "/products/element" } }, { "node": { "id": "gid://shopify/UrlRedirect/891487173", "path": "/about-us", "target": "/pages/aboutus" } }, { "node": { "id": "gid://shopify/UrlRedirect/905192165", "path": "/about", "target": "/pages/aboutus" } }, { "node": { "id": "gid://shopify/UrlRedirect/979034143", "path": "/2008/01/01/look-at-my-cool-new-snowboard", "target": "/products/draft" } }, { "node": { "id": "gid://shopify/UrlRedirect/984542198", "path": "/aboutus", "target": "/pages/aboutus" } } ] } } ```