Pinata Docs
Search…
Update Metadata
/pinning/hashMetadata
This endpoint allows the sender to change the name and custom key-values associated with a piece of content stored on Pinata.
Changes made via this endpoint only affect the metadata for the hash passed in.

Updating Metadata For CID

put
https://api.pinata.cloud
/pinning/hashMetadata
cURL
Node.js
Python
Go
curl --location --request PUT 'https://api.pinata.cloud/pinning/hashMetadata' \
--header 'Authorization: Bearer PINATA JWT' \
--header 'Content-Type: application/json' \
--data-raw '{
"ipfsPinHash": "CID",
"name": "Name",
"keyvalues": {
"anewkeyk": "anewvalue"
}
}'
var axios = require('axios');
var data = JSON.stringify({
"ipfsPinHash": "CID",
"name": "Name",
"keyvalues": {
"anewkeyk": "anewvalue"
}
});
​
var config = {
method: 'put',
url: 'https://api.pinata.cloud/pinning/hashMetadata',
headers: {
'Authorization': 'Bearer PINATA JWT',
'Content-Type': 'application/json'
},
data: data
};
​
const res = await axios(config);
​
console.log(res.data);
import requests
import json
​
url = "https://api.pinata.cloud/pinning/hashMetadata"
​
payload = json.dumps({
"ipfsPinHash": "CID",
"name": "Name",
"keyvalues": {
"anewkeyk": "anewvalue"
}
})
headers = {
'Authorization': 'Bearer PINATA JWT',
'Content-Type': 'application/json'
}
​
response = requests.request("PUT", url, headers=headers, data=payload)
​
print(response.text)
​
package main
​
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
​
func main() {
​
url := "https://api.pinata.cloud/pinning/hashMetadata"
method := "PUT"
​
payload := strings.NewReader(`{
"ipfsPinHash": "CID",
"name": "Name",
"keyvalues": {
"anewkeyk": "anewvalue"
}
}`)
​
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
​
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Bearer PINATA JWT")
req.Header.Add("Content-Type", "application/json")
​
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
​
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}