Removing a Pin

Removing a pin from the Sagittarius A* IPFS Cluster.

Overview

The Pin Remove Request, a DELETE request to the /ipfs/pin/rm endpoint, is an IPFS Pin Orchestration request used to remove a pin for the provided CID from the Sagittarius A* IPFS Cluster. Because multiple requestors may have the same CID pinned, the request ID system described in Adding a Pin is utilized to ensure no cluster-level action is taken to remove a pin if other instances of the pinned CID still exist to preserve the pins of other requestors, only removing the pin at the cluster-level if no other instances exist.

Request Spec
  /ipfs/pin/rm/{cid}:
    delete:
      summary: Unpin an IPFS CID.
      parameters:
        - in: path
          name: cid
          required: true
          description: An IPFS Content Identifier (CID).
          schema:
            type: string

Sending the Request

Sending a request to the /ipfs/pin/rm endpoint requires a valid API Key to be provided in the x-api-key header, and that an IPFS CID be provided.

Pin Remove Request
curl -X DELETE -H "x-api-key: Your-API-Key" https://api.sgr-a.xyz/ipfs/pin/rm/QmWATWQ7fVPP2EFGu71UkfnqhYXDYH566qy47CnJDgvs8u 

When a Pin Remove Request completes successfully, the returned output will contain a success message for individual pin removal for confirmation, or a success message for confirmation along with information about the pin when cluster-level action has been taken. When a Pin Remove Request completes successfully, the returned output will contain a success message for confirmation, along with information about the removed pin.

Pin Remove Output
{
    "message": "Pin removed successfully",
    "result": {
        "cid": "QmWATWQ7fVPP2EFGu71UkfnqhYXDYH566qy47CnJDgvs8u",
        "type": "pin",
        "timestamp": "TIMESTAMP"
    },
    "apiKey": "Your-API-Key"
}

In the case where other instances of the pin exist for the given cid, cluster-level action will not be taken to remove the pin, and instead the given apiKey and cid pair record will be removed for the requestor.

Pin Remove Output
{
    "message": "Pin removed successfully from database, but CID remains pinned due to other instances"
}

Last updated