# block\_put

## /api/v0/block/put

Store input as an IPFS block.

### REQUEST

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

```bash
curl "https://mainnet-rpc.wetez.io/ipfs/$AdminKey/api/v0/block/put?format=v0&mhtype=sha2-256&mhlen=-1" \
    -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/block/put" \
    -X POST \
    -H "Content-Type: multipart/form-data" \
    -F file=@"/wetez-ipfs"
```

{% endtab %}
{% endtabs %}

#### REQUEST PARAMS

* `file` *\[Required]* - The path to a file to be added to IPFS.
* `format` *\[Optional]* - Content ID format for blocks to be created with. The default is `v0`.
* `mhtype` *\[Optional]* - Multihash hash function. The default is `sha2-256`.
* `mhlen` *\[Optional]* - Multihash hash length. The default is `-1`.

### RESPONSE

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

#### BODY

```json
{
    "Key": "bafkreihlm3c4dulcrgbrs6ljgfssb74bupyr4wfnhmyuc6in4w2a63ct5i",
    "Size": 12
}
```

#### RESULT FIELDS

* `Key` - Key of the block.
* `Size` - Integer indication size in bytes.


---

# 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/block_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.
