# dag\_put

Add a DAG node to IPFS

#### REQUEST <a href="#request" id="request"></a>

```bash
curl "https://ipfs.krypc.io:5001/api/v0/dag/put?store-codec=dag-cbor&#x26;input-codec=dag-json&#x26;pin=&#x3C;value>&#x26;hash=sha2-256" \
    -X POST \
    -u "&#x3C;API_KEY>:&#x3C;API_KEY_SECRET>" \
    -H "Content-Type: multipart/form-data" \
    -F file=@"&#x3C;file>"
```

**REQUEST PARAMS**[**​**](https://docs.infura.io/networks/ipfs/http-api-methods/dag_put#request-params)

* `store-codec` *\[Optional]*: Codec that the stored object will be encoded with. The default is `dag-cbor`.
* `input-codec` *\[Optional]*: Codec that the input object is encoded in. The default is `dag-json`.
* `pin` *\[Optional]*: Set to `true` to pin this object when adding.
* `hash` *\[Optional]*: Hash function to use. The default is `sha2-256`.

#### RESPONSE[​](https://docs.infura.io/networks/ipfs/http-api-methods/dag_put#response) <a href="#response" id="response"></a>

On success, the call to this endpoint will return with 200 and the following body:

**BODY**[**​**](https://docs.infura.io/networks/ipfs/http-api-methods/dag_put#body)

```

{
  "Cid": {
    "/": "<cid-string>"
  }
}
```

**RESULT FIELDS**[**​**](https://docs.infura.io/networks/ipfs/http-api-methods/dag_put#result-fields)

* `Cid` - [Content ID](https://github.com/multiformats/cid).
