Redirect
What you can do with Redirect
The Shopify API lets you do the following with the Redirect resource. More detailed versions of these general actions may be available:
- GET /admin/api/2020-01/redirects.json Retrieves a list of URL redirects
- GET /admin/api/2020-01/redirects/count.json Retrieves a count of URL redirects
- GET /admin/api/2020-01/redirects/{redirect_id}.json Retrieves a single redirect
- POST /admin/api/2020-01/redirects.json Creates a redirect
- PUT /admin/api/2020-01/redirects/{redirect_id}.json Updates an existing redirect
- DELETE /admin/api/2020-01/redirects/{redirect_id}.json Deletes a redirect
Redirect properties
id
read-only |
The ID for the redirect. |
path |
The old path to be redirected. When the user visits this path, they will be redirected to the target. (maximum: 1024 characters) |
target |
The target location where the user will be redirected. When the user visits the old path specified by the |
Endpoints
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
limit
|
The maximum number of results to show. (default:50 , maximum: 250 )
|
since_id
|
Restrict results to after the specified ID. |
path
|
Show redirects with a given path. |
target
|
Show redirects with a given target. |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a list of all redirects
GET /admin/api/2020-01/redirects.json
View Response
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"
}
]
}
Retrieve a list of URL redirects after a specified ID
GET /admin/api/2020-01/redirects.json?since_id=668809255
View Response
HTTP/1.1 200 OK
{
"redirects": [
{
"id": 950115854,
"path": "/ibook",
"target": "/products/macbook"
}
]
}
path
|
Count redirects with given path. |
target
|
Count redirects with given target. |
Count all redirects
GET /admin/api/2020-01/redirects/count.json
View Response
HTTP/1.1 200 OK
{
"count": 3
}
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a single redirect by its ID
GET /admin/api/2020-01/redirects/668809255.json
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/leopard",
"target": "/pages/macosx"
}
}
path
property, it will be saved as an absolute path without the domain.
For example, "path": "http://www.johns-apparel.com/springwear"
will be saved as "path": "springwear"
.
Create a redirect
POST /admin/api/2020-01/redirects.json
{
"redirect": {
"path": "/ipod",
"target": "/pages/itunes"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034144,
"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
POST /admin/api/2020-01/redirects.json
{
"redirect": {
"path": "http://www.apple.com/forums",
"target": "http://forums.apple.com"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034145,
"path": "/forums",
"target": "http://forums.apple.com/"
}
}
Creating a redirect without a path or target fails and returns an error
HTTP/1.1 422 Unprocessable Entity
{
"errors": {
"path": [
"can't be blank"
],
"target": [
"can't be blank",
"can't be the same as path"
]
}
}
Update the path URI of a redirect
PUT /admin/api/2020-01/redirects/668809255.json
{
"redirect": {
"id": 668809255,
"path": "/tiger"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/tiger",
"target": "/pages/macosx"
}
}
Update both the path and target URIs of a redirect
PUT /admin/api/2020-01/redirects/950115854.json
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
Delete an existing redirect
DELETE /admin/api/2020-01/redirects/668809255.json
View Response
HTTP/1.1 200 OK
{
}
What you can do with Redirect
The Shopify API lets you do the following with the Redirect resource. More detailed versions of these general actions may be available:
- GET /admin/api/2020-04/redirects.json Retrieves a list of URL redirects
- GET /admin/api/2020-04/redirects/count.json Retrieves a count of URL redirects
- GET /admin/api/2020-04/redirects/{redirect_id}.json Retrieves a single redirect
- POST /admin/api/2020-04/redirects.json Creates a redirect
- PUT /admin/api/2020-04/redirects/{redirect_id}.json Updates an existing redirect
- DELETE /admin/api/2020-04/redirects/{redirect_id}.json Deletes a redirect
Redirect properties
id
read-only |
The ID for the redirect. |
path |
The old path to be redirected. When the user visits this path, they will be redirected to the target. (maximum: 1024 characters) |
target |
The target location where the user will be redirected. When the user visits the old path specified by the |
Endpoints
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
limit
|
The maximum number of results to show. (default:50 , maximum: 250 )
|
since_id
|
Restrict results to after the specified ID. |
path
|
Show redirects with a given path. |
target
|
Show redirects with a given target. |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a list of all redirects
GET /admin/api/2020-04/redirects.json
View Response
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"
}
]
}
Retrieve a list of URL redirects after a specified ID
GET /admin/api/2020-04/redirects.json?since_id=668809255
View Response
HTTP/1.1 200 OK
{
"redirects": [
{
"id": 950115854,
"path": "/ibook",
"target": "/products/macbook"
}
]
}
path
|
Count redirects with given path. |
target
|
Count redirects with given target. |
Count all redirects
GET /admin/api/2020-04/redirects/count.json
View Response
HTTP/1.1 200 OK
{
"count": 3
}
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a single redirect by its ID
GET /admin/api/2020-04/redirects/668809255.json
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/leopard",
"target": "/pages/macosx"
}
}
path
property, it will be saved as an absolute path without the domain.
For example, "path": "http://www.johns-apparel.com/springwear"
will be saved as "path": "springwear"
.
Create a redirect
POST /admin/api/2020-04/redirects.json
{
"redirect": {
"path": "/ipod",
"target": "/pages/itunes"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034144,
"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
POST /admin/api/2020-04/redirects.json
{
"redirect": {
"path": "http://www.apple.com/forums",
"target": "http://forums.apple.com"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034145,
"path": "/forums",
"target": "http://forums.apple.com/"
}
}
Creating a redirect without a path or target fails and returns an error
HTTP/1.1 422 Unprocessable Entity
{
"errors": {
"path": [
"can't be blank"
],
"target": [
"can't be blank",
"can't be the same as path"
]
}
}
Update the path URI of a redirect
PUT /admin/api/2020-04/redirects/668809255.json
{
"redirect": {
"id": 668809255,
"path": "/tiger"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/tiger",
"target": "/pages/macosx"
}
}
Update both the path and target URIs of a redirect
PUT /admin/api/2020-04/redirects/950115854.json
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
Delete an existing redirect
DELETE /admin/api/2020-04/redirects/668809255.json
View Response
HTTP/1.1 200 OK
{
}
What you can do with Redirect
The Shopify API lets you do the following with the Redirect resource. More detailed versions of these general actions may be available:
- GET /admin/api/2020-07/redirects.json Retrieves a list of URL redirects
- GET /admin/api/2020-07/redirects/count.json Retrieves a count of URL redirects
- GET /admin/api/2020-07/redirects/{redirect_id}.json Retrieves a single redirect
- POST /admin/api/2020-07/redirects.json Creates a redirect
- PUT /admin/api/2020-07/redirects/{redirect_id}.json Updates an existing redirect
- DELETE /admin/api/2020-07/redirects/{redirect_id}.json Deletes a redirect
Redirect properties
id
read-only |
The ID for the redirect. |
path |
The old path to be redirected. When the user visits this path, they will be redirected to the target. (maximum: 1024 characters) |
target |
The target location where the user will be redirected. When the user visits the old path specified by the |
Endpoints
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
limit
|
The maximum number of results to show. (default:50 , maximum: 250 )
|
since_id
|
Restrict results to after the specified ID. |
path
|
Show redirects with a given path. |
target
|
Show redirects with a given target. |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a list of all redirects
GET /admin/api/2020-07/redirects.json
View Response
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"
}
]
}
Retrieve a list of URL redirects after a specified ID
GET /admin/api/2020-07/redirects.json?since_id=668809255
View Response
HTTP/1.1 200 OK
{
"redirects": [
{
"id": 950115854,
"path": "/ibook",
"target": "/products/macbook"
}
]
}
path
|
Count redirects with given path. |
target
|
Count redirects with given target. |
Count all redirects
GET /admin/api/2020-07/redirects/count.json
View Response
HTTP/1.1 200 OK
{
"count": 3
}
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a single redirect by its ID
GET /admin/api/2020-07/redirects/668809255.json
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/leopard",
"target": "/pages/macosx"
}
}
path
property, it will be saved as an absolute path without the domain.
For example, "path": "http://www.johns-apparel.com/springwear"
will be saved as "path": "springwear"
.
Create a redirect
POST /admin/api/2020-07/redirects.json
{
"redirect": {
"path": "/ipod",
"target": "/pages/itunes"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034144,
"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
POST /admin/api/2020-07/redirects.json
{
"redirect": {
"path": "http://www.apple.com/forums",
"target": "http://forums.apple.com"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034145,
"path": "/forums",
"target": "http://forums.apple.com/"
}
}
Creating a redirect without a path or target fails and returns an error
HTTP/1.1 422 Unprocessable Entity
{
"errors": {
"path": [
"can't be blank"
],
"target": [
"can't be blank",
"can't be the same as path"
]
}
}
Update the path URI of a redirect
PUT /admin/api/2020-07/redirects/668809255.json
{
"redirect": {
"id": 668809255,
"path": "/tiger"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/tiger",
"target": "/pages/macosx"
}
}
Update both the path and target URIs of a redirect
PUT /admin/api/2020-07/redirects/950115854.json
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
Delete an existing redirect
DELETE /admin/api/2020-07/redirects/668809255.json
View Response
HTTP/1.1 200 OK
{
}
What you can do with Redirect
The Shopify API lets you do the following with the Redirect resource. More detailed versions of these general actions may be available:
- GET /admin/api/2020-10/redirects.json Retrieves a list of URL redirects
- GET /admin/api/2020-10/redirects/count.json Retrieves a count of URL redirects
- GET /admin/api/2020-10/redirects/{redirect_id}.json Retrieves a single redirect
- POST /admin/api/2020-10/redirects.json Creates a redirect
- PUT /admin/api/2020-10/redirects/{redirect_id}.json Updates an existing redirect
- DELETE /admin/api/2020-10/redirects/{redirect_id}.json Deletes a redirect
Redirect properties
id
read-only |
The ID for the redirect. |
path |
The old path to be redirected. When the user visits this path, they will be redirected to the target. (maximum: 1024 characters) |
target |
The target location where the user will be redirected. When the user visits the old path specified by the |
Endpoints
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
limit
|
The maximum number of results to show. (default:50 , maximum: 250 )
|
since_id
|
Restrict results to after the specified ID. |
path
|
Show redirects with a given path. |
target
|
Show redirects with a given target. |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a list of all redirects
GET /admin/api/2020-10/redirects.json
View Response
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"
}
]
}
Retrieve a list of URL redirects after a specified ID
GET /admin/api/2020-10/redirects.json?since_id=668809255
View Response
HTTP/1.1 200 OK
{
"redirects": [
{
"id": 950115854,
"path": "/ibook",
"target": "/products/macbook"
}
]
}
path
|
Count redirects with given path. |
target
|
Count redirects with given target. |
Count all redirects
GET /admin/api/2020-10/redirects/count.json
View Response
HTTP/1.1 200 OK
{
"count": 3
}
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a single redirect by its ID
GET /admin/api/2020-10/redirects/668809255.json
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/leopard",
"target": "/pages/macosx"
}
}
path
property, it will be saved as an absolute path without the domain.
For example, "path": "http://www.johns-apparel.com/springwear"
will be saved as "path": "springwear"
.
Create a redirect
POST /admin/api/2020-10/redirects.json
{
"redirect": {
"path": "/ipod",
"target": "/pages/itunes"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034144,
"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
POST /admin/api/2020-10/redirects.json
{
"redirect": {
"path": "http://www.apple.com/forums",
"target": "http://forums.apple.com"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034145,
"path": "/forums",
"target": "http://forums.apple.com/"
}
}
Creating a redirect without a path or target fails and returns an error
HTTP/1.1 422 Unprocessable Entity
{
"errors": {
"path": [
"can't be blank"
],
"target": [
"can't be blank",
"can't be the same as path"
]
}
}
Update the path URI of a redirect
PUT /admin/api/2020-10/redirects/668809255.json
{
"redirect": {
"id": 668809255,
"path": "/tiger"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/tiger",
"target": "/pages/macosx"
}
}
Update both the path and target URIs of a redirect
PUT /admin/api/2020-10/redirects/950115854.json
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
Delete an existing redirect
DELETE /admin/api/2020-10/redirects/668809255.json
View Response
HTTP/1.1 200 OK
{
}
What you can do with Redirect
The Shopify API lets you do the following with the Redirect resource. More detailed versions of these general actions may be available:
- GET /admin/api/2021-01/redirects.json Retrieves a list of URL redirects
- GET /admin/api/2021-01/redirects/count.json Retrieves a count of URL redirects
- GET /admin/api/2021-01/redirects/{redirect_id}.json Retrieves a single redirect
- POST /admin/api/2021-01/redirects.json Creates a redirect
- PUT /admin/api/2021-01/redirects/{redirect_id}.json Updates an existing redirect
- DELETE /admin/api/2021-01/redirects/{redirect_id}.json Deletes a redirect
Redirect properties
id
read-only |
The ID for the redirect. |
path |
The old path to be redirected. When the user visits this path, they will be redirected to the target. (maximum: 1024 characters) |
target |
The target location where the user will be redirected. When the user visits the old path specified by the |
Endpoints
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
limit
|
The maximum number of results to show. (default:50 , maximum: 250 )
|
since_id
|
Restrict results to after the specified ID. |
path
|
Show redirects with a given path. |
target
|
Show redirects with a given target. |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a list of all redirects
GET /admin/api/2021-01/redirects.json
View Response
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"
}
]
}
Retrieve a list of URL redirects after a specified ID
GET /admin/api/2021-01/redirects.json?since_id=668809255
View Response
HTTP/1.1 200 OK
{
"redirects": [
{
"id": 950115854,
"path": "/ibook",
"target": "/products/macbook"
}
]
}
path
|
Count redirects with given path. |
target
|
Count redirects with given target. |
Count all redirects
GET /admin/api/2021-01/redirects/count.json
View Response
HTTP/1.1 200 OK
{
"count": 3
}
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a single redirect by its ID
GET /admin/api/2021-01/redirects/668809255.json
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/leopard",
"target": "/pages/macosx"
}
}
path
property, it will be saved as an absolute path without the domain.
For example, "path": "http://www.johns-apparel.com/springwear"
will be saved as "path": "springwear"
.
Create a redirect
POST /admin/api/2021-01/redirects.json
{
"redirect": {
"path": "/ipod",
"target": "/pages/itunes"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034144,
"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
POST /admin/api/2021-01/redirects.json
{
"redirect": {
"path": "http://www.apple.com/forums",
"target": "http://forums.apple.com"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034145,
"path": "/forums",
"target": "http://forums.apple.com/"
}
}
Creating a redirect without a path or target fails and returns an error
HTTP/1.1 422 Unprocessable Entity
{
"errors": {
"path": [
"can't be blank"
],
"target": [
"can't be blank",
"can't be the same as path"
]
}
}
Update the path URI of a redirect
PUT /admin/api/2021-01/redirects/668809255.json
{
"redirect": {
"id": 668809255,
"path": "/tiger"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/tiger",
"target": "/pages/macosx"
}
}
Update both the path and target URIs of a redirect
PUT /admin/api/2021-01/redirects/950115854.json
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
Delete an existing redirect
DELETE /admin/api/2021-01/redirects/668809255.json
View Response
HTTP/1.1 200 OK
{
}
What you can do with Redirect
The Shopify API lets you do the following with the Redirect resource. More detailed versions of these general actions may be available:
- GET /admin/api/2021-04/redirects.json Retrieves a list of URL redirects
- GET /admin/api/2021-04/redirects/count.json Retrieves a count of URL redirects
- GET /admin/api/2021-04/redirects/{redirect_id}.json Retrieves a single redirect
- POST /admin/api/2021-04/redirects.json Creates a redirect
- PUT /admin/api/2021-04/redirects/{redirect_id}.json Updates an existing redirect
- DELETE /admin/api/2021-04/redirects/{redirect_id}.json Deletes a redirect
Redirect properties
id
read-only |
The ID for the redirect. |
path |
The old path to be redirected. When the user visits this path, they will be redirected to the target. (maximum: 1024 characters) |
target |
The target location where the user will be redirected. When the user visits the old path specified by the |
Endpoints
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
limit
|
The maximum number of results to show. (default:50 , maximum: 250 )
|
since_id
|
Restrict results to after the specified ID. |
path
|
Show redirects with a given path. |
target
|
Show redirects with a given target. |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a list of all redirects
GET /admin/api/2021-04/redirects.json
View Response
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"
}
]
}
Retrieve a list of URL redirects after a specified ID
GET /admin/api/2021-04/redirects.json?since_id=668809255
View Response
HTTP/1.1 200 OK
{
"redirects": [
{
"id": 950115854,
"path": "/ibook",
"target": "/products/macbook"
}
]
}
path
|
Count redirects with given path. |
target
|
Count redirects with given target. |
Count all redirects
GET /admin/api/2021-04/redirects/count.json
View Response
HTTP/1.1 200 OK
{
"count": 3
}
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a single redirect by its ID
GET /admin/api/2021-04/redirects/668809255.json
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/leopard",
"target": "/pages/macosx"
}
}
path
property, it will be saved as an absolute path without the domain.
For example, "path": "http://www.johns-apparel.com/springwear"
will be saved as "path": "springwear"
.
Create a redirect
POST /admin/api/2021-04/redirects.json
{
"redirect": {
"path": "/ipod",
"target": "/pages/itunes"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034144,
"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
POST /admin/api/2021-04/redirects.json
{
"redirect": {
"path": "http://www.apple.com/forums",
"target": "http://forums.apple.com"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034145,
"path": "/forums",
"target": "http://forums.apple.com/"
}
}
Creating a redirect without a path or target fails and returns an error
HTTP/1.1 422 Unprocessable Entity
{
"errors": {
"path": [
"can't be blank"
],
"target": [
"can't be blank",
"can't be the same as path"
]
}
}
Update the path URI of a redirect
PUT /admin/api/2021-04/redirects/668809255.json
{
"redirect": {
"id": 668809255,
"path": "/tiger"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/tiger",
"target": "/pages/macosx"
}
}
Update both the path and target URIs of a redirect
PUT /admin/api/2021-04/redirects/950115854.json
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
Delete an existing redirect
DELETE /admin/api/2021-04/redirects/668809255.json
View Response
HTTP/1.1 200 OK
{
}
What you can do with Redirect
The Shopify API lets you do the following with the Redirect resource. More detailed versions of these general actions may be available:
- GET /admin/api/unstable/redirects.json Retrieves a list of URL redirects
- GET /admin/api/unstable/redirects/count.json Retrieves a count of URL redirects
- GET /admin/api/unstable/redirects/{redirect_id}.json Retrieves a single redirect
- POST /admin/api/unstable/redirects.json Creates a redirect
- PUT /admin/api/unstable/redirects/{redirect_id}.json Updates an existing redirect
- DELETE /admin/api/unstable/redirects/{redirect_id}.json Deletes a redirect
Redirect properties
id
read-only |
The ID for the redirect. |
path |
The old path to be redirected. When the user visits this path, they will be redirected to the target. (maximum: 1024 characters) |
target |
The target location where the user will be redirected. When the user visits the old path specified by the |
Endpoints
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
limit
|
The maximum number of results to show. (default:50 , maximum: 250 )
|
since_id
|
Restrict results to after the specified ID. |
path
|
Show redirects with a given path. |
target
|
Show redirects with a given target. |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a list of all redirects
GET /admin/api/unstable/redirects.json
View Response
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"
}
]
}
Retrieve a list of URL redirects after a specified ID
GET /admin/api/unstable/redirects.json?since_id=668809255
View Response
HTTP/1.1 200 OK
{
"redirects": [
{
"id": 950115854,
"path": "/ibook",
"target": "/products/macbook"
}
]
}
path
|
Count redirects with given path. |
target
|
Count redirects with given target. |
Count all redirects
GET /admin/api/unstable/redirects/count.json
View Response
HTTP/1.1 200 OK
{
"count": 3
}
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a single redirect by its ID
GET /admin/api/unstable/redirects/668809255.json
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/leopard",
"target": "/pages/macosx"
}
}
path
property, it will be saved as an absolute path without the domain.
For example, "path": "http://www.johns-apparel.com/springwear"
will be saved as "path": "springwear"
.
Create a redirect
POST /admin/api/unstable/redirects.json
{
"redirect": {
"path": "/ipod",
"target": "/pages/itunes"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034144,
"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
POST /admin/api/unstable/redirects.json
{
"redirect": {
"path": "http://www.apple.com/forums",
"target": "http://forums.apple.com"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034145,
"path": "/forums",
"target": "http://forums.apple.com/"
}
}
Creating a redirect without a path or target fails and returns an error
HTTP/1.1 422 Unprocessable Entity
{
"errors": {
"path": [
"can't be blank"
],
"target": [
"can't be blank",
"can't be the same as path"
]
}
}
Update the path URI of a redirect
PUT /admin/api/unstable/redirects/668809255.json
{
"redirect": {
"id": 668809255,
"path": "/tiger"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/tiger",
"target": "/pages/macosx"
}
}
Update both the path and target URIs of a redirect
PUT /admin/api/unstable/redirects/950115854.json
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
Delete an existing redirect
DELETE /admin/api/unstable/redirects/668809255.json
View Response
HTTP/1.1 200 OK
{
}