# How to pin a dag CID?

**URL:** <https://discuss.ipfs.tech/t/how-to-pin-a-dag-cid/1070>\
**Category:** Help\
**Tags:** ipld\
**Created:** [September 9, 2017, 4:19pm UTC](https://discuss.ipfs.tech/t/how-to-pin-a-dag-cid/1070 "2017-09-09T16:19:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Distense](https://avatars.discourse-cdn.com/v4/letter/d/e47c2d/32.png) [@Distense](https://discuss.ipfs.tech/u/Distense)\
**Post date:** [September 9, 2017, 4:19pm UTC](https://discuss.ipfs.tech/t/how-to-pin-a-dag-cid/1070/1 "2017-09-09T16:19:14Z")

</div>

Our application `puts` dag nodes with `ipfs.dag.put`. There is no corresponding `ipfs.files.add` command though. The `dag` api is very simple with just `put` and `get`. Does putting `pin` CIDs? How can I permanently `pin` dag nodes?

---

<div class="post-metadata">

**Author:** ![tyvdh](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/tyvdh/32/2422_2.png) [@tyvdh](https://discuss.ipfs.tech/u/tyvdh)\
**Post date:** [August 18, 2018, 4:46pm UTC](https://discuss.ipfs.tech/t/how-to-pin-a-dag-cid/1070/2 "2018-08-18T16:46:33Z")

</div>

Any word on this? I’m curious about the same thing.

---

<div class="post-metadata">

**Author:** ![leerspace](https://avatars.discourse-cdn.com/v4/letter/l/94ad74/32.png) [@leerspace](https://discuss.ipfs.tech/u/leerspace)\
**Post date:** [August 19, 2018, 2:26pm UTC](https://discuss.ipfs.tech/t/how-to-pin-a-dag-cid/1070/3 "2018-08-19T14:26:14Z")

</div>

According to [this page](https://github.com/ipfs/js-ipfs#graph), pinning in js-ipfs isn’t implemented yet.

---

<div class="post-metadata">

**Author:** ![KrishnaPG](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/krishnapg/32/1855_2.png) [@KrishnaPG](https://discuss.ipfs.tech/u/KrishnaPG)\
**Post date:** [May 25, 2019, 2:21am UTC](https://discuss.ipfs.tech/t/how-to-pin-a-dag-cid/1070/4 "2019-05-25T02:21:31Z")

</div>

Wondering if `dag put` takes care of pinning or, should the generated `CID` be explicitly pinned? Anyone has any insights?

---

<div class="post-metadata">

**Author:** ![khinsen](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/khinsen/32/2681_2.png) [@khinsen](https://discuss.ipfs.tech/u/khinsen)\
**Post date:** [May 29, 2019, 10:43am UTC](https://discuss.ipfs.tech/t/how-to-pin-a-dag-cid/1070/5 "2019-05-29T10:43:38Z")

</div>

The [documentation for the HTTP API](https://docs.ipfs.io/reference/api/http/#api-v0-dag-put) describes an optional parameter for pinning. Since js-ipfs goes through the HTTP API when a daemon is running on the same machine, I’d expect it to support this parameter. But then, I don’t use JavaScript, so I can’t say for sure. Just try, or look at the source.
