Using the CREATE API, you can Create Public and Private bins.

Request Type
Request Headers
Header Value Required
Content-Type application/json Yes
secret-key <YOUR_SECRET_KEY> Yes
collection-id <YOUR_COLLECTION_ID> Optional
private false Optional
name YOUR_BIN_NAME Optional

Content-Type needs to be set to application/json. The request will result in an error in-case of a missing Content-Type header.


secret-key is a compulsory header. It is required when you need to Create a Public or a Private record. You can find your secret-key on the API Keys page after signing-in.

In-order to Create a Public record via API and listing it on your Dashboard, you need to pass secret-key along with private: false This will list the Public bin you created on your user Dashboard.


In-order to add a bin to a specific collection instead of the unsorted category which is the default, you need to pass the collection-id in the header. You can Create a Collection on the Collections page after signing-in. For more info on Creating Collections, please refer to our Create Collections API for more info.


Records are created in a private mode by default. In-order to Create a Public Record, you need to pass private: false header.


In-order to set a name for the Bin, you can pass this header with a name for the bin. There are no restrictions to set the name except for the length which is limited to 128 characters.


You cannot update Bin Names as of now.

Basic Code Samples
curl -v\
  -H "Content-Type: application/json" \
  -H "secret-key: <SECRET_KEY>" \
  --request POST \
  --data '{"sample": "Hello World"}' \
let req = new XMLHttpRequest();

req.onreadystatechange = () => {
  if (req.readyState == XMLHttpRequest.DONE) {
};"POST", "", true);
req.setRequestHeader("Content-Type", "application/json");
req.setRequestHeader("secret-key", "<SECRET_KEY>");
req.send('{"Sample": "Hello World"}');
import requests
url = ''
headers = {
  'Content-Type': 'application/json',
  'secret-key': '<SECRET_KEY>'
data = {"Sample": "Hello World"}

req =, json=data, headers=headers)
require 'net/http'
require 'json'

uri = URI("")
res = Net::HTTP.start(, uri.port, use_ssl: true) do |http|
  req =
  req['Content-Type'] = 'application/json'
  req['secret-key'] = '<SECRET_KEY>'

  req.body = {"Sample": "Hello World"}.to_json

puts res.body
Request Response
    "Sample":"Hello World"
401, 422
  "message": "<ERROR_MESSAGE>",
  "success": false
Status Code Error Message
401 Unauthorized
You need to pass a secret-key in the header to Create a Bin

Fix: It is compulsory to pass secret-key in the header to Create a Bin.

422 Unprocessible Entity
Expected content type - application/json

Fix: You need to pass Content-Type: application/json in the headers.

422 Unprocessible Entity
JSON cannot be empty

Fix: You cannot store an empty JSON record, hence, you need to pass some data to store it.

422 Unprocessible Entity
Invalid Collection ID

Fix: If you are trying to pass collection-id in the header, make sure the ID you are passing is correct.

401 Unauthorized
Invalid secret key provided.

Fix: If you are trying to Create a Private record, ensure that the secret-key you are passing in the header is correct.

422 Unprocessible Entity
Bin Name cannot be longer than 128 characters.

Fix: Do not use more than 128 characters for your bin name.

422 Unprocessible Entity
Bin Name cannot be empty.

Fix: Do not pass the name header empty.