Redirects
The 6 tools of the Redirects toolset in the Storefront area, with their permissions, approval rules and inputs.
On this page
Toolset redirects, 6 tools.
Records
redirect
A redirect from an old address of the storefront to a new one, with its status (301 or 302), whether it was made by hand or by an import, and how often it was hit.
- Permission:
settings.read - Tools:
redirect_list,redirect_get
Filters on the list:
| Filter | Type | Required | Description |
|---|---|---|---|
q | string | Part of the old or new address | |
source | string | one of "manual", "import" | |
since | string | Only redirects changed since. format date-time |
Actions
redirect_create
Send visitors of an old address to a new one.
A redirect to another website sends shoppers off the store, so use one only when the merchant named that address. Loops, chains that are too long, the home page as the old address and a second redirect from the same address are refused.
- Action key:
redirect.create - Permission:
settings.write - Approval: Always waits for a person to approve it.
- Effect: Changes the live store.
- Retries: runs at most once; a repeat with the same idempotency key returns the first result.
| Field | Type | Required | Description |
|---|---|---|---|
from | string | yes | The old address as a path of this shop, e.g. /old-page. at most 2000 characters |
to | string | yes | The new address: a path of this shop or a full http(s) web address. at most 2000 characters |
status | string | 301 permanent (default), 302 temporary |
Example input:
{
"from": "/old-shoes",
"to": "/products/shoes"
}redirect_delete
Delete a redirect; its old address stops leading anywhere.
- Action key:
redirect.delete - Permission:
settings.write - Approval: Always waits for a person to approve it.
- Effect: Changes the live store.
- Destructive: in compact mode it runs with
run_destructive_action. - Retries: safe to repeat with the same input.
| Field | Type | Required | Description |
|---|---|---|---|
redirect_id | string | yes | Redirect ID from redirect_list |
Example input:
{
"redirect_id": "019bb648-e4eb-7d36-bb38-cf96bc5910d0"
}redirect_import
Create many redirects at once, for example after moving from another shop.
Up to 1000 rows per call. mode replace overwrites an existing redirect from the same address, keep_manual leaves redirects made by hand untouched. Rows that fail validation are listed in the answer and the rest are written.
- Action key:
redirect.import - Permission:
settings.write - Approval: Always waits for a person to approve it.
- Effect: Changes the live store.
- Retries: safe to repeat with the same input.
| Field | Type | Required | Description |
|---|---|---|---|
rows | list of object | yes | 1 to 1000 items |
rows[].from | string | yes | The old address as a path of this shop, e.g. /old-page. at most 2000 characters |
rows[].to | string | yes | The new address: a path of this shop or a full http(s) web address. at most 2000 characters |
rows[].status | string | 301 permanent (default), 302 temporary | |
mode | string | one of "replace", "keep_manual" |
Example input:
{
"rows": [
{
"from": "/a",
"to": "/b"
},
{
"from": "/c",
"to": "/d",
"status": 302
}
],
"mode": "keep_manual"
}redirect_update
Change where a redirect leads, its old address or its status.
The redirect is replaced, so pass from and to again even when only one changes.
- Action key:
redirect.update - Permission:
settings.write - Approval: Always waits for a person to approve it.
- Effect: Changes the live store.
- Retries: safe to repeat with the same input.
| Field | Type | Required | Description |
|---|---|---|---|
redirect_id | string | yes | Redirect ID from redirect_list |
from | string | yes | The old address as a path of this shop, e.g. /old-page. at most 2000 characters |
to | string | yes | The new address: a path of this shop or a full http(s) web address. at most 2000 characters |
status | string | 301 permanent (default), 302 temporary |
Example input:
{
"redirect_id": "019bb648-e4eb-7d36-bb38-cf96bc5910d0",
"from": "/old-shoes",
"to": "/products/trainers"
}