Update Schema Docs API
You could use the Update Schema Docs API to update the Schema Docs you've created.
Important: Updating the Schema Doc will not re-validate the bins if it is attached to one or more collections.
Note: Refer to Schema Docs Update Name API Documentation if you wish to rename your Schema Doc as you could only update the Schema Doc using the Update Schema Doc API.
Root
https://api.jsonbin.io/v3
Route
/s/<SCHEMA_DOC_ID>
Request Type
PUT
Request Headers
Below are the list of Accepted Request Headers if you are trying to Read a Schema Doc.
Request Header | Value | Required |
---|---|---|
Content-Type | application/json | Yes |
X-Master-Key | <X-Master-Key> | Yes |
Content-Type Required
Set the Content-Type header to application/json. This needs to be passed with every PUT request you make on the Update Schema Doc Route. Failing to pass this in the Header will result in an error.
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 -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>
Request Response
Success Status Code: 200
{
"record":{
<SCHEMA_VALIDATION_JSON>
},
"metadata": {
"id": "<SCHEMA_DOC_ID>",
"name": "User Validation",
"createdAt": <DATE / TIME>
}
}
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
You need to pass Content-Type set to application/json
You'll encounter this error if you are not passing the Content-Type header. Hence, pass the Content-Type header with a value of application/json.