Delete file
Remove a pin from your account. API endpoint: DELETE /files/remove/:cid. The backend uses the stored clusterId to unpin from the correct cluster.
Scope required: files:delete
Endpoint
| Method | DELETE |
| URL | https://api.pinarkive.com/api/v3/files/remove/:cid |
Replace :cid with the IPFS content identifier to remove.
Headers: Authorization: Bearer YOUR_API_KEY or X-API-Key: YOUR_API_KEY
No request body.
Request
cURL
curl -X DELETE "https://api.pinarkive.com/api/v3/files/remove/bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi" \
-H "X-API-Key: YOUR_API_KEY"JavaScript (fetch)
const cid =
"bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi";
const response = await fetch(
`https://api.pinarkive.com/api/v3/files/remove/${cid}`,
{
method: "DELETE",
headers: { "X-API-Key": process.env.PINARKIVE_API_KEY },
}
);
if (response.ok) console.log("Pin removed");JavaScript (axios)
const cid =
"bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi";
await axios.delete(
`https://api.pinarkive.com/api/v3/files/remove/${cid}`,
{
headers: { "X-API-Key": process.env.PINARKIVE_API_KEY },
}
);Python
import os
import requests
cid = "bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi"
url = f"https://api.pinarkive.com/api/v3/files/remove/{cid}"
headers = {"X-API-Key": os.environ["PINARKIVE_API_KEY"]}
r = requests.delete(url, headers=headers)
r.raise_for_status()
print("Pin removed")Go
package main
import (
"net/http"
"os"
)
func main() {
cid := "bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi"
url := "https://api.pinarkive.com/api/v3/files/remove/" + cid
apiKey := os.Getenv("PINARKIVE_API_KEY")
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Set("X-API-Key", apiKey)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}PHP
<?php
$cid = 'bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi';
$url = "https://api.pinarkive.com/api/v3/files/remove/$cid";
$apiKey = getenv('PINARKIVE_API_KEY');
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-Key: ' . $apiKey]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);Response
Success (200)
{
"cid": "bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi",
"removed": true
}Error (4xx / 5xx)
{
"error": "Not Found",
"message": "Pin not found for this CID"
}Common codes: 401, 403 (code: missing_scope, required), 404, 429. See Error handling.