Skip to content

Look up a redirect

GET
/public/stores/{storeRef}/url-redirects/lookup
curl --request GET \
--url 'https://apibase.ecomweb.app/api/v1/public/stores/example/url-redirects/lookup?path=example' \
--header 'x-storefront-api-key: <x-storefront-api-key>'

Finds the active redirect for a path of the store, following any chain of redirects to its final destination. data is null when the path has no redirect.

storeRef
required
string

The store’s ref, as returned by GET /stores.

path
required
string

The path to look up, such as /old-page.

Media typeapplication/json
object
data
required

The redirect for the path, or null when the path has none.

object
id
required

Redirect ID.

number
source_path
required

The path that is redirected, such as /old-page.

string
destination_path
required

The final destination, after following any chain of redirects.

string
redirect_type
required

The HTTP status to redirect with, such as 301 or 302.

number
is_active
required

Always true: only active redirects are returned.

boolean
source_type
required

How the redirect was created, such as manual or auto.

string
created_at
required

When the redirect was created, as an ISO 8601 timestamp.

string
updated_at
required

When the redirect was last updated, as an ISO 8601 timestamp.

string
success
required

Always true.

boolean

Example generated

{
"data": {
"id": 1,
"source_path": "example",
"destination_path": "example",
"redirect_type": 1,
"is_active": true,
"source_type": "example",
"created_at": "example",
"updated_at": "example"
},
"success": true
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}