Hash Metadata




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.




pinata_api_key: (put your personal pinata api key here)

pinata_secret_api_key: (put your personal pinata secret api key here)


Authorization: Bearer (put your pinata JWT here)


ipfsPinHash: (required) - The hash of the content you with to change the pin policy for,
name: (optional) - A new name for Pinata to associate with the hash provided,
keyvalues: (optional) - The updated keyvalues you want associated with the hash provided

Adding or modifying key-values

To add or modify existing key-values, simply provide them in the following format for the key-values object:

keyvalues: {
newKey: 'newValue', //this adds a keyvalue pair
existingKey: 'newValue' //this modifies the value of an existing key if that key already exists

Removing key-values

To remove a key-value pair, simply provide null as the value for an existing key like so:

keyvalues: {
existingKeyToRemove: null //this removes a keyvalue pair


If the operation is successful, you will receive back an "OK" REST 200 status.

Postman Example

JavaScript With Axios Example

In the javascript example below, we pass in our API keys from elsewhere (hopefully in a secure way).

const axios = require('axios');
export const changeMetadataForHash = (pinataApiKey, pinataSecretApiKey, hash) => {
const url = `https://api.pinata.cloud/pinning/hashMetadata`;
const body = {
ipfsPinHash: hash,
name: 'myNewName',
keyvalues: {
newKey: 'newValue',
existingKey: 'newValue',
existingKeyToRemove: null
return axios
.put(url, body, {
headers: {
pinata_api_key: pinataApiKey,
pinata_secret_api_key: pinataSecretApiKey
.then(function (response) {
//handle response here
.catch(function (error) {
//handle error here

We want your feedback!

Have a suggestion? Have a complaint? Confused about something in the documentation? Just want to say hi?

We want to make Pinata the best product available. That involves listening to our users and addressing their needs.

Send us an email at [email protected] and we'll see how we can help.