SEO History Endpoint: 301 Redirects
SEO History
Manage 301 redirects via API. SEO history entries are also automatically created when the seo_name changes during a product or category import.
GET /Export/JSON/seohistory
POST /Import/JSON/seohistory
PUT /Import/JSON/seohistory
DELETE /Delete/JSON/seohistory/{id}Endpoints
| Method | Endpoint | Scope | Description |
|---|---|---|---|
| GET | /Export/JSON/seohistory | seohistory:read | List all SEO redirects |
| GET | /Export/JSON/seohistory/{id} | seohistory:read | Single Redirect |
| POST | /Import/JSON/seohistory | seohistory:write | Create a new redirect |
| PUT | /Import/JSON/seohistory | seohistory:write | Update existing redirect |
| DELETE | /Delete/JSON/seohistory/{id} | seohistory:delete | Delete individually by ID |
| DELETE | /Delete/JSON/seohistory | seohistory:delete | Bulk/Filter Deletion |
Query Filter (GET)
| Parameter | Description | Example |
|---|---|---|
?type= | Entity type (p=Product, c=Category, m=Manufacturer, s=CMS, n=News, o=Other); since v2.122.12, leading or trailing whitespace does not count | ?type=p |
?base_id= | Source entity ID | ?base_id=70 |
?language= | Language (ISO code or ID) | ?language=de |
?seo_string= | NEW v2.122.11 Redirects of an old address, exact (see “Shop URL → ID”) | ?seo_string=alte-seite.html |
Shop URL → ID v2.122.11
Where does a shop URL belong, and where does an old address redirect to?
For a known address (Search Console, old sitemap, customer email), three exact filters return the category, the product or the target of a redirect: ?seo_string= on /categories and /seohistorys, ?seo_name= on /products. Up to v2.122.10, these names reported UNKNOWN_FILTER, and the list came unfiltered.
Step by step
- Omit the host, query part (
?…), and anchor (#…):https://shop.de/lng/en/fishing-rods/spinning-rods/becomeslng/en/fishing-rods/spinning-rods/. - If the path starts with
lng/xx/: omit that segment and send?language=xxinstead. Without the segment, it is the shop’s default language, for example?language=de. - If the rest starts with an address prefix such as
brand,cms,news, orbadge(in older shops alsomanufacturerandblog), it is a manufacturer, a CMS page, a news article, or a product badge. The filters do not exist for these addresses or for shop pages under their own name. - If the path ends in
.html, it is a product:/products?seo_name=with the last segment without.html(…/angelrute-xy.html→seo_name=angelrute-xy). - If the path ends in
/, it is a category:/categories?seo_string=with the full path. - No match: the SEO History. The target of a redirect is in
sh_item_typeandsh_item_id(pproduct,ccategory,sCMS page,mmanufacturer,nnews). For a category, query with the full path. For a product, query first with the full path (?seo_string=alte-kategorie/alter-artikel.html) and, if there is no match, with the last segment without.html(?seo_string=alter-artikel): the SEO History usually lists a renamed product only under its old slug.
# Category for https://shop.de/lng/en/fishing-rods/spinning-rods/
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
"https://shop.de/xpanel/xoport/Export/JSON/categories?seo_string=fishing-rods/spinning-rods&language=en"
# Product for https://shop.de/angelruten/angelrute-xy.html (product number only)
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
"https://shop.de/xpanel/xoport/Export/JSON/products?seo_name=angelrute-xy&fields=products_model"
# Where does https://shop.de/alte-kategorie/alter-artikel.html redirect to? First the full path …
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
"https://shop.de/xpanel/xoport/Export/JSON/seohistorys?seo_string=alte-kategorie/alter-artikel.html&language=de"
# … if there is no match, the old slug
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
"https://shop.de/xpanel/xoport/Export/JSON/seohistorys?seo_string=alter-artikel&language=de"Searching the SEO History
- The address is searched as it appears in the address bar, i.e. with special characters percent-encoded. As a query value, it is encoded once more (
curl -G --data-urlencode,rawurlencode()):k%C3%BCche-altbecomesk%25C3%25BCche-altin the query part. In shop 4.9, the filter does not find other spellings of the same address (decodedküche-altor transliteratedkueche-alt). - Exact, without prefix or pattern:
%and_are plain characters. Upper and lower case, leading and trailing slashes and.htmldo not matter. - Multiple entries for an address are all returned, newest
sh_idfirst. The shop itself takes the newest entry bysh_timestampwith the target type of the page (pfor an address ending in.html,cfor one ending in/); if there is none, the newest entry of any type. To replicate its choice, sort this way. The filter also returns expired entries (sh_deletestamppassed); the shop no longer redirects them. - The filter works together with
?type=,?base_id=, and/seohistory/{id}. Error cases: Export API.
Data Structure
Fields
| Field | Type | Description |
|---|---|---|
sh_id | INT | Primary Key |
sh_base_id | INT | ID of the source entity |
sh_base_type | ENUM | c=Category, s=CMS, m=Manufacturer, p=Product, n=News, o=Other |
sh_item_id | INT | ID of the target entity |
sh_item_type | ENUM | Type of the target entity (same values) |
sh_deletestamp | DATETIME | Automatic deletion (default: +1 year) |
Language fields
| Field | Type | Description |
|---|---|---|
sh_seo_string | VARCHAR(255) | Old SEO path (without domain, without leading slash) |
Request Examples
POST — New Redirect
{
"type": "seohistory",
"data": [{
"sh_base_id": 70,
"sh_base_type": "c",
"sh_item_id": 102,
"sh_item_type": "c",
"sh_deletestamp": "2027-02-24 00:00:00",
"languages": {
"de": {"sh_seo_string": "alte-kategorie/alte-unterkat"},
"en": {"sh_seo_string": "old-category/old-subcat"}
}
}]
}DELETE — Bulk & Filter
# Bulk via JSON body: the sh_id from the GET
DELETE /Delete/JSON/seohistory
{"type": "seohistory", "data": [{"sh_id": 42}, {"sh_id": 43}, {"sh_id": 44}]}
# Clean up expired entries
DELETE /Delete/JSON/seohistory?expired=1
# Filter by type and source ID
DELETE /Delete/JSON/seohistory?type=p&base_id=123DELETE /seohistory(s)?seo_string= results in HTTP 400, nothing is deleted; only the GET searches by address. Up to v2.122.10, the name was ignored and deletion was based on ?type=/?base_id= alone, so ?type=p deleted every product entry. You delete a specific entry via its sh_id: DELETE /Delete/JSON/seohistory/{sh_id} or via JSON body as above.type, base_id, and expired no longer counts. Up to v2.122.11, GET /seohistorys?type=%20p returned entries of all types, DELETE /seohistorys?type=%20p&base_id=42 deleted the entries of every type for ID 42, and ?type=p&base_id=42%00 deleted every entry of type p. Now the validated value applies. ⚠️ As a result, requests that were previously rejected with MISSING_FILTER also delete, e.g. DELETE /seohistorys?type=%20p without a further filter: that is now all entries of type p. All cases: Delete API.Auto-Redirect
Automatic SEO History Entries During Import
seo_name (or the name itself, with corresponding auto-regeneration) changes during a JSON import (PUT), an SEO history entry is automatically created for the old path—similar to an XML import. Expiration: 1 year. Duplicates are detected and prevented (idempotent).- Products (
p) — language-specific - Categories (
c) — language-specific - Manufacturers (
m) — language-independent (one entry, one description row per language) - News (
n) — language-specific - CMS (
s) — language-specific
Manage SEO History
Create an OAuth2 client with the scopes seohistory:read, seohistory:write, and seohistory:delete.