[IPFS] Unpin Nid/Cid from IPFS

The following API helps you unpin an IPFS Nid from Numbers IPFS gateway. You need both the Capture Token and the Nid for this process. If you do not already have a Capture Token yet, please follow the instruction provided to create one.

API Endpoint: https://eo3wcvdjj73vq4x.m.pipedream.net

Cost: 0.01 NUM

Method: POST

Description:
This is a free API to unpin the Nid you provide from the Numbers IPFS gateway.

Authentication:
This API requires a valid token for Authorization. The token should be passed in the headers of the request using the following format: "Authorization: token YOUR_CAPTURE_TOKEN"

Header:
Authorization: token $YOUR_CAPTURE_TOKEN (required)
Content-Type: application/json

Request Body (required):
nid (string): Nid to be unpinned.

Example:
curl -X POST "https://eoomqofcyr7y0fl.m.pipedream.net" \
     -H "Content-Type: application/json" \
     -H "Authorization: token YOUR_CAPTURE_TOKEN" \
     -d '{
         "nid": NID_TO_UNPIN
     }'

Response:
{
    "result": true
}

200: Nid has been successfully unpinned or Nid was not originally pinned.
400: Bad request
401: Unauthorized
403: Forbidden
500: Internal Server Error

A detailed explanation of the Nid can be found on the Numbers ID (Nid) page. In this example, you would replace YOUR_CAPTURE_TOKEN with your actual Capture token and NID_TO_UNPIN with the Nid you want to unpin. More examples can be found below:

import requests

url = "https://eoomqofcyr7y0fl.m.pipedream.net"
headers = {
    "Content-Type": "application/json",
    "Authorization": "token YOUR_CAPTURE_TOKEN"
}
data = {
  "nid": NID_TO_UNPIN
}

response = requests.post(url, headers=headers, json=data)

if response.status_code == 200:
    response_json = response.json()
    print(response_json)
else:
    print("Request failed with status code:", response.status_code)

Last updated