Using the COLLECTIONS UPDATE API, you can UPDATE Collections name for now. We might add more meta data to the Collections which you can use the Update API for.
Root
https://api.jsonbin.io/v3
Route
/c/<COLLECTION_ID>/meta/name
Request Type
PUT
Request Headers
Header | Value | Required |
X-Master-Key | <YOUR_SECRET_KEY> | Yes |
X-Collection-Name | My Collection | Yes |
X-Master-Key
X-Master-Key is required to Update a Collection. You can find your X-Master-Key on the API Keys page after signing-in.
X-Collection-Name
X-Collection-Name is required to Name your Collection. You can set a name no more than 32 characters.
Basic Code Samples
curl -v\
-H "X-Collection-Name: My Collection" \
-H "X-Master-key: <YOUR_API_KEY>" \
--request PUT \
https://api.jsonbin.io/v3/c
let req = new XMLHttpRequest();
req.onreadystatechange = () => {
if (req.readyState == XMLHttpRequest.DONE) {
console.log(req.responseText);
}
};
req.open("PUT", "https://api.jsonbin.io/v3/c", true);
req.setRequestHeader("X-Collection-Name", "My Collection");
req.setRequestHeader("X-Master-Key", "<YOUR_API_KEY>");
req.send();
import requests
url = 'https://api.jsonbin.io/v3/c'
headers = {
'X-Collection-Name': 'My Collection',
'X-Master-Key': '<YOUR_API_KEY>'
}
data = {}
req = requests.post(url, json=data, headers=headers)
print(req.text)
require 'net/http'
require 'json'
uri = URI("https://api.jsonbin.io/v3/c")
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
req = Net::HTTP::Put.new(uri)
req['X-Collection-Name'] = 'My Collection'
req['X-Master-Key'] = '<YOUR_API_KEY>'
http.request(req)
end
puts res.body
Request Response
Success 200
{
"record": "<COLLECTION_ID>",
"metadata": {
"name": "My Collection"
}
}
Error 400, 401, 403
{
"message": "<ERROR_MESSAGE>"
}
Status Code | Error Message |
---|---|
401 Unauthorized |
You need to pass X-Master-Key in the header |
400 Bad Request |
Invalid Collection Id provided |
400 Bad Request |
You need to pass X-Collection-Name header to set a name for the Schema Doc |
400 Bad Request |
X-Collection-Name cannot be blank |
400 Bad Request |
Name of the Collection cannot be above 32 characters |
403 Forbidden |
You cannot create more than 10 collections. Please delete a Collection and try again. |
404 Not Found |
Collection not found |
401 Unauthorized |
Invalid secret key provided |
403 Forbidden |
Requests exhausted. Buy additional requests at https://jsonbin.io/pricing |