Delete Bin Versions API
Using the Delete Bin Versions API, you can delete all the versions of the Bin. Optionally, you can also delete all the versions and copy the latest version to the base bin using this API.
Root
https://api.jsonbin.io/v3
Route
/b/<BIN_ID>/versions
Request Type
DELETE
Request Headers
Below are the list of Accepted Request Headers if you are trying to Delete a JSON records versions.
Request Header | Value | Required |
---|---|---|
X-Master-Key | <API_KEY> | Yes |
X-Preserve-Latest | <true/false> | No |
X-Master-Key Required
X-Master-Key is nothing but your Core API Access Key. You will need this Key to access mostly any API end-point on JSONBin. You could find the key on the API Keys page.
X-Preserve-Latest
Using X-Preserve-Latest header will copy the Latest record to the Base record before deleting all the versions of a bin, thus, retaining the last updated version.
Code Samples
curl -v\
-H "X-Master-key: <YOUR_API_KEY>" \
--request DELETE
https://api.jsonbin.io/v3/b/<BIN_ID>/versions
Request Response
Success Status Code: 200
{
"metadata": {
"id": "",
"versionsDeleted": 0
},
"message": "Versions for the Bin are deleted successfully"
}
Error Status Code: 400, 401, 403
{
"message": "<Error Message>"
}
For more information on the error codes & errors you might possibly encounter, refer to the below section.
Error Reference
Invalid Bin Id provided
You'll encounter this error if the Bin Id you are trying to access is invalid. Hence, ensure that the Bin Id you are passing is valid.