Pinata Docs
Searchโ€ฆ
Revoke Pinata API Key
/users/revokeApiKey
This endpoint is used to programmatically revoke Pinata API keys. This endpoint can only be called by using an "Admin" key.

Revoking an API Key

Revoking a Pinata API Key requires the public API Key, not the secret or the JWT.
put
https://api.pinata.cloud
/users/revokeApiKey
cURL
Node.js
Python
Go
curl --location --request PUT 'https://api.pinata.cloud/users/revokeApiKey' \
--header 'Authorization: Bearer PINATA JWT' \
--header 'Content-Type: application/json' \
--data-raw '{
"apiKey": "API KEY TO REVOKE"
}'
var axios = require('axios');
var data = JSON.stringify({
"apiKey": "API KEY TO REVOKE"
});
โ€‹
var config = {
method: 'put',
url: 'https://api.pinata.cloud/users/revokeApiKey',
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/users/revokeApiKey"
โ€‹
payload = json.dumps({
"apiKey": "API KEY TO REVOKE"
})
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/users/revokeApiKey"
method := "PUT"
โ€‹
payload := strings.NewReader(`{
"apiKey": "API KEY TO REVOKE"
}`)
โ€‹
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))
}
Copy link