Item slug changes on update (PUT)

Hey there, I have an issue with the CMS API when updating an item of a collection.

Somehow the API will change the “slug”-field when updating some fields of an existing item but keeping the same slug.

So if:

GET https://api.webflow.com/collections/COLLECTION-ID/items

Returns an item with slug “abc” and an ITEM-ID.

[details=Example]
{
“items”: [
{
“_archived”: false,
“_draft”: false,
“name”: “test”,
“field-i-want-to-update”: “before”,
… some other fields … ,
"slug": “abc”,
… Created, Modified and Published …,
“_cid”: “CID”,
“_id”: “ITEM-ID”
}
}[/details]

If I now want to update this item (or a field of this item) I have to make a

PUT https://api.webflow.com/collections/COLLECTION-ID/items/ITEM-ID

Where the “slug”-field is required. If i want to update some fields but keep the same slug “abc”:

[details=Example of Request Body]
{
“fields”: {
“_archived”: false,
“_draft”: false,
“name”: “test”,
“field-i-want-to-update”: “after”,
… some other fields … ,
"slug": “abc”,
… Created, Modified and Published …,
“_cid”: “CID”,
“_id”: “ITEM-ID”
}
}[/details]

The Response show me an altered slug, with some random suffix added to it. Like “-2” or “-c”.

[details=PUT Response]
{
“_archived”: false,
“_draft”: false,
“name”: “test”,
“field-i-want-to-update”: “after”,
… some other fields … ,
"slug": “abc-6”,
… Created, Modified and Published …,
“_cid”: “CID”,
“_id”: “ITEM-ID”
}[/details]

I could not figure out a way to keep the same slug other than making a DELETE Request to delete the complete Item and re-uploading it via POST. (That is not really an option as I loose the history and would double runtime - especially because of the 60/Min API limit).

I should mention that I rely on the slug, that is being generated from some of the fields, because I want to use it somewhere else where I can not make a HTTP Request to ask for the actual slug given by the CMS API.

I’d appreciate any help or explanation on why this has to be/stay this way and what alternatives I have.

1 Like

Hi @RFechtner, thanks for the report. This has been reported and is being looked at, as soon as there is an update, will let you know more info.

Thanks in advance!

Hi @cyberdave , thanks for the feedback!

I’m sorry, I couldn’t find a topic covering this issue…

Thank you for investigating!

Hi @RFechtner! You did great thanks! Will get back to you at the soonest!

Thanks for catching this, working on putting together a fix for it ASAP!

A fix has been deployed, let me know if you still are seeing this behavior!

Hi @nathan, just checked with Postman. Working like a charm!

Thank you all for the really fast patch, really appreciate it!