# dag\_put

## /api/v0/dag/put

Add a DAG node to IPFS.

### REQUEST

{% tabs %}
{% tab title="Syntax" %}

```bash
curl "https://mainnet-rpc.wetez.io/ipfs/$AdminKey/api/v0/dag/put?store-codec=dag-cbor&input-codec=dag-json&pin=<value>&hash=sha2-256" \
    -X POST \
    -H "Content-Type: multipart/form-data" \
    -F file=@"<file>"
```

{% endtab %}

{% tab title="Example" %}

```bash
curl "https://mainnet-rpc.wetez.io/ipfs/$AdminKey/api/v0/dag/put" \
    -X POST \
    -H "Content-Type: multipart/form-data" \
    -F file=@"wetez-ipfs.json"
```

{% endtab %}
{% endtabs %}

#### 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` pin this object when adding.
* `hash` *\[Optional]*: Hash function to use. The default is `sha2-256`.

### RESPONSE

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

#### BODY

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

#### RESULT FIELDS

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wetez.io/wetez/developer/storage/dag_put.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
