Delete CMS Item via API call sends item to draft

*Currently, the “delete” does nothing more than set it as a draft, which causes problems for me as I can’t delete other items that are referenced to the deleted item.
Can anybody help regarding this issue ?

Here is my site Read-Only: LINK
(how to share your site Read-Only link)

Are there any other CMS items which are referencing the item you deleted?
If so you’ll likely need to remove those references first, before the API can fully delete that item.

Could be several things, but most likely you have the ?live=true appended to your API call.

Append ?live=true to the querystring to unpublish an item

Sounds like you are just unpublishing it versus deleting it.

Just created an account here to say I found the same thing happened when I deleted CMS items via the API.

This is pretty unintuitive and needs to at least be spelled out more clearly in the API docs.

To fully delete something, I found I needed to first call the delete endpoint for the item with ?live=true, so send it to a draft state AND have it unpublished, then I needed to call the delete endpoint again, but this time leaving off the live query param, to then fully delete the item from my collection.

Ideally, this should all be able to happen in one API call.

Hi @jketcham :wave: welcome to the forum.

Something sounds wrong with that statement.

  • To unpublish, use only ?live=true calling the API only once.
  • To hard delete just call the API without appending that param (or set it to false) calling the API only once.

“Remove Item. The default behavior of the endpoint will delete the item from collection. You cannot retrieve a deleted item.”

“Append ?live=true to the querystring to unpublish an item”

I just tried it and it worked as described for me:

Worked as expected, only called the API once and the item was hard deleted. The count went down from 5 to 4.

Next, I selected a new item and added the query param.

4 items still remaining, the correct item id is set to draft (unpublished). No hard deletes and only one API call.

What is confusing the response from the API on a soft delete, but oh-well.

If you reproduce these steps and get totally different results, you should contact support, you’re account is messed up.

Is it possible that you have any ref fields in other CMS items that are referencing the item you’re deleting?

If I recall correctly, under those circumstances Webflow cannot delete the item ( has to update multiple records, could violate a required field constraint, etc. ), so it drafts it instead.

If there are (multi) references on a record that have associations it produces a:

"msg": "This item is still being used by",
"code": 409,
"name": "Conflict",

On both delete’s and unpublishing (?live=true), at least for me that’s how it works.

Milage may vary on another’s account.

What you missed is that although the CMS item has been deleted, that change has not been published to the live site (i.e. you still need to do a full site publish). In order to fully delete AND unpublish an item without having to go into the editor and publish the whole site, you need to do two requests: one with live=true followed by one without.

IMO, appending the live=true parameter should behave the same way as in other requests and just publish the change to the live site. Changing a CMS item to Draft should be a separate function. You are not deleting anything, so it should not be an HTTP DELETE method.

I agree with the experiences shared by Jack. The delete endpoints do behave very weirdly.

Thanks guys for the detailed conversation btw.

I just double call now within my Xano delete/update cycle:

Seems to work <3

Thought this might be a helpful resource for some of you → Easy synchronization of your Webflow CMS with Xano DB Data - Xano | No Code Development Platform