# UrlRedirect - admin - OBJECT
Version: 2025-01

## Description
The URL redirect for the online store.

### Access Scopes
`read_online_store_navigation` access scope.


## Fields
* [id](/docs/api/admin/2025-01/scalars/ID): ID! - The ID of the URL redirect.
* [path](/docs/api/admin/2025-01/scalars/String): String! - The old path to be redirected from. When the user visits this path, they will be redirected to the target location.
* [target](/docs/api/admin/2025-01/scalars/String): String! - The target location where the user will be redirected to.

## Connections



## Related queries
* [urlRedirect](/docs/api/admin/2025-01/queries/urlRedirect) Returns a redirect resource by ID.
* [urlRedirects](/docs/api/admin/2025-01/queries/urlRedirects) A list of redirects for a shop.

## Related mutations
* [urlRedirectCreate](/docs/api/admin/2025-01/mutations/urlRedirectCreate) Creates a [`UrlRedirect`](https://shopify.dev/api/admin-graphql/latest/objects/UrlRedirect) object.
* [urlRedirectUpdate](/docs/api/admin/2025-01/mutations/urlRedirectUpdate) Updates a URL redirect.

## Related Unions

## Examples
### Retrieves a single redirect
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query UrlRedirect($id: ID!) { urlRedirect(id: $id) { id path target } }\",\n \"variables\": {\n    \"id\": \"gid://shopify/UrlRedirect/905192165\"\n  }\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: {\n    \"query\": `query UrlRedirect($id: ID!) {\n      urlRedirect(id: $id) {\n        id\n        path\n        target\n      }\n    }`,\n    \"variables\": {\n      \"id\": \"gid://shopify/UrlRedirect/905192165\"\n    },\n  },\n});\n"
Ruby example: "session = ShopifyAPI::Auth::Session.new(\n  shop: \"your-development-store.myshopify.com\",\n  access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n  session: session\n)\n\nquery = <<~QUERY\n  query UrlRedirect($id: ID!) {\n    urlRedirect(id: $id) {\n      id\n      path\n      target\n    }\n  }\nQUERY\n\nvariables = {\n  \"id\": \"gid://shopify/UrlRedirect/905192165\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  query UrlRedirect($id: ID!) {\n    urlRedirect(id: $id) {\n      id\n      path\n      target\n    }\n  }`,\n  {\n    variables: {\n      \"id\": \"gid://shopify/UrlRedirect/905192165\"\n    },\n  },\n);\n\nconst data = await response.json();\n"
Graphql query: "query UrlRedirect($id: ID!) {\n  urlRedirect(id: $id) {\n    id\n    path\n    target\n  }\n}"
#### Graphql Input
{
  "id": "gid://shopify/UrlRedirect/905192165"
}
#### Graphql Response
{
  "data": {
    "urlRedirect": {
      "id": "gid://shopify/UrlRedirect/905192165",
      "path": "/about",
      "target": "/pages/aboutus"
    }
  }
}