Update Collection Name API
Using the Update Collection Name API, you could update the name of your Collection which you've set previously.
Root
https://api.jsonbin.io/v3
Route
/c/<COLLECTION_ID>/meta/name
Request Type
PUT
Request Headers
Below are the list of Accepted Request Headers if you are trying to Update the Collection Name.
Request Header | Value | Required |
---|---|---|
X-Master-Key | <API_KEY> | Yes |
X-Collection-Name | My Collection | 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.
X-Collection-Name Required
X-Collection-Name is required to Name your Collection. You can set a name no more than 32 characters.
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
Request Response
Success Status Code: 200
{
"record": "<COLLECTION_ID>",
"metadata": {
"name": "My Collection"
}
}
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
Invalid Collection Id provided
You'll encounter this error when you've passed incorrect Collection Id in the URL. Verify your Collection Id.
You need to pass X-Collection-Name header to set a name for the Schema Doc
Consider passing X-Collection-Name header to update the name of your collection.
X-Collection-Name cannot be blank
You'll encounter this error if the header is passed but no value is set for the Collection Name.
Name of the Collection cannot be above 32 characters
You cannot set a Collection name above 32 characters.