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'"
}
]
}
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.
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.
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.
@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.