Duplicate key error for deleted CMS item

Hello,

I’m trying to import CMS items via the API. I noticed an error with the initial import, so I deleted all the items in the collection, but when I go to re-import the items, I get an error saying “slug already exists”, even though the item has been deleted.

Is there a way to clear out the slugs for the deleted items?

Error:

Status code: 400
Body: {
  "message": "Validation Error",
  "code": "validation_error",
  "externalReference": null,
  "details": [
    {
      "param": "slug",
      "description": "Unique value is already in database: 'my-slug'"
    }
  ]
}

My collection ID: 67a2689b29d7e1d28b663c19


Here is my public share link: LINK
(how to access public share link)

Hey cko,

I’ve seen 1 or 2 other recent posts regarding this, you should fine a ticket with support to find out what’s up.

It looks like something has changed or broken very recently.

One thing to check- if you’re using localization, see if your localized items are deleted as well. It’s plausible that somehow the slug is “still in use” but on a different locale.

Hi @ckochis,

We see this happen a lot with our customers using the API. Sometimes it is worth waiting a few minutes after the deletion before importing again, or even hours if you can (the longer the better), until Webflow’s backend has purged the deleted CMS items. This is not guaranteed, but it can work.

Hope this helps.
Sylvie

Heard back from support, it was just matter of publishing the site after the deletes have been made. Which I suppose makes sense, those links are still live until the delete change is published.

I actually find that confusing in light of the new CMS item publishing, I would think a delete is an independent CMS operation unrelated to the site. :thinking:

But very good to know, thanks for sharing!

@memetican totally agree with you on this - not entirely logical! Also it does mean that unpublished changes to static pages would be published through that step, which might not be suitable for everyone.