/api/v0/dag/put

Add a DAG node to IPFS.

Arguments

  • store-codec [string]: Codec that the stored object will be encoded with. Default: dag-cbor. Required: no.

  • input-codec [string]: Codec that the input object is encoded in. Default: dag-json. Required: no.

  • pin [bool]: Pin this object when adding. Required: no.

  • hash [string]: Hash function to use. Required: no.

  • allow-big-block [bool]: Disable block size check and allow creation of blocks bigger than 1MiB. WARNING: such blocks won't be transferable over the standard bitswap. Default: false. Required: no.

Request Body

Argument object data is of file type. This endpoint expects one or several files (depending on the command) in the body of the request as 'multipart/form-data'.

Response

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

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

cURL Example

curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/dag/put?store-codec=dag-cbor&input-codec=dag-json&pin=<value>&hash=<value>&allow-big-block=false"

Last updated