# Sync API Seo Urls aktualisieren

**URL:** <https://forum.shopware.com/t/sync-api-seo-urls-aktualisieren/91103>\
**Category:** Shopware 6 (German)\
**Created:** [26. Oktober 2021 um 15:05 UTC](https://forum.shopware.com/t/sync-api-seo-urls-aktualisieren/91103 "2021-10-26T15:05:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aggrosoft](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/aggrosoft/32/23875_2.png) [@aggrosoft](https://forum.shopware.com/u/aggrosoft)\
**Post date:** [26. Oktober 2021 um 15:05 UTC](https://forum.shopware.com/t/sync-api-seo-urls-aktualisieren/91103/1 "2021-10-26T15:05:28Z")

</div>

Ich versuche aktuell per sync API Seo Urls zu aktualisieren:

```auto
{
    "sync-seo-urls": {
        "entity": "seo_url",
        "action": "upsert",
        "payload": [
            {
                "id": "12689155c0044312afe6309f58768e1c",
                "seoPathInfo": "AufkleberY\/",
                "isCanonical": true,
                "pathInfo": "\/navigation\/7ecef9e07d884285b9cbe5758a7d8c2d",
                "routeName": "frontend.navigation.page",
                "foreignKey": "7ecef9e07d884285b9cbe5758a7d8c2d",
                "salesChannelId": "33c3552352fa41589fc9e074bbc41f91"
            }
        ]
    }
}

```

Das führt aber trotz korrekter ID immer zum gleichen Fehler:

```auto
An exception occurred while executing 'UPDATE `seo_url` SET `foreign_key` = ?, `sales_channel_id` = ?, `route_name` = ?, `path_info` = ?, `seo_path_info` = ?, `is_canonical` = ?, `updated_at` = ? WHERE id = ?' with params ["\x7e\xce\xf9\xe0\x7d\x88\x42\x85\xb9\xcb\xe5\x75\x8a\x7d\x8c\x2d", "\x33\xc3\x55\x23\x52\xfa\x41\x58\x9f\xc9\xe0\x74\xbb\xc4\x1f\x91", "frontend.navigation.page", "\/navigation\/7ecef9e07d884285b9cbe5758a7d8c2d", "AufkleberY\/", 1, "2021-10-26 14:37:04.092", "\x12\x68\x91\x55\xc0\x04\x43\x12\xaf\xe6\x30\x9f\x58\x76\x8e\x1c"]:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '/\xBB_\xE2\xE2\x9AMp\xAAXT\xCE|\xE3\xE2\x0B-3\xC3U#R\xFAAX\x9F\x' for key 'uniq.seo_url.foreign_key'

```

Hat das bereits jemand hinbekommen? Muss ich wirklich immer erst die alte SEO Url invalidieren und eine neue erzeugen?

---

<div class="post-metadata">

**Author:** ![marksline](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@marksline](https://forum.shopware.com/u/marksline)\
**Post date:** [9. Oktober 2022 um 11:31 UTC](https://forum.shopware.com/t/sync-api-seo-urls-aktualisieren/91103/2 "2022-10-09T11:31:16Z")

</div>

> [@aggrosoft](#):
>
> `"isCanonical": true,`

Hallo aggrosoft,

isCanonical = true darf nicht beim ersten Eintrag gesetzt werden. So hatte ich das beim testen gefunden 🙂
