curl --request DELETE \
--url https://api.buttercms.com/v2/content/{collection_key}/{item_id}/ \
--header 'Authorization: <api-key>'import requests
url = "https://api.buttercms.com/v2/content/{collection_key}/{item_id}/"
headers = {"Authorization": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: '<api-key>'}};
fetch('https://api.buttercms.com/v2/content/{collection_key}/{item_id}/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.buttercms.com/v2/content/{collection_key}/{item_id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.buttercms.com/v2/content/{collection_key}/{item_id}/"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.buttercms.com/v2/content/{collection_key}/{item_id}/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buttercms.com/v2/content/{collection_key}/{item_id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_bodyDelete Collection Item
Soft-delete an existing Collection item via the Write API. The item is marked as deleted but data is preserved.
curl --request DELETE \
--url https://api.buttercms.com/v2/content/{collection_key}/{item_id}/ \
--header 'Authorization: <api-key>'import requests
url = "https://api.buttercms.com/v2/content/{collection_key}/{item_id}/"
headers = {"Authorization": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: '<api-key>'}};
fetch('https://api.buttercms.com/v2/content/{collection_key}/{item_id}/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.buttercms.com/v2/content/{collection_key}/{item_id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.buttercms.com/v2/content/{collection_key}/{item_id}/"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.buttercms.com/v2/content/{collection_key}/{item_id}/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buttercms.com/v2/content/{collection_key}/{item_id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_bodymeta field of any collection item when retrieved through GET requests. This identifier is required to specify which item to delete.
Request Body: DELETE requests should not include any request body data - send an empty body or omit the body entirely. The item ID in the URL path is sufficient to identify the target item.
Asynchronous Processing: This endpoint returns 204 No Content immediately upon successful request validation. The actual deletion processing, including webhook notifications and reference cleanup, happens in the background processing queue.Authorizations
Write-enabled API token required for creating content.
The API token you use for reading from the ButterCMS API will not allow you to create content in the API. For this you will need to use a different write-enabled token. Write API access is a paid add-on for Advanced and Professional plans, enabled from the Billing page of your account. It isn't offered on Basic plans.
Set the Authorization header to Token your_write_api_token. The ?auth_token= query parameter also works for write requests, but a header is safer because URLs are more likely to be logged.
Example: Authorization: Token abc123def456
Your write-enabled token should never be used anywhere it would be exposed, e.g. in client-side JavaScript.
Path Parameters
The unique identifier/slug of the Collection containing the item to delete.
Must match an existing collection in your organization.
50The unique identifier of the collection item to delete.
This ID can be found in the meta field of collection items returned by GET operations.
50Response
Operation completed successfully - No content returned
Was this page helpful?