Using the DELETE API, you can Delete the Public or a Private bins.

Root
https://api.jsonbin.io/
Route
/b/<BIN_ID>
Request Type
DELETE
Request Headers
Header Value Required
secret-key <YOUR_SECRET_KEY> Yes
secret-key

secret-key is a compulsory header for Deleting a bin. One cannot Delete a bin if the bin was not created using a secret-key. You can find your secret-key on the API Keys page after signing-in.

Important

You cannot Delete a Public Bin which was created without a secret-key

Important

Deleting a bin will Delete it's associated versions too permanently.

Important

As of now, you cannot Delete a specific Bin Version.

Basic Code Samples
curl --header "secret-key: <SECRET_KEY>" \
       --request DELETE \
       https://api.jsonbin.io/b/<BIN_ID>
let req = new XMLHttpRequest();

req.onreadystatechange = () => {
  if (req.readyState == XMLHttpRequest.DONE) {
    console.log(req.responseText);
  }
};

req.open("DELETE", "https://api.jsonbin.io/b/<BIN_ID>", true);
req.setRequestHeader("secret-key", "<SECRET_KEY>");
req.send();
import requests
url = 'https://api.jsonbin.io/b/<BIN_ID>'
headers = {'secret-key': '<SECRET_KEY>'}

req = requests.delete(url, json=nil, headers=headers)
print(req.text)
require 'net/http'

uri = URI("https://api.jsonbin.io/b/<BIN_ID>")
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
  req = Net::HTTP::Delete.new(uri)
  req['secret-key'] = '<SECRET_KEY>'
  http.request(req)
end

puts res.body
Request Response
Success
200
{
  "success": true,
  "id": "<BIN_ID>",
  "message": "Bin <BIN_ID> is deleted successfully. 
             <BIN_VERSION_COUNT> versions removed."
}
Error
401 / 422
{
  "message": "<ERROR_MESSAGE>",
  "success": false
}
Status Code Error Message
401 Unauthorized
Need to provide a secret-key to DELETE bins

Fix: While deleting a Public or a Private record, you need to pass secret-key header to delete the record. Note that only the records which were created using secret-key can be deleted.

422 Unprocessible Entity
Invalid Bin ID

Fix: You need to pass a valid Bin ID in-order to Delete a bin.

401 Unauthorized
You cannot delete a public bin.

Fix: You'll get this error if you are trying to delete a public bin. Public bin can be deleted only if you have passed a secret-key header while creating the record with private: false header. So ensure that even if you want to Create a Public record, you need to pass secret-key header with private header set to false

404 Not Found
Bin not found

Fix: Check your Bin ID and pass a Valid Bin ID.

401 Unauthorized
Invalid secret key provided

Fix: Ensure you provide a valid secret-key while Deleting a Public or a Private record.