Skip to Content
DocsItemsRemove Item

Remove Collection Item

Remove an item from a collection.

Request

DELETE https://app.ycode.com/api/v1/collections/{collection_id}/items/{item_id}

Path parameters

ParameterTypeRequiredDescription
collection_idstringYesUnique identifier for the collection
item_idstringYesUnique identifier for the collection item

Headers

HeaderValue
AuthorizationBearer YOUR_API_TOKEN
Content-Typeapplication/json

Request body (optional)

FieldTypeDescription
_draftbooleanOptional. When true, only the draft item is deleted. If omitted and your project is published, the published record is deleted by default. Whenever a published record is deleted, the draft record is also removed.

Response

Returns a confirmation object indicating the number of deleted items.

Example response

{ "deleted": 1 }

Example request

curl -X DELETE https://app.ycode.com/api/v1/collections/637781341a6f7/items/16687772264556377850a6f241 \ -H "Authorization: Bearer YOUR_API_TOKEN"

To delete only the draft record:

curl -X DELETE https://app.ycode.com/api/v1/collections/637781341a6f7/items/16687772264556377850a6f241 \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"_draft": true}'
Last updated on