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
| Parameter | Type | Required | Description |
|---|---|---|---|
collection_id | string | Yes | Unique identifier for the collection |
item_id | string | Yes | Unique identifier for the collection item |
Headers
| Header | Value |
|---|---|
| Authorization | Bearer YOUR_API_TOKEN |
| Content-Type | application/json |
Request body (optional)
| Field | Type | Description |
|---|---|---|
_draft | boolean | Optional. 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