SEO History Endpoint: 301 Redirects

v2.6.0 · CRUD · SEO 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

MethodEndpointScopeDescription
GET/Export/JSON/seohistoryseohistory:readList all SEO redirects
GET/Export/JSON/seohistory/{id}seohistory:readSingle Redirect
POST/Import/JSON/seohistoryseohistory:writeCreate a new redirect
PUT/Import/JSON/seohistoryseohistory:writeUpdate existing redirect
DELETE/Delete/JSON/seohistory/{id}seohistory:deleteDelete individually by ID
DELETE/Delete/JSON/seohistoryseohistory:deleteBulk/Filter Deletion

Query Filter (GET)

ParameterDescriptionExample
?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

  1. Omit the host, query part (?…), and anchor (#…): https://shop.de/lng/en/fishing-rods/spinning-rods/ becomes lng/en/fishing-rods/spinning-rods/.
  2. If the path starts with lng/xx/: omit that segment and send ?language=xx instead. Without the segment, it is the shop’s default language, for example ?language=de.
  3. If the rest starts with an address prefix such as brand, cms, news, or badge (in older shops also manufacturer and blog), 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.
  4. 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).
  5. If the path ends in /, it is a category: /categories?seo_string= with the full path.
  6. No match: the SEO History. The target of a redirect is in sh_item_type and sh_item_id (p product, c category, s CMS page, m manufacturer, n news). 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-alt becomes k%25C3%25BCche-alt in the query part. In shop 4.9, the filter does not find other spellings of the same address (decoded küche-alt or transliterated kueche-alt).
  • Exact, without prefix or pattern: % and _ are plain characters. Upper and lower case, leading and trailing slashes and .html do not matter.
  • Multiple entries for an address are all returned, newest sh_id first. The shop itself takes the newest entry by sh_timestamp with the target type of the page (p for an address ending in .html, c for 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_deletestamp passed); the shop no longer redirects them.
  • The filter works together with ?type=, ?base_id=, and /seohistory/{id}. Error cases: Export API.

Data Structure

Fields

FieldTypeDescription
sh_idINTPrimary Key
sh_base_idINTID of the source entity
sh_base_typeENUMc=Category, s=CMS, m=Manufacturer, p=Product, n=News, o=Other
sh_item_idINTID of the target entity
sh_item_typeENUMType of the target entity (same values)
sh_deletestampDATETIMEAutomatic deletion (default: +1 year)

Language fields

FieldTypeDescription
sh_seo_stringVARCHAR(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=123
Changed in v2.122.11: DELETE /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.
Changed in v2.122.12: Leading or trailing whitespace in 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

Automatic: If the 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).
Supported since v2.13.0: All five entity types with SEO URLs:
  • 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.

Create an OAuth2 client