Content Operations
resource: content — add, cat, get, ls, refs
add
Uploads binary content to IPFS via a multipart request and returns its CID. Binary input.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
inputDataKey | text | No | data | Key in the upstream node's InputData holding the bytes to add. |
dataMode | select | No | base64 | base64 | text — how to decode inline/string content. |
inlineContent | text | No | — | Inline content fallback (encoded per dataMode) when nothing is found under inputDataKey. |
fileName | text | No | file | File name recorded on the multipart part. |
pin | bool | No | true | Pin the content after adding. |
wrapWithDirectory | bool | No | false | Wrap the file in a directory listing. |
chunker | text | No | — | Chunking algorithm, e.g. size-262144. |
cidVersion | int | No | 0 | CID version (0 or 1). |
hash | text | No | — | Hash function, e.g. sha2-256. |
onlyHash | bool | No | false | Compute the CID without actually adding the content to the repo. |
nocopy | bool | No | false | Reference filestore blocks instead of copying (filestore must be enabled on the daemon). |
Example response:
{
"cid": "QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco",
"name": "file",
"size": "1024"
}
cat
Reads the raw bytes of a resolved IPFS path. Binary output.
| Field | Type | Required | Description |
|---|---|---|---|
path | text | ✓ Yes | IPFS path to read, e.g. /ipfs/<cid> or a bare CID (also accepted under a cid alias). Missing → CFG_MISSING_PATH. |
offset | int (long) | No | Byte offset to start reading from. |
length | int (long) | No | Maximum number of bytes to return. |
Output record carries the raw byte[] under data for downstream nodes.
get
Fetches a resolved path as a TAR archive (optionally gzip-compressed). Binary output.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
path | text | ✓ Yes | — | IPFS path to fetch. Missing → CFG_MISSING_PATH. |
compress | bool | No | false | Gzip-compress the TAR archive. |
compressionLevel | int | No | -1 | Gzip compression level when compress=true. |
ls
Lists the links under a directory CID.
| Field | Type | Required | Description |
|---|---|---|---|
path | text | ✓ Yes | IPFS path to list. Missing → CFG_MISSING_PATH. |
refs
Lists the CIDs referenced by a CID.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
path | text | ✓ Yes | — | IPFS path whose references to list. Missing → CFG_MISSING_PATH. |
recursive | bool | No | false | Recurse into referenced objects' own references. |
unique | bool | No | false | De-duplicate the reference list. |
Binary I/O pattern:
add is the input side (bytes resolved from
inputDataKey → inlineContent fallback, decoded per dataMode) and
cat/get are the output side (raw byte[] placed directly in the
items record). This same input/output pattern repeats across dag/put, dag/export,
block/put, block/get, and files/write/files/read — see
Input & Output.