title | description |
---|---|
Kubo RPC API |
RPC API v0 reference for Kubo IPFS daemon. |
::: tip Generated on 2024-09-11, from kubo v0.30.0 This document was autogenerated from v0.30.0. For issues and support, check out the http-api-docs generator on GitHub. :::
When a Kubo IPFS node is running as a daemon, it exposes an HTTP RPC API that allows you to control the node and run the same commands you can from the command line.
In many cases, using this RPC API is preferable to embedding IPFS directly in your program — it allows you to maintain peer connections that are longer lived than your app and you can keep a single IPFS node running instead of several if your app can be launched multiple times. In fact, the ipfs
CLI commands use this RPC API when operating in online mode.
::: danger NEVER EXPOSE THE RPC API TO THE PUBLIC INTERNET
The RPC API provides admin-level access to your Kubo IPFS node, including /api/v0/config
.
It is bound to localhost
by default on purpose. You should never expose it to the public internet, just like you would never expose a SQL database or other backend service.
If you are looking for an interface designed for browsers and public internet, consider implementation-agnostic HTTP Gateway instead. :::
The API under /api/v0/
is an RPC-style API over HTTP, not a REST API.
Every command usable from the CLI is also available through the HTTP RPC API. For example:
> ipfs swarm peers
/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ
/ip4/104.236.151.122/tcp/4001/p2p/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx
/ip4/104.236.176.52/tcp/4001/p2p/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z
> curl -X POST http://127.0.0.1:5001/api/v0/swarm/peers
{
"Strings": [
"/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
"/ip4/104.236.151.122/tcp/4001/p2p/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx",
"/ip4/104.236.176.52/tcp/4001/p2p/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z",
]
}
Arguments are added through the special query string key "arg":
> curl -X POST "http://127.0.0.1:5001/api/v0/swarm/disconnect?arg=/ip4/54.93.113.247/tcp/48131/p2p/QmUDS3nsBD1X4XK5Jo836fed7SErTyTuQzRqWaiQAyBYMP"
{
"Strings": [
"disconnect QmUDS3nsBD1X4XK5Jo836fed7SErTyTuQzRqWaiQAyBYMP success",
]
}
Note that it can be used multiple times to signify multiple arguments.
Flags are added through the query string. For example, the --encoding=json
flag is the &encoding=json
query parameter below:
> curl -X POST "http://127.0.0.1:5001/api/v0/object/get?arg=QmaaqrHyAQm7gALkRW8DcfGX3u8q9rWKnxEMmf7m9z515w&encoding=json"
{
"Links": [
{
"Name": "index.html",
"Hash": "QmYftndCvcEiuSZRX7njywX2AGSeHY2ASa7VryCq1mKwEw",
"Size": 1700
},
{
"Name": "static",
"Hash": "QmdtWFiasJeh2ymW3TD2cLHYxn1ryTuWoNpwieFyJriGTS",
"Size": 2428803
}
],
"Data": "CAE="
}
Some flags may be repeated. For example, the --status
flag may be reused as below:
> curl -X POST "http://127.0.0.1:5001/api/v0/pin/remote/service/ls?name=myservice&status=pinned&status=pinning"
::: tip
Some arguments may belong only to the CLI but appear here too. These usually belong to client-side processing of input, particularly in the add
command.
Additionally, as a convenience certain CLI commands may allow passing repeated flags as delimited lists such as
ipfs pin remote service ls --status=pinned,pinning
; however, this does not apply to the HTTP API.
:::
Status codes used at the RPC layer are simple:
200
- The request was processed or is being processed (streaming)500
- RPC endpoint returned an error400
- Malformed RPC, argument type error, etc403
- RPC call forbidden404
- RPC endpoint doesn't exist405
- HTTP Method Not Allowed
Status code 500
means that the function does exist, but IPFS was not able to fulfil the request because of an error. To know that reason, you have to look at the error message that is usually returned with the body of the response (if no error, check the daemon logs).
Streaming endpoints fail as above, unless they have started streaming. That means they will have sent a 200
status code already. If an error happens during the stream, it will be included in a Trailer response header (some endpoints may additionally include an error in the last streamed object).
A 405
error may mean that you are using the wrong HTTP method (i.e. GET instead of POST), and a 403
error occurs in a browser due to Origin / CORS.
When a request is sent from a browser, HTTP RPC API follows the Origin-based security model, and expects the Origin
HTTP header to be present.
The API will return HTTP Error 403 when Origin is missing, does not match the API port, or is not safelisted via API.HTTPHeaders.Access-Control-Allow-Origin
in the config.
Add a file or directory to IPFS.
quiet
[bool]: Write minimal output. Required: no.quieter
[bool]: Write only final hash. Required: no.silent
[bool]: Write no output. Required: no.progress
[bool]: Stream progress data. Required: no.trickle
[bool]: Use trickle-dag format for dag generation. Required: no.only-hash
[bool]: Only chunk and hash - do not write to disk. Required: no.wrap-with-directory
[bool]: Wrap files with a directory object. Required: no.chunker
[string]: Chunking algorithm, size-[bytes], rabin-[min]-[avg]-[max] or buzhash. Required: no.raw-leaves
[bool]: Use raw blocks for leaf nodes. Required: no.nocopy
[bool]: Add the file using filestore. Implies raw-leaves. (experimental). Required: no.fscache
[bool]: Check the filestore for pre-existing blocks. (experimental). Required: no.cid-version
[int]: CID version. Defaults to 0 unless an option that depends on CIDv1 is passed. Passing version 1 will cause the raw-leaves option to default to true. Required: no.hash
[string]: Hash function to use. Implies CIDv1 if not sha2-256. (experimental). Required: no.inline
[bool]: Inline small blocks into CIDs. (experimental). Required: no.inline-limit
[int]: Maximum block size to inline. (experimental). Default:32
. Required: no.pin
[bool]: Pin locally to protect added files from garbage collection. Default:true
. Required: no.to-files
[string]: Add reference to Files API (MFS) at the provided path. Required: no.preserve-mode
[bool]: Apply existing POSIX permissions to created UnixFS entries. Disables raw-leaves. (experimental). Required: no.preserve-mtime
[bool]: Apply existing POSIX modification time to created UnixFS entries. Disables raw-leaves. (experimental). Required: no.mode
[uint]: Custom POSIX file mode to store in created UnixFS entries. Disables raw-leaves. (experimental). Required: no.mtime
[int64]: Custom POSIX modification time to store in created UnixFS entries (seconds before or after the Unix Epoch). Disables raw-leaves. (experimental). Required: no.mtime-nsecs
[uint]: Custom POSIX modification time (optional time fraction in nanoseconds). Required: no.
Argument path
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'.
The add
command not only allows adding files, but also uploading directories and complex hierarchies.
This happens as follows: Every part in the multipart request is a directory or a file to be added to IPFS.
Directory parts have a special content type application/x-directory
. These parts do not carry any data. The part headers look as follows:
Content-Disposition: form-data; name="file"; filename="folderName"
Content-Type: application/x-directory
File parts carry the file payload after the following headers:
Abspath: /absolute/path/to/file.txt
Content-Disposition: form-data; name="file"; filename="folderName%2Ffile.txt"
Content-Type: application/octet-stream
...contents...
The above file includes its path in the "folderName/file.txt" hierarchy and IPFS will therefore be able to add it inside "folderName". The parts declaring the directories are optional when they have files inside and will be inferred from the filenames. In any case, a depth-first traversal of the directory tree is recommended to order the different parts making the request.
The Abspath
header is included for filestore/urlstore features that are enabled with the nocopy
option and it can be set to the location of the file in the filesystem (within the IPFS root), or to its full web URL.
On success, the call to this endpoint will return with 200 and the following body:
{
"Bytes": "<int64>",
"Hash": "<string>",
"Mode": "<string>",
"Mtime": "<int64>",
"MtimeNsecs": "<int>",
"Name": "<string>",
"Size": "<string>"
}
curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/add?quiet=<value>&quieter=<value>&silent=<value>&progress=<value>&trickle=<value>&only-hash=<value>&wrap-with-directory=<value>&chunker=<value>&raw-leaves=<value>&nocopy=<value>&fscache=<value>&cid-version=<value>&hash=<value>&inline=<value>&inline-limit=32&pin=true&to-files=<value>&preserve-mode=<value>&preserve-mtime=<value>&mode=<value>&mtime=<value>&mtime-nsecs=<value>"
Show the current ledger for a peer.
arg
[string]: The PeerID (B58) of the ledger to inspect. Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"Exchanged": "<uint64>",
"Peer": "<string>",
"Recv": "<uint64>",
"Sent": "<uint64>",
"Value": "<float64>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/bitswap/ledger?arg=<peer>"
Trigger reprovider.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/bitswap/reprovide"
Show some diagnostic information on the bitswap agent.
verbose
[bool]: Print extra information. Required: no.human
[bool]: Print sizes in human readable format (e.g., 1K 234M 2G). Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"BlocksReceived": "<uint64>",
"BlocksSent": "<uint64>",
"DataReceived": "<uint64>",
"DataSent": "<uint64>",
"DupBlksReceived": "<uint64>",
"DupDataReceived": "<uint64>",
"MessagesReceived": "<uint64>",
"Peers": [
"<string>"
],
"ProvideBufLen": "<int>",
"Wantlist": [
{
"/": "<cid-string>"
}
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/bitswap/stat?verbose=<value>&human=<value>"
Show blocks currently on the wantlist.
peer
[string]: Specify which peer to show wantlist for. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Keys": [
{
"/": "<cid-string>"
}
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/bitswap/wantlist?peer=<value>"
Get a raw IPFS block.
arg
[string]: The CID of an existing block to get. Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/block/get?arg=<cid>"
Store input as an IPFS block.
cid-codec
[string]: Multicodec to use in returned CID. Default:raw
. Required: no.mhtype
[string]: Multihash hash function. Required: no.mhlen
[int]: Multihash hash length. Default:-1
. Required: no.pin
[bool]: Pin added blocks recursively. Default:false
. 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.format
[string]: Use legacy format for returned CID (DEPRECATED). Required: no.
Argument 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'.
On success, the call to this endpoint will return with 200 and the following body:
{
"Key": "<string>",
"Size": "<int>"
}
curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/block/put?cid-codec=raw&mhtype=<value>&mhlen=-1&pin=false&allow-big-block=false&format=<value>"
Remove IPFS block(s) from the local datastore.
arg
[string]: CIDs of block(s) to remove. Required: yes.force
[bool]: Ignore nonexistent blocks. Required: no.quiet
[bool]: Write minimal output. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Error": "<string>",
"Hash": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/block/rm?arg=<cid>&force=<value>&quiet=<value>"
Print information of a raw IPFS block.
arg
[string]: The CID of an existing block to stat. Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"Key": "<string>",
"Size": "<int>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/block/stat?arg=<cid>"
Show or edit the list of bootstrap peers.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Peers": [
"<string>"
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/bootstrap"
Add peers to the bootstrap list.
arg
[string]: A peer to add to the bootstrap list (in the format '<multiaddr>/<peerID>') Required: no.default
[bool]: Add default bootstrap nodes. (Deprecated, use 'default' subcommand instead). Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Peers": [
"<string>"
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/bootstrap/add?arg=<peer>&default=<value>"
Add default peers to the bootstrap list.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Peers": [
"<string>"
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/bootstrap/add/default"
Show peers in the bootstrap list.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Peers": [
"<string>"
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/bootstrap/list"
Remove peers from the bootstrap list.
arg
[string]: A peer to add to the bootstrap list (in the format '<multiaddr>/<peerID>') Required: no.all
[bool]: Remove all bootstrap peers. (Deprecated, use 'all' subcommand). Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Peers": [
"<string>"
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/bootstrap/rm?arg=<peer>&all=<value>"
Remove all peers from the bootstrap list.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Peers": [
"<string>"
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/bootstrap/rm/all"
Show IPFS object data.
arg
[string]: The path to the IPFS object(s) to be outputted. Required: yes.offset
[int64]: Byte offset to begin reading from. Required: no.length
[int64]: Maximum number of bytes to read. Required: no.progress
[bool]: Stream progress data. Default:true
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/cat?arg=<ipfs-path>&offset=<value>&length=<value>&progress=true"
Convert CIDs to Base32 CID version 1.
arg
[string]: CIDs to convert. Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"CidStr": "<string>",
"ErrorMsg": "<string>",
"Formatted": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/cid/base32?arg=<cid>"
List available multibase encodings.
prefix
[bool]: also include the single letter prefixes in addition to the code. Required: no.numeric
[bool]: also include numeric codes. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
[
{
"Code": "<int>",
"Name": "<string>"
}
]
curl -X POST "http://127.0.0.1:5001/api/v0/cid/bases?prefix=<value>&numeric=<value>"
List available CID multicodecs.
numeric
[bool]: also include numeric codes. Required: no.supported
[bool]: list only codecs supported by go-ipfs commands. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
[
{
"Code": "<int>",
"Name": "<string>"
}
]
curl -X POST "http://127.0.0.1:5001/api/v0/cid/codecs?numeric=<value>&supported=<value>"
Format and convert a CID in various useful ways.
arg
[string]: CIDs to format. Required: yes.f
[string]: Printf style format string. Default: %s. Default:%s
. Required: no.v
[string]: CID version to convert to. Required: no.mc
[string]: CID multicodec to convert to. Required: no.b
[string]: Multibase to display CID in. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"CidStr": "<string>",
"ErrorMsg": "<string>",
"Formatted": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/cid/format?arg=<cid>&f=%s&v=<value>&mc=<value>&b=<value>"
List available multihashes.
numeric
[bool]: also include numeric codes. Required: no.supported
[bool]: list only codecs supported by go-ipfs commands. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
[
{
"Code": "<int>",
"Name": "<string>"
}
]
curl -X POST "http://127.0.0.1:5001/api/v0/cid/hashes?numeric=<value>&supported=<value>"
List all available commands.
flags
[bool]: Show command flags. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Name": "<string>",
"Options": [
{
"Names": [
"<string>"
]
}
],
"Subcommands": [
{
"Name": "<string>",
"Options": [
{
"Names": [
"<string>"
]
}
],
"Subcommands": [
"..."
]
}
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/commands?flags=<value>"
Get and set IPFS config values.
arg
[string]: The key of the config entry (e.g. "Addresses.API"). Required: yes.arg
[string]: The value to set the config entry to. Required: no.bool
[bool]: Set a boolean value. Required: no.json
[bool]: Parse stringified JSON. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Key": "<string>",
"Value": "<object>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/config?arg=<key>&arg=<value>&bool=<value>&json=<value>"
Apply profile to config.
arg
[string]: The profile to apply to the config. Required: yes.dry-run
[bool]: print difference between the current config and the config that would be generated. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"NewCfg": {
"<string>": "<object>"
},
"OldCfg": {
"<string>": "<object>"
}
}
curl -X POST "http://127.0.0.1:5001/api/v0/config/profile/apply?arg=<profile>&dry-run=<value>"
Replace the config with <file>.
Argument file
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'.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/config/replace"
Output config file contents.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"<string>": "<object>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/config/show"
Streams the selected DAG as a .car stream on stdout.
arg
[string]: CID of a root to recursively export Required: yes.progress
[bool]: Display progress on CLI. Defaults to true when STDERR is a TTY. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/dag/export?arg=<root>&progress=<value>"
Get a DAG node from IPFS.
arg
[string]: The object to get Required: yes.output-codec
[string]: Format that the object will be encoded as. Default:dag-json
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/dag/get?arg=<ref>&output-codec=dag-json"
Import the contents of .car files
pin-roots
[bool]: Pin optional roots listed in the .car headers after importing. Default:true
. Required: no.silent
[bool]: No output. Required: no.stats
[bool]: Output stats. 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.
Argument path
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'.
On success, the call to this endpoint will return with 200 and the following body:
{
"Root": {
"Cid": {
"/": "<cid-string>"
},
"PinErrorMsg": "<string>"
},
"Stats": {
"BlockBytesCount": "<uint64>",
"BlockCount": "<uint64>"
}
}
curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/dag/import?pin-roots=true&silent=<value>&stats=<value>&allow-big-block=false"
Add a DAG node to IPFS.
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.
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'.
On success, the call to this endpoint will return with 200 and the following body:
{
"Cid": {
"/": "<cid-string>"
}
}
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"
Resolve IPLD block.
arg
[string]: The path to resolve Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"Cid": {
"/": "<cid-string>"
},
"RemPath": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/dag/resolve?arg=<ref>"
Gets stats for a DAG.
arg
[string]: CID of a DAG root to get statistics for Required: yes.progress
[bool]: Return progressive data while reading through the DAG. Default:true
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"DagStats": [
{
"Cid": {
"/": "<cid-string>"
},
"NumBlocks": "<int64>",
"Size": "<uint64>"
}
],
"Ratio": "<float32>",
"SharedSize": "<uint64>",
"TotalSize": "<uint64>",
"UniqueBlocks": "<int>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/dag/stat?arg=<root>&progress=true"
List commands run on this IPFS node.
verbose
[bool]: Print extra information. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
[
{
"Active": "<bool>",
"Args": [
"<string>"
],
"Command": "<string>",
"EndTime": "<timestamp>",
"ID": "<int>",
"Options": {
"<string>": "<object>"
},
"StartTime": "<timestamp>"
}
]
curl -X POST "http://127.0.0.1:5001/api/v0/diag/cmds?verbose=<value>"
Clear inactive requests from the log.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/diag/cmds/clear"
Set how long to keep inactive requests in the log.
arg
[string]: Time to keep inactive requests in log. Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/diag/cmds/set-time?arg=<time>"
Collect a performance profile for debugging.
output
[string]: The path where the output .zip should be stored. Default: ./ipfs-profile-[timestamp].zip. Required: no.collectors
[array]: The list of collectors to use for collecting diagnostic data. Default: [goroutines-stack goroutines-pprof version heap allocs bin cpu mutex block trace]. Default:[goroutines-stack goroutines-pprof version heap allocs bin cpu mutex block trace]
. Required: no.profile-time
[string]: The amount of time spent profiling. If this is set to 0, then sampling profiles are skipped. Default:30s
. Required: no.mutex-profile-fraction
[int]: The fraction 1/n of mutex contention events that are reported in the mutex profile. Default:4
. Required: no.block-profile-rate
[string]: The duration to wait between sampling goroutine-blocking events for the blocking profile. Default:1ms
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/diag/profile?output=<value>&collectors=[goroutines-stack goroutines-pprof version heap allocs bin cpu mutex block trace]&profile-time=30s&mutex-profile-fraction=4&block-profile-rate=1ms"
Print system diagnostic information.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/diag/sys"
Change the CID version or hash function of the root node of a given path.
arg
[string]: Path to change. Default: '/'. Required: no.cid-version
[int]: Cid version to use. (experimental). Required: no.hash
[string]: Hash function to use. Will set Cid version to 1 if used. (experimental). Required: no.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/files/chcid?arg=<path>&cid-version=<value>&hash=<value>"
Add references to IPFS files and directories in MFS (or copy within MFS).
arg
[string]: Source IPFS or MFS path to copy. Required: yes.arg
[string]: Destination within MFS. Required: yes.parents
[bool]: Make parent directories as needed. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/files/cp?arg=<source>&arg=<dest>&parents=<value>"
Flush a given path's data to disk.
arg
[string]: Path to flush. Default: '/'. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Cid": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/files/flush?arg=<path>"
List directories in the local mutable namespace.
arg
[string]: Path to show listing for. Defaults to '/'. Required: no.long
[bool]: Use long listing format. Required: no.U
[bool]: Do not sort; list entries in directory order. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Entries": [
{
"Hash": "<string>",
"Name": "<string>",
"Size": "<int64>",
"Type": "<int>"
}
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/files/ls?arg=<path>&long=<value>&U=<value>"
Make directories.
arg
[string]: Path to dir to make. Required: yes.parents
[bool]: No error if existing, make parent directories as needed. Required: no.cid-version
[int]: Cid version to use. (experimental). Required: no.hash
[string]: Hash function to use. Will set Cid version to 1 if used. (experimental). Required: no.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/files/mkdir?arg=<path>&parents=<value>&cid-version=<value>&hash=<value>"
Move files.
arg
[string]: Source file to move. Required: yes.arg
[string]: Destination path for file to be moved to. Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/files/mv?arg=<source>&arg=<dest>"
Read a file from MFS.
arg
[string]: Path to file to be read. Required: yes.offset
[int64]: Byte offset to begin reading from. Required: no.count
[int64]: Maximum number of bytes to read. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/files/read?arg=<path>&offset=<value>&count=<value>"
Remove a file from MFS.
arg
[string]: File to remove. Required: yes.recursive
[bool]: Recursively remove directories. Required: no.force
[bool]: Forcibly remove target at path; implies -r for directories. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/files/rm?arg=<path>&recursive=<value>&force=<value>"
Display file status.
arg
[string]: Path to node to stat. Required: yes.format
[string]: Print statistics in given format. Allowed tokens: <hash> <size> <cumulsize> <type> <childs> and optional <mode> <mode-octal> <mtime> <mtime-secs> <mtime-nsecs>.Conflicts with other format options. Default: <hash> Size: <size> CumulativeSize: <cumulsize> ChildBlocks: <childs> Type: <type> Mode: <mode> (<mode-octal>) Mtime: <mtime>. Default:<hash> Size: <size> CumulativeSize: <cumulsize> ChildBlocks: <childs> Type: <type> Mode: <mode> (<mode-octal>) Mtime: <mtime>
. Required: no.hash
[bool]: Print only hash. Implies '--format=<hash>'. Conflicts with other format options. Required: no.size
[bool]: Print only size. Implies '--format=<cumulsize>'. Conflicts with other format options. Required: no.with-local
[bool]: Compute the amount of the dag that is local, and if possible the total size. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Blocks": "<int>",
"CumulativeSize": "<uint64>",
"Hash": "<string>",
"Local": "<bool>",
"Mode": "<uint32>",
"Mtime": "<int64>",
"MtimeNsecs": "<int>",
"Size": "<uint64>",
"SizeLocal": "<uint64>",
"Type": "<string>",
"WithLocality": "<bool>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/files/stat?arg=<path>&format=<hash> Size: <size> CumulativeSize: <cumulsize> ChildBlocks: <childs> Type: <type> Mode: <mode> (<mode-octal>) Mtime: <mtime>&hash=<value>&size=<value>&with-local=<value>"
Append to (modify) a file in MFS.
-
arg
[string]: Path to write to. Required: yes. -
offset
[int64]: Byte offset to begin writing at. Required: no. -
create
[bool]: Create the file if it does not exist. Required: no. -
parents
[bool]: Make parent directories as needed. Required: no. -
truncate
[bool]: Truncate the file to size zero before writing. Required: no. -
count
[int64]: Maximum number of bytes to read. Required: no. -
raw-leaves
[bool]: Use raw blocks for newly created leaf nodes. (experimental). Required: no. -
cid-version
[int]: Cid version to use. (experimental). Required: no. -
hash
[string]: Hash function to use. Will set Cid version to 1 if used. (experimental). Required: no.
Argument 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'.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/files/write?arg=<path>&offset=<value>&create=<value>&parents=<value>&truncate=<value>&count=<value>&raw-leaves=<value>&cid-version=<value>&hash=<value>"
List blocks that are both in the filestore and standard block storage.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Err": "<string>",
"Ref": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/filestore/dups"
List objects in filestore.
arg
[string]: Cid of objects to list. Required: no.file-order
[bool]: sort the results based on the path of the backing file. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"ErrorMsg": "<string>",
"FilePath": "<string>",
"Key": {
"/": "<cid-string>"
},
"Offset": "<uint64>",
"Size": "<uint64>",
"Status": "<int32>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/filestore/ls?arg=<obj>&file-order=<value>"
Verify objects in filestore.
arg
[string]: Cid of objects to verify. Required: no.file-order
[bool]: verify the objects based on the order of the backing file. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"ErrorMsg": "<string>",
"FilePath": "<string>",
"Key": {
"/": "<cid-string>"
},
"Offset": "<uint64>",
"Size": "<uint64>",
"Status": "<int32>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/filestore/verify?arg=<obj>&file-order=<value>"
Download IPFS objects.
arg
[string]: The path to the IPFS object(s) to be outputted. Required: yes.output
[string]: The path where the output should be stored. Required: no.archive
[bool]: Output a TAR archive. Required: no.compress
[bool]: Compress the output with GZIP compression. Required: no.compression-level
[int]: The level of compression (1-9). Required: no.progress
[bool]: Stream progress data. Default:true
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/get?arg=<ipfs-path>&output=<value>&archive=<value>&compress=<value>&compression-level=<value>&progress=true"
Show IPFS node id info.
arg
[string]: Peer.ID of node to look up. Required: no.format
[string]: Optional output format. Required: no.peerid-base
[string]: Encoding used for peer IDs: Can either be a multibase encoded CID or a base58btc encoded multihash. Takes {b58mh|base36|k|base32|b...}. Default:b58mh
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Addresses": [
"<string>"
],
"AgentVersion": "<string>",
"ID": "<string>",
"Protocols": [
"<string>"
],
"PublicKey": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/id?arg=<peerid>&format=<value>&peerid-base=b58mh"
Create a new keypair
arg
[string]: name of key to create Required: yes.type
[string]: type of the key to create: rsa, ed25519. Default:ed25519
. Required: no.size
[int]: size of the key to generate. Required: no.ipns-base
[string]: Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash. Takes {b58mh|base36|k|base32|b...}. Default:base36
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Id": "<string>",
"Name": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/key/gen?arg=<name>&type=ed25519&size=<value>&ipns-base=base36"
Import a key and prints imported key id
-
arg
[string]: name to associate with key in keychain Required: yes. -
ipns-base
[string]: Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash. Takes {b58mh|base36|k|base32|b...}. Default:base36
. Required: no. -
format
[string]: The format of the private key to import, libp2p-protobuf-cleartext or pem-pkcs8-cleartext. Default:libp2p-protobuf-cleartext
. Required: no. -
allow-any-key-type
[bool]: Allow importing any key type. Default:false
. Required: no.
Argument key
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'.
On success, the call to this endpoint will return with 200 and the following body:
{
"Id": "<string>",
"Name": "<string>"
}
curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/key/import?arg=<name>&ipns-base=base36&format=libp2p-protobuf-cleartext&allow-any-key-type=false"
List all local keypairs.
l
[bool]: Show extra information about keys. Required: no.ipns-base
[string]: Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash. Takes {b58mh|base36|k|base32|b...}. Default:base36
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Keys": [
{
"Id": "<string>",
"Name": "<string>"
}
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/key/list?l=<value>&ipns-base=base36"
Rename a keypair.
arg
[string]: name of key to rename Required: yes.arg
[string]: new name of the key Required: yes.force
[bool]: Allow to overwrite an existing key. Required: no.ipns-base
[string]: Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash. Takes {b58mh|base36|k|base32|b...}. Default:base36
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Id": "<string>",
"Now": "<string>",
"Overwrite": "<bool>",
"Was": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/key/rename?arg=<name>&arg=<newName>&force=<value>&ipns-base=base36"
Remove a keypair.
arg
[string]: names of keys to remove Required: yes.l
[bool]: Show extra information about keys. Required: no.ipns-base
[string]: Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash. Takes {b58mh|base36|k|base32|b...}. Default:base36
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Keys": [
{
"Id": "<string>",
"Name": "<string>"
}
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/key/rm?arg=<name>&l=<value>&ipns-base=base36"
Change the logging level.
arg
[string]: The subsystem logging identifier. Use 'all' for all subsystems. Required: yes.arg
[string]: The log level, with 'debug' the most verbose and 'fatal' the least verbose. One of: debug, info, warn, error, dpanic, panic, fatal. Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"Message": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/log/level?arg=<subsystem>&arg=<level>"
List the logging subsystems.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Strings": [
"<string>"
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/log/ls"
List directory contents for Unix filesystem objects.
arg
[string]: The path to the IPFS object(s) to list links from. Required: yes.headers
[bool]: Print table headers (Hash, Size, Name). Required: no.resolve-type
[bool]: Resolve linked objects to find out their types. Default:true
. Required: no.size
[bool]: Resolve linked objects to find out their file size. Default:true
. Required: no.stream
[bool]: Enable experimental streaming of directory entries as they are traversed. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Objects": [
{
"Hash": "<string>",
"Links": [
{
"Hash": "<string>",
"ModTime": "<timestamp>",
"Mode": "<uint32>",
"Name": "<string>",
"Size": "<uint64>",
"Target": "<string>",
"Type": "<int32>"
}
]
}
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/ls?arg=<ipfs-path>&headers=<value>&resolve-type=true&size=true&stream=<value>"
Decode multibase string
Argument encoded_file
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'.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/multibase/decode"
Encode data into multibase string
b
[string]: multibase encoding. Default:base64url
. Required: no.
Argument file
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'.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/multibase/encode?b=base64url"
List available multibase encodings.
prefix
[bool]: also include the single letter prefixes in addition to the code. Required: no.numeric
[bool]: also include numeric codes. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
[
{
"Code": "<int>",
"Name": "<string>"
}
]
curl -X POST "http://127.0.0.1:5001/api/v0/multibase/list?prefix=<value>&numeric=<value>"
Transcode multibase string between bases
b
[string]: multibase encoding. Default:base64url
. Required: no.
Argument encoded_file
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'.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/multibase/transcode?b=base64url"
Publish IPNS names.
arg
[string]: ipfs path of the object to be published. Required: yes.key
[string]: Name of the key to be used or a valid PeerID, as listed by 'ipfs key list -l'. Default:self
. Required: no.resolve
[bool]: Check if the given path can be resolved before publishing. Default:true
. Required: no.lifetime
[string]: Time duration the signed record will be valid for. Accepts durations such as "300s", "1.5h" or "7d2h45m". Default:48h0m0s
. Required: no.ttl
[string]: Time duration hint, akin to --lifetime, indicating how long to cache this record before checking for updates. Default:1h0m0s
. Required: no.quieter
[bool]: Write only final IPNS Name encoded as CIDv1 (for use in /ipns content paths). Required: no.v1compat
[bool]: Produce a backward-compatible IPNS Record by including fields for both V1 and V2 signatures. Default:true
. Required: no.allow-offline
[bool]: When --offline, save the IPNS record to the local datastore without broadcasting to the network (instead of failing). Required: no.ipns-base
[string]: Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash. Takes {b58mh|base36|k|base32|b...}. Default:base36
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Name": "<string>",
"Value": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/name/publish?arg=<ipfs-path>&key=self&resolve=true&lifetime=48h0m0s&ttl=1h0m0s&quieter=<value>&v1compat=true&allow-offline=<value>&ipns-base=base36"
Resolve IPNS names.
arg
[string]: The IPNS name to resolve. Defaults to your node's peerID. Required: no.recursive
[bool]: Resolve until the result is not an IPNS name. Default:true
. Required: no.nocache
[bool]: Do not use cached entries. Required: no.dht-record-count
[uint]: Number of records to request for DHT resolution. Default:16
. Required: no.dht-timeout
[string]: Max time to collect values during DHT resolution e.g. "30s". Pass 0 for no timeout. Default:1m0s
. Required: no.stream
[bool]: Stream entries as they are found. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Path": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/name/resolve?arg=<name>&recursive=true&nocache=<value>&dht-record-count=16&dht-timeout=1m0s&stream=<value>"
Pin objects to local storage.
arg
[string]: Path to object(s) to be pinned. Required: yes.recursive
[bool]: Recursively pin the object linked to by the specified object(s). Default:true
. Required: no.name
[string]: An optional name for created pin(s). Required: no.progress
[bool]: Show progress. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Pins": [
"<string>"
],
"Progress": "<int>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/pin/add?arg=<ipfs-path>&recursive=true&name=<value>&progress=<value>"
List objects pinned to local storage.
arg
[string]: Path to object(s) to be listed. Required: no.type
[string]: The type of pinned keys to list. Can be "direct", "indirect", "recursive", or "all". Default:all
. Required: no.quiet
[bool]: Output only the CIDs of pins. Required: no.name
[string]: Limit returned pins to ones with names that contain the value provided (case-sensitive, partial match). Implies --names=true. Required: no.stream
[bool]: Enable streaming of pins as they are discovered. Required: no.names
[bool]: Include pin names in the output (slower, disabled by default). Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"PinLsList": {
"Keys": {
"<string>": {
"Name": "<string>",
"Type": "<string>"
}
}
},
"PinLsObject": {
"Cid": "<string>",
"Name": "<string>",
"Type": "<string>"
}
}
curl -X POST "http://127.0.0.1:5001/api/v0/pin/ls?arg=<ipfs-path>&type=all&quiet=<value>&name=<value>&stream=<value>&names=<value>"
Pin object to remote pinning service.
arg
[string]: CID or Path to be pinned. Required: yes.service
[string]: Name of the remote pinning service to use (mandatory). Required: no.name
[string]: An optional name for the pin. Required: no.background
[bool]: Add to the queue on the remote service and return immediately (does not wait for pinned status). Default:false
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Cid": "<string>",
"Name": "<string>",
"Status": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/pin/remote/add?arg=<ipfs-path>&service=<value>&name=<value>&background=false"
List objects pinned to remote pinning service.
service
[string]: Name of the remote pinning service to use (mandatory). Required: no.name
[string]: Return pins with names that contain the value provided (case-sensitive, exact match). Required: no.cid
[array]: Return pins for the specified CIDs (comma-separated). Required: no.status
[array]: Return pins with the specified statuses (queued,pinning,pinned,failed). Default:[pinned]
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Cid": "<string>",
"Name": "<string>",
"Status": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/pin/remote/ls?service=<value>&name=<value>&cid=<value>&status=[pinned]"
Remove pins from remote pinning service.
service
[string]: Name of the remote pinning service to use (mandatory). Required: no.name
[string]: Remove pins with names that contain provided value (case-sensitive, exact match). Required: no.cid
[array]: Remove pins for the specified CIDs. Required: no.status
[array]: Remove pins with the specified statuses (queued,pinning,pinned,failed). Default:[pinned]
. Required: no.force
[bool]: Allow removal of multiple pins matching the query without additional confirmation. Default:false
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/pin/remote/rm?service=<value>&name=<value>&cid=<value>&status=[pinned]&force=false"
Add remote pinning service.
arg
[string]: Service name. Required: yes.arg
[string]: Service endpoint. Required: yes.arg
[string]: Service key. Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/pin/remote/service/add?arg=<service>&arg=<endpoint>&arg=<key>"
List remote pinning services.
stat
[bool]: Try to fetch and display current pin count on remote service (queued/pinning/pinned/failed). Default:false
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"RemoteServices": [
{
"ApiEndpoint": "<string>",
"Service": "<string>",
"Stat": {
"PinCount": {
"Failed": "<int>",
"Pinned": "<int>",
"Pinning": "<int>",
"Queued": "<int>"
},
"Status": "<string>"
}
}
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/pin/remote/service/ls?stat=false"
Remove remote pinning service.
arg
[string]: Name of remote pinning service to remove. Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/pin/remote/service/rm?arg=<service>"
Remove object from pin-list.
arg
[string]: Path to object(s) to be unpinned. Required: yes.recursive
[bool]: Recursively unpin the object linked to by the specified object(s). Default:true
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Pins": [
"<string>"
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/pin/rm?arg=<ipfs-path>&recursive=true"
Update a recursive pin.
arg
[string]: Path to old object. Required: yes.arg
[string]: Path to a new object to be pinned. Required: yes.unpin
[bool]: Remove the old pin. Default:true
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Pins": [
"<string>"
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/pin/update?arg=<from-path>&arg=<to-path>&unpin=true"
Verify that recursive pins are complete.
verbose
[bool]: Also write the hashes of non-broken pins. Required: no.quiet
[bool]: Write just hashes of broken pins. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Cid": "<string>",
"Err": "<string>",
"PinStatus": {
"BadNodes": [
{
"Cid": "<string>",
"Err": "<string>"
}
],
"Ok": "<bool>"
}
}
curl -X POST "http://127.0.0.1:5001/api/v0/pin/verify?verbose=<value>&quiet=<value>"
Send echo request packets to IPFS hosts.
arg
[string]: ID of peer to be pinged. Required: yes.count
[int]: Number of ping messages to send. Default:10
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Success": "<bool>",
"Text": "<string>",
"Time": "<duration-ns>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/ping?arg=<peer ID>&count=10"
List links (references) from an object.
arg
[string]: Path to the object(s) to list refs from. Required: yes.format
[string]: Emit edges with given format. Available tokens: <src> <dst> <linkname>. Default: <dst>. Default:<dst>
. Required: no.edges
[bool]: Emit edge format:<from> -> <to>
. Required: no.unique
[bool]: Omit duplicate refs from output. Required: no.recursive
[bool]: Recursively list links of child nodes. Required: no.max-depth
[int]: Only for recursive refs, limits fetch and listing to the given depth. Default:-1
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Err": "<string>",
"Ref": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/refs?arg=<ipfs-path>&format=<dst>&edges=<value>&unique=<value>&recursive=<value>&max-depth=-1"
List all local references.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Err": "<string>",
"Ref": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/refs/local"
Perform a garbage collection sweep on the repo.
stream-errors
[bool]: Stream errors. Required: no.quiet
[bool]: Write minimal output. Required: no.silent
[bool]: Write no output. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Error": "<string>",
"Key": {
"/": "<cid-string>"
}
}
curl -X POST "http://127.0.0.1:5001/api/v0/repo/gc?stream-errors=<value>&quiet=<value>&silent=<value>"
List all local references.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Err": "<string>",
"Ref": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/repo/ls"
Get stats for the currently used repo.
size-only
[bool]: Only report RepoSize and StorageMax. Required: no.human
[bool]: Print sizes in human readable format (e.g., 1K 234M 2G). Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"NumObjects": "<uint64>",
"RepoPath": "<string>",
"SizeStat": {
"RepoSize": "<uint64>",
"StorageMax": "<uint64>"
},
"Version": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/repo/stat?size-only=<value>&human=<value>"
Verify all blocks in repo are not corrupted.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Msg": "<string>",
"Progress": "<int>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/repo/verify"
Show the repo version.
quiet
[bool]: Write minimal output. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Version": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/repo/version?quiet=<value>"
Resolve the value of names to IPFS.
arg
[string]: The name to resolve. Required: yes.recursive
[bool]: Resolve until the result is an IPFS name. Default:true
. Required: no.dht-record-count
[int]: Number of records to request for DHT resolution. Required: no.dht-timeout
[string]: Max time to collect values during DHT resolution e.g. "30s". Pass 0 for no timeout. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Path": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/resolve?arg=<name>&recursive=true&dht-record-count=<value>&dht-timeout=<value>"
Find the multiaddresses associated with a Peer ID.
arg
[string]: The ID of the peer to search for. Required: yes.verbose
[bool]: Print extra information. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Extra": "<string>",
"ID": "<peer-id>",
"Responses": [
{
"Addrs": [
"<multiaddr-string>"
],
"ID": "peer-id"
}
],
"Type": "<int>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/routing/findpeer?arg=<peerID>&verbose=<value>"
Find peers that can provide a specific value, given a key.
arg
[string]: The key to find providers for. Required: yes.verbose
[bool]: Print extra information. Required: no.num-providers
[int]: The number of providers to find. Default:20
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Extra": "<string>",
"ID": "<peer-id>",
"Responses": [
{
"Addrs": [
"<multiaddr-string>"
],
"ID": "peer-id"
}
],
"Type": "<int>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/routing/findprovs?arg=<key>&verbose=<value>&num-providers=20"
Shut down the IPFS daemon.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/shutdown"
Show some diagnostic information on the bitswap agent.
verbose
[bool]: Print extra information. Required: no.human
[bool]: Print sizes in human readable format (e.g., 1K 234M 2G). Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"BlocksReceived": "<uint64>",
"BlocksSent": "<uint64>",
"DataReceived": "<uint64>",
"DataSent": "<uint64>",
"DupBlksReceived": "<uint64>",
"DupDataReceived": "<uint64>",
"MessagesReceived": "<uint64>",
"Peers": [
"<string>"
],
"ProvideBufLen": "<int>",
"Wantlist": [
{
"/": "<cid-string>"
}
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/stats/bitswap?verbose=<value>&human=<value>"
Print IPFS bandwidth information.
-
peer
[string]: Specify a peer to print bandwidth for. Required: no. -
proto
[string]: Specify a protocol to print bandwidth for. Required: no. -
poll
[bool]: Print bandwidth at an interval. Required: no. -
interval
[string]: Time interval to wait between updating output, if 'poll' is true.This accepts durations such as "300s", "1.5h" or "2h45m". Valid time units are: "ns", "us" (or "µs"), "ms", "s", "m", "h". Default:
1s
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"RateIn": "<float64>",
"RateOut": "<float64>",
"TotalIn": "<int64>",
"TotalOut": "<int64>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/stats/bw?peer=<value>&proto=<value>&poll=<value>&interval=1s"
Returns statistics about the node's DHT(s).
arg
[string]: The DHT whose table should be listed (wanserver, lanserver, wan, lan). wan and lan refer to client routing tables. When using the experimental DHT client only WAN is supported. Defaults to wan and lan. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Buckets": [
{
"LastRefresh": "<string>",
"Peers": [
{
"AgentVersion": "<string>",
"Connected": "<bool>",
"ID": "<string>",
"LastQueriedAt": "<string>",
"LastUsefulAt": "<string>"
}
]
}
],
"Name": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/stats/dht?arg=<dht>"
Returns statistics about the node's (re)provider system.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"AvgProvideDuration": "<duration-ns>",
"LastReprovideBatchSize": "<uint64>",
"LastReprovideDuration": "<duration-ns>",
"TotalProvides": "<uint64>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/stats/provide"
Get stats for the currently used repo.
size-only
[bool]: Only report RepoSize and StorageMax. Required: no.human
[bool]: Print sizes in human readable format (e.g., 1K 234M 2G). Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"NumObjects": "<uint64>",
"RepoPath": "<string>",
"SizeStat": {
"RepoSize": "<uint64>",
"StorageMax": "<uint64>"
},
"Version": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/stats/repo?size-only=<value>&human=<value>"
List known addresses. Useful for debugging.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Addrs": {
"<string>": [
"<string>"
]
}
}
curl -X POST "http://127.0.0.1:5001/api/v0/swarm/addrs"
List interface listening addresses.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Strings": [
"<string>"
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/swarm/addrs/listen"
List local addresses.
id
[bool]: Show peer ID in addresses. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Strings": [
"<string>"
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/swarm/addrs/local?id=<value>"
Open connection to a given peer.
arg
[string]: Address of peer to connect to. Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"Strings": [
"<string>"
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/swarm/connect?arg=<address>"
Close connection to a given address.
arg
[string]: Address of peer to disconnect from. Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"Strings": [
"<string>"
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/swarm/disconnect?arg=<address>"
Manipulate address filters.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Strings": [
"<string>"
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/swarm/filters"
Add an address filter.
arg
[string]: Multiaddr to filter. Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"Strings": [
"<string>"
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/swarm/filters/add?arg=<address>"
Remove an address filter.
arg
[string]: Multiaddr filter to remove. Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"Strings": [
"<string>"
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/swarm/filters/rm?arg=<address>"
Add peers into the peering subsystem.
arg
[string]: address of peer to add into the peering subsystem Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"ID": "<peer-id>",
"Status": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/swarm/peering/add?arg=<address>"
List peers registered in the peering subsystem.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Peers": [
{
"Addrs": [
"<multiaddr-string>"
],
"ID": "peer-id"
}
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/swarm/peering/ls"
Remove a peer from the peering subsystem.
arg
[string]: ID of peer to remove from the peering subsystem Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"ID": "<peer-id>",
"Status": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/swarm/peering/rm?arg=<ID>"
List peers with open connections.
verbose
[bool]: display all extra information. Required: no.streams
[bool]: Also list information about open streams for each peer. Required: no.latency
[bool]: Also list information about latency to each peer. Required: no.direction
[bool]: Also list information about the direction of connection. Required: no.identify
[bool]: Also list information about peers identify. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Peers": [
{
"Addr": "<string>",
"Direction": "<int>",
"Identify": {
"Addresses": [
"<string>"
],
"AgentVersion": "<string>",
"ID": "<string>",
"Protocols": [
"<string>"
],
"PublicKey": "<string>"
},
"Latency": "<string>",
"Muxer": "<string>",
"Peer": "<string>",
"Streams": [
{
"Protocol": "<string>"
}
]
}
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/swarm/peers?verbose=<value>&streams=<value>&latency=<value>&direction=<value>&identify=<value>"
Show IPFS version information.
number
[bool]: Only show the version number. Required: no.commit
[bool]: Show the commit hash. Required: no.repo
[bool]: Show repo version. Required: no.all
[bool]: Show all version information. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Commit": "<string>",
"Golang": "<string>",
"Repo": "<string>",
"System": "<string>",
"Version": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/version?number=<value>&commit=<value>&repo=<value>&all=<value>"
Checks Kubo version against connected peers.
min-percent
[int]: Percentage (1-100) of sampled peers with the new Kubo version needed to trigger an update warning. Default:5
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"GreatestVersion": "<string>",
"PeersSampled": "<int>",
"RunningVersion": "<string>",
"UpdateAvailable": "<bool>",
"WithGreaterVersion": "<int>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/version/check?min-percent=5"
Shows information about dependencies used for build.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Path": "<string>",
"ReplacedBy": "<string>",
"Sum": "<string>",
"Version": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/version/deps"
Below commands are experimental and should be used with care. The API may change in future releases.
::: warning EXPERIMENTAL
This command is experimental.
:::
Change optional POSIX mode permissions
arg
[string]: Mode to apply to node (numeric notation) Required: yes.arg
[string]: Path to apply mode Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/files/chmod?arg=<mode>&arg=<path>"
::: warning EXPERIMENTAL
This command is experimental.
:::
Set or change optional POSIX modification times.
arg
[string]: Path of target to update. Required: yes.mtime
[int64]: Modification time in seconds before or since the Unix Epoch to apply to created UnixFS entries. Required: no.mtime-nsecs
[uint]: Modification time fraction in nanoseconds. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/files/touch?arg=<path>&mtime=<value>&mtime-nsecs=<value>"
::: warning EXPERIMENTAL
This command is experimental.
:::
Generates a signature for the given data with a specified key. Useful for proving the key ownership.
key
[string]: The name of the key to use for signing. Required: no.ipns-base
[string]: Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash. Takes {b58mh|base36|k|base32|b...}. Default:base36
. Required: no.
Argument 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'.
On success, the call to this endpoint will return with 200 and the following body:
{
"Key": {
"Id": "<string>",
"Name": "<string>"
},
"Signature": "<string>"
}
curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/key/sign?key=<value>&ipns-base=base36"
::: warning EXPERIMENTAL
This command is experimental.
:::
Verify that the given data and signature match.
key
[string]: The name of the key to use for signing. Required: no.signature
[string]: Multibase-encoded signature to verify. Required: no.ipns-base
[string]: Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash. Takes {b58mh|base36|k|base32|b...}. Default:base36
. Required: no.
Argument 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'.
On success, the call to this endpoint will return with 200 and the following body:
{
"Key": {
"Id": "<string>",
"Name": "<string>"
},
"SignatureValid": "<bool>"
}
curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/key/verify?key=<value>&signature=<value>&ipns-base=base36"
::: warning EXPERIMENTAL
This command is experimental.
:::
Read the event log.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/log/tail"
::: warning EXPERIMENTAL
This command is experimental.
:::
Mounts IPFS to the filesystem (read-only).
ipfs-path
[string]: The path where IPFS should be mounted. Required: no.ipns-path
[string]: The path where IPNS should be mounted. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"FuseAllowOther": "<bool>",
"IPFS": "<string>",
"IPNS": "<string>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/mount?ipfs-path=<value>&ipns-path=<value>"
::: warning EXPERIMENTAL
This command is experimental.
:::
Inspects an IPNS Record
verify
[string]: CID of the public IPNS key to validate against. Required: no.dump
[bool]: Include a full hex dump of the raw Protobuf record. Default:true
. Required: no.
Argument record
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'.
On success, the call to this endpoint will return with 200 and the following body:
{
"Entry": {
"Sequence": "<uint64>",
"TTL": "<duration-ns>",
"Validity": "<timestamp>",
"ValidityType": "<int64>",
"Value": "<string>"
},
"HexDump": "<string>",
"PbSize": "<int>",
"SignatureType": "<string>",
"Validation": {
"Name": "<string>",
"Reason": "<string>",
"Valid": "<bool>"
}
}
curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/name/inspect?verify=<value>&dump=true"
::: warning EXPERIMENTAL
This command is experimental.
:::
Cancel a name subscription.
arg
[string]: Name to cancel the subscription for. Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"Canceled": "<bool>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/name/pubsub/cancel?arg=<name>"
::: warning EXPERIMENTAL
This command is experimental.
:::
Query the state of IPNS pubsub.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Enabled": "<bool>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/name/pubsub/state"
::: warning EXPERIMENTAL
This command is experimental.
:::
Show current name subscriptions.
ipns-base
[string]: Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash. Takes {b58mh|base36|k|base32|b...}. Default:base36
. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Strings": [
"<string>"
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/name/pubsub/subs?ipns-base=base36"
::: warning EXPERIMENTAL
This command is experimental.
:::
Stop listening for new connections to forward.
all
[bool]: Close all listeners. Required: no.protocol
[string]: Match protocol name. Required: no.listen-address
[string]: Match listen address. Required: no.target-address
[string]: Match target address. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
"<int>"
curl -X POST "http://127.0.0.1:5001/api/v0/p2p/close?all=<value>&protocol=<value>&listen-address=<value>&target-address=<value>"
::: warning EXPERIMENTAL
This command is experimental.
:::
Forward connections to libp2p service.
arg
[string]: Protocol name. Required: yes.arg
[string]: Listening endpoint. Required: yes.arg
[string]: Target endpoint. Required: yes.allow-custom-protocol
[bool]: Don't require /x/ prefix. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/p2p/forward?arg=<protocol>&arg=<listen-address>&arg=<target-address>&allow-custom-protocol=<value>"
::: warning EXPERIMENTAL
This command is experimental.
:::
Create libp2p service.
arg
[string]: Protocol name. Required: yes.arg
[string]: Target endpoint. Required: yes.allow-custom-protocol
[bool]: Don't require /x/ prefix. Required: no.report-peer-id
[bool]: Send remote base58 peerid to target when a new connection is established. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/p2p/listen?arg=<protocol>&arg=<target-address>&allow-custom-protocol=<value>&report-peer-id=<value>"
::: warning EXPERIMENTAL
This command is experimental.
:::
List active p2p listeners.
headers
[bool]: Print table headers (Protocol, Listen, Target). Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Listeners": [
{
"ListenAddress": "<string>",
"Protocol": "<string>",
"TargetAddress": "<string>"
}
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/p2p/ls?headers=<value>"
::: warning EXPERIMENTAL
This command is experimental.
:::
Close active p2p stream.
arg
[string]: Stream identifier Required: no.all
[bool]: Close all streams. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/p2p/stream/close?arg=<id>&all=<value>"
::: warning EXPERIMENTAL
This command is experimental.
:::
List active p2p streams.
headers
[bool]: Print table headers (ID, Protocol, Local, Remote). Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Streams": [
{
"HandlerID": "<string>",
"OriginAddress": "<string>",
"Protocol": "<string>",
"TargetAddress": "<string>"
}
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/p2p/stream/ls?headers=<value>"
::: warning EXPERIMENTAL
This command is experimental.
:::
Given a key, query the routing system for its best value.
arg
[string]: The key to find a value for. Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"Extra": "<string>",
"ID": "<peer-id>",
"Responses": [
{
"Addrs": [
"<multiaddr-string>"
],
"ID": "peer-id"
}
],
"Type": "<int>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/routing/get?arg=<key>"
::: warning EXPERIMENTAL
This command is experimental.
:::
Announce to the network that you are providing given values.
arg
[string]: The key[s] to send provide records for. Required: yes.verbose
[bool]: Print extra information. Required: no.recursive
[bool]: Recursively provide entire graph. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Extra": "<string>",
"ID": "<peer-id>",
"Responses": [
{
"Addrs": [
"<multiaddr-string>"
],
"ID": "peer-id"
}
],
"Type": "<int>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/routing/provide?arg=<key>&verbose=<value>&recursive=<value>"
::: warning EXPERIMENTAL
This command is experimental.
:::
Write a key/value pair to the routing system.
-
arg
[string]: The key to store the value at. Required: yes. -
allow-offline
[bool]: When offline, save the IPNS record to the local datastore without broadcasting to the network instead of simply failing. Required: no.
Argument value-file
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'.
On success, the call to this endpoint will return with 200 and the following body:
{
"Extra": "<string>",
"ID": "<peer-id>",
"Responses": [
{
"Addrs": [
"<multiaddr-string>"
],
"ID": "peer-id"
}
],
"Type": "<int>"
}
curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/routing/put?arg=<key>&allow-offline=<value>"
::: warning EXPERIMENTAL
This command is experimental.
:::
Get a summary of all resources accounted for by the libp2p Resource Manager.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
"<object>"
curl -X POST "http://127.0.0.1:5001/api/v0/swarm/resources"
Below commands are deprecated and will be removed in the future.
::: warning DEPRECATED
This command is deprecated.
:::
Find the closest Peer IDs to a given Peer ID by querying the DHT.
arg
[string]: The peerID to run the query against. Required: yes.verbose
[bool]: Print extra information. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Extra": "<string>",
"ID": "<peer-id>",
"Responses": [
{
"Addrs": [
"<multiaddr-string>"
],
"ID": "peer-id"
}
],
"Type": "<int>"
}
curl -X POST "http://127.0.0.1:5001/api/v0/dht/query?arg=<peerID>&verbose=<value>"
::: warning DEPRECATED
This command is deprecated.
:::
Display the diff between two IPFS objects.
arg
[string]: Object to diff against. Required: yes.arg
[string]: Object to diff. Required: yes.verbose
[bool]: Print extra information. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Changes": [
{
"After": {
"/": "<cid-string>"
},
"Before": {
"/": "<cid-string>"
},
"Path": "<string>",
"Type": "<int>"
}
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/object/diff?arg=<obj_a>&arg=<obj_b>&verbose=<value>"
::: warning DEPRECATED
This command is deprecated.
:::
Deprecated way to add a link to a given dag-pb.
arg
[string]: The hash of the node to modify. Required: yes.arg
[string]: Name of link to create. Required: yes.arg
[string]: IPFS object to add link to. Required: yes.create
[bool]: Create intermediary nodes. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Hash": "<string>",
"Links": [
{
"Hash": "<string>",
"Name": "<string>",
"Size": "<uint64>"
}
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/object/patch/add-link?arg=<root>&arg=<name>&arg=<ref>&create=<value>"
::: warning DEPRECATED
This command is deprecated.
:::
Deprecated way to remove a link from dag-pb object.
arg
[string]: The hash of the node to modify. Required: yes.arg
[string]: Name of the link to remove. Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"Hash": "<string>",
"Links": [
{
"Hash": "<string>",
"Name": "<string>",
"Size": "<uint64>"
}
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/object/patch/rm-link?arg=<root>&arg=<name>"
::: warning DEPRECATED
This command is deprecated.
:::
List subscribed topics by name.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Strings": [
"<string>"
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/pubsub/ls"
::: warning DEPRECATED
This command is deprecated.
:::
List peers we are currently pubsubbing with.
arg
[string]: Topic to list connected peers of. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Strings": [
"<string>"
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/pubsub/peers?arg=<topic>"
::: warning DEPRECATED
This command is deprecated.
:::
Publish data to a given pubsub topic.
arg
[string]: Topic to publish to (multibase encoded when sent over HTTP RPC). Required: yes.
Argument 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'.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/pubsub/pub?arg=<topic>"
::: warning DEPRECATED
This command is deprecated.
:::
Subscribe to messages on a given topic.
arg
[string]: Name of topic to subscribe to (multibase encoded when sent over HTTP RPC). Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"data": "<string>",
"from": "<string>",
"seqno": "<string>",
"topicIDs": [
"<string>"
]
}
curl -X POST "http://127.0.0.1:5001/api/v0/pubsub/sub?arg=<topic>"
Below commands were removed, listing them here only for documentation purposes.
::: warning REMOVED
This command is removed.
:::
Removed, use 'ipfs routing' instead.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/dht/findpeer"
::: warning REMOVED
This command is removed.
:::
Removed, use 'ipfs routing' instead.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/dht/findprovs"
::: warning REMOVED
This command is removed.
:::
Removed, use 'ipfs routing' instead.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/dht/get"
::: warning REMOVED
This command is removed.
:::
Removed, use 'ipfs routing' instead.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/dht/provide"
::: warning REMOVED
This command is removed.
:::
Removed, use 'ipfs routing' instead.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/dht/put"
::: warning REMOVED
This command is removed.
:::
Removed, use 'ipfs dag' or 'ipfs files' instead.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/object/data"
::: warning REMOVED
This command is removed.
:::
Removed, use 'ipfs dag' or 'ipfs files' instead.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/object/get"
::: warning REMOVED
This command is removed.
:::
Removed, use 'ipfs dag' or 'ipfs files' instead.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/object/links"
::: warning REMOVED
This command is removed.
:::
Removed, use 'ipfs dag' or 'ipfs files' instead.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/object/new"
::: warning REMOVED
This command is removed.
:::
Removed, use 'ipfs dag' or 'ipfs files' instead.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/object/patch/append-data"
::: warning REMOVED
This command is removed.
:::
Removed, use 'ipfs dag' or 'ipfs files' instead.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/object/patch/set-data"
::: warning REMOVED
This command is removed.
:::
Removed, use 'ipfs dag' or 'ipfs files' instead.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/object/put"
::: warning REMOVED
This command is removed.
:::
Removed, use 'ipfs dag' or 'ipfs files' instead.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl -X POST "http://127.0.0.1:5001/api/v0/object/stat"