dag_put
/api/v0/dag/put
Add a DAG node to IPFS.
Request
- Syntax
- Example
curl "https://ipfs.infura.io:5001/api/v0/dag/put?store-codec=dag-cbor&input-codec=dag-json&pin=<value>&hash=sha2-256" \
  -X POST \
  -u "<API_KEY>:<API_KEY_SECRET>" \
  -H "Content-Type: multipart/form-data" \
  -F file=@"<file>"
curl "https://ipfs.infura.io:5001/api/v0/dag/put" \
  -X POST \
  -u "<YOUR-API-KEY>:<YOUR-API-KEY-SECRET>" \
  -H "Content-Type: multipart/form-data" \
  -F file=@"/sample-result.json"
Request parameters
- 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- trueto 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
{
  "Cid": {
    "/": "<cid-string>"
  }
}
Result fields
- Cid- Content ID.