Delete Access Keys API

As of now, you cannot edit the Access Keys and hence, if you wish to grant further access to a specific key, use Delete Access Keys API to Delete the older keys.

Root

https://api.jsonbin.io/v3 

Route

/a/<ACCESS_KEY_ID>  

Request Type

DELETE

Request Headers

Below are the list of Accepted Request Headers if you are trying to Create a JSON record.

Request Header Value Required
X-Master-Key <API_KEY> Yes
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.

Code Samples

  • cURL
  • JavaScript (ES6)
  • Python 3
  • Ruby
curl -v\
  -H "X-Master-Key: <YOUR_API_KEY>" 
  --request DELETE \
    https://api.jsonbin.io/v3/a/<ACCESS_KEY_ID>
let req = new XMLHttpRequest();

req.onreadystatechange = () => {
  if (req.readyState == XMLHttpRequest.DONE) {
    console.log(req.responseText);
  }
};
  
req.open("DELETE", "https://api.jsonbin.io/v3/a/<ACCESS_KEY_ID>", true);
req.setRequestHeader("X-Master-Key", "<YOUR_API_KEY>");
req.send();
import requests
url = 'https://api.jsonbin.io/v3/a/<ACCESS_KEY_ID>'
headers = {
  'X-Master-Key': '<YOUR_API_KEY>'
}

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

uri = URI("https://api.jsonbin.io/v3/a/<ACCESS_KEY_ID>")
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
  req = Net::HTTP::Delete.new(uri)
  req['X-Master-Key'] = '<YOUR_API_KEY>'

  http.request(req)
end

puts res.body

Request Response

Success Status Code: 200
{
  "metadata": {
    "id": "<ACCESS_KEY_ID>",
    "name": "<ACCESS_KEY_NAME>"
  },
  "message": "Access Key deleted successfully"
}
Error Status Code: 400, 401, 403, 404
{
  "message": "<Error Message>"
}

For more information on the error codes & errors you might possibly encounter, refer to the below section.

Error Reference

  • 400 Bad Request
  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not Found
You need to pass X-Master-Key in the header to delete the access key.

In-order to delete an Access Key, you need to pass the X-Master-Key header. You can find X-Master-Key on API Keys page

Invalid Access Key Id provided

Make sure you've passed the correct Access Key Id and then try again.

Invalid X-Master-Key provided

X-Master-Key which is passed is invalid. Verify it once on API Keys page

Requests exhausted. Buy additional requests at https://jsonbin.io/pricing

You'll encounter this error if you've consumed all the available requests. You can purchase additional requests.

Access Key not found or it doesn't belong to your account

The Access Key you are trying to delete doesn't exists or it does not belong to your account. Verify the Access Key and pass a valid Access Key Id.

Create a Free Account

Create an Account View Pricing