Using the SCHEMA DOCS UPDATE API, you can UPDATE the Schema docs which can be used to validate records if attached to a Collection.

Important

Updating the Schema Doc will not re-validate the bins if it is attached to one or more collections.

Update Name

Please refer to Schema Doc - Update Name documentation if you wish to rename your Schema Doc.

Root
https://api.jsonbin.io/v3
Route
/s/<SCHEMA_DOC_ID>
Request Type
PUT
Request Headers
Header Value Required
Content-Type application/json Yes
X-Master-Key <YOUR_SECRET_KEY> Yes
Content-Type

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

X-Master-Key

X-Master-Key is required to Update a Schema Doc. You can find your X-Master-Key on the API Keys page after signing-in.

Basic Code Samples
curl -v\
  -H "Content-Type: application/json" \
  -H "X-Schema-Doc-Name: User Validation" \
  -H "X-Master-Key: <YOUR_API_KEY>" \
  --data '<SCHEMA_VALIDATION_JSON>' \
  --request PUT \
  https://api.jsonbin.io/v3/s/<SCHEMA_DOC_ID>
let req = new XMLHttpRequest();

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

req.open("PUT", "https://api.jsonbin.io/v3/s/<SCHEMA_DOC_ID>", true);
req.setRequestHeader("Content-Type", "application/json");
req.setRequestHeader("X-Schema-Doc-Name", "User Validation");
req.setRequestHeader("X-Master-Key", "<YOUR_API_KEY>");
req.send(<SCHEMA_VALIDATION_JSON>);
import requests
url = 'https://api.jsonbin.io/v3/s/<SCHEMA_DOC_ID>'
headers = {
  'Content-Type': 'application/json',
  'X-Schema-Doc-Name': 'User Validation',
  'X-Master-Key': '<YOUR_API_KEY>'
}
data = {<SCHEMA_VALIDATION_JSON>}

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

uri = URI("https://api.jsonbin.io/v3/s/<SCHEMA_DOC_ID>")
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
  req = Net::HTTP::Put.new(uri)
  req['Content-Type'] = 'application/json'
  req['X-Master-Key'] = '<YOUR_API_KEY>'
  req.body = {<SCHEMA_VALIDATION_JSON>}.to_json

  http.request(req)
end

puts res.body
Request Response
Success
200
{
  "record":{
    <SCHEMA_VALIDATION_JSON>
  },
  "metadata": {
    "id":"<SCHEMA_DOC_ID>",
    "name": "User Validation",
    "createdAt": <DATE/TIME>
  }
}
Error
400, 401, 403
{
  "message": "<ERROR_MESSAGE>"
}
Status Code Error Message
400 Bad Request
You need to pass Content-Type set to application/json
401 Unauthorized
You need to pass X-Master-Key in the header
400 Bad Request
Invalid Schema Id provided
400 Bad Request
Schema Doc cannot be empty
401 Unauthorized Access
Invalid X-Master-Key provided
403 Forbidden
Requests exhausted. Buy additional requests at https://jsonbin.io/pricing
404 Not Found
Schema Doc not found