> ## Documentation Index
> Fetch the complete documentation index at: https://pinata-mintlify-5df45191.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Pin By CID

> Upload a file already on the IPFS network to Pinata

This endpoint allows for an additional property in the `pinataOptions` object to help our IPFS nodes find the content you would like pinned.

**`hostNodes` - multiaddresses of nodes your content is already stored on.**

You can pass in the "multiaddresses" up to five host nodes that your content already resides on.

To find the multiaddresses of your own nodes, simply run the following on your node's command line:

`ipfs id`

In the response, you'll want to focus on the "Addresses" array that's returned. Here you'll find the multiaddresses of your node. These multiaddresses are what other IPFS nodes use to connect to your node.

In the "Addresses" array, take note of the multiaddress that contains your external IP address. Not the local ipv4 "127.0.0.1" address or the local ipv6 "::1" address.

Here's an example of a full external ipv4 multiaddress (your IP address and node ID will differ):

`/ip4/123.456.78.90/tcp/4001/ipfs/QmAbCdEfGhIjKlMnOpQrStUvWxYzAbCdEfGhIjKlMnOpQr`

Once you've grabbed the full multiaddress for every node that already has your content pinned, simply add the "host\_nodes" property to your pinataOptions object like so:

```
{
    hashToPin: (ExampleHash),
    pinataOptions: {
        hostNodes: [
            /ip4/hostNode1ExternalIP/tcp/4001/ipfs/hostNode1PeerId,
            /ip4/hostNode2ExternalIP/tcp/4001/ipfs/hostNode2PeerId
            .
            .
            .
        ]
    }
}
```


## OpenAPI

````yaml post /pinning/pinByHash
openapi: 3.0.0
info:
  title: Pinata API
  description: ''
  termsOfService: https://www.pinata.cloud/terms-conditions
  contact:
    name: Pinata Team
    email: team@pinata.cloud
  version: 1.0.0
servers:
  - url: https://api.pinata.cloud
security:
  - bearerAuth: []
paths:
  /pinning/pinByHash:
    post:
      summary: Pin By CID
      description: Upload a file already on the IPFS network to Pinata
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/pinning_pinByHash_body'
      responses:
        '200':
          description: |-
            {
                "id": "ID of the pin by CID job",
                "ipfsHash": "CID submitted",
                "status": "Status of pin by CID job",
                "name": "MyCustomName"
            }
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_200_2'
      security:
        - bearerAuth: []
      servers:
        - url: https://api.pinata.cloud
components:
  schemas:
    pinning_pinByHash_body:
      required:
        - hashToPin
      type: object
      properties:
        hashToPin:
          type: string
          description: The CID of the file you want to pin to Pinata
          example: CID
        pinataOptions:
          type: object
          properties:
            groupId:
              type: string
            hostNodes:
              type: array
              items:
                type: string
        pinataMetadata:
          type: object
          properties:
            name:
              type: string
            keyvalues:
              type: object
              additionalProperties: true
    inline_response_200_2:
      type: object
      properties:
        id:
          type: string
        ipfsHash:
          type: string
        status:
          type: string
        name:
          type: string
      x-examples:
        Example 1:
          id: 4277506a-80c1-4d37-bc8e-afd09ead9da7
          ipfsHash: bafkreihbuc7yg6u3u55dsky6wqnccx6cvmwwuoeeh77bwgrvo3zofqtkdy
          status: prechecking
          name: MyCustomName
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````