CINXE.COM

Kubo RPC API | IPFS Docs

<!doctype html><html lang="en-US"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <title>Kubo RPC API | IPFS Docs</title> <meta name="generator" content="VuePress 1.9.10"> <link rel="apple-touch-icon" sizes="180x180" href="../../../apple-touch-icon.png"> <link rel="icon" type="image/png" sizes="32x32" href="../../../favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="../../../favicon-16x16.png"> <link rel="manifest" href="../../../manifest.json"> <link rel="mask-icon" href="../../../safari-pinned-tab.svg" color="#3a0839"> <link rel="shortcut icon" href="../../../favicon.ico"> <script defer data-domain="docs.ipfs.tech" src="https://plausible.io/js/plausible.js"></script><link rel="canonical" href="https://docs.ipfs.tech/reference/kubo/rpc/"> <meta name="description" content="RPC API v0 reference for Kubo IPFS daemon."> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="msapplication-TileColor" content="#3a0839"> <meta name="msapplication-config" content="/browserconfig.xml"> <meta name="theme-color" content="#5bbad5"> <link rel="preload" href="../../../assets/css/0.styles.bf49ba33.css" as="style"><link rel="preload" href="../../../assets/js/app.6b839e87.js" as="script"><link rel="preload" href="../../../assets/js/2.4d957bfb.js" as="script"><link rel="preload" href="../../../assets/js/1.e5bd4a62.js" as="script"><link rel="preload" href="../../../assets/js/136.38608eea.js" as="script"><link rel="prefetch" href="../../../assets/js/10.36ecc450.js"><link rel="prefetch" href="../../../assets/js/100.a38cd13d.js"><link rel="prefetch" href="../../../assets/js/101.5aa4425e.js"><link rel="prefetch" href="../../../assets/js/102.fa4df058.js"><link rel="prefetch" href="../../../assets/js/103.04dbaf8a.js"><link rel="prefetch" href="../../../assets/js/104.a208d6b7.js"><link rel="prefetch" href="../../../assets/js/105.ec9a65e5.js"><link rel="prefetch" href="../../../assets/js/106.6a28f435.js"><link rel="prefetch" href="../../../assets/js/107.d6c4e359.js"><link rel="prefetch" href="../../../assets/js/108.388f93a6.js"><link rel="prefetch" href="../../../assets/js/109.83a5dece.js"><link rel="prefetch" href="../../../assets/js/110.73419c24.js"><link rel="prefetch" href="../../../assets/js/111.705fb795.js"><link rel="prefetch" href="../../../assets/js/112.f39e84e7.js"><link rel="prefetch" href="../../../assets/js/113.c88c1c95.js"><link rel="prefetch" href="../../../assets/js/114.8adec33d.js"><link rel="prefetch" href="../../../assets/js/115.38c26e29.js"><link rel="prefetch" href="../../../assets/js/116.dc760fa9.js"><link rel="prefetch" href="../../../assets/js/117.8c64f271.js"><link rel="prefetch" href="../../../assets/js/118.b64a765e.js"><link rel="prefetch" href="../../../assets/js/119.ce7ce61d.js"><link rel="prefetch" href="../../../assets/js/120.cdbd63ae.js"><link rel="prefetch" href="../../../assets/js/121.7694e9d3.js"><link rel="prefetch" href="../../../assets/js/122.4d483666.js"><link rel="prefetch" href="../../../assets/js/123.b07e8708.js"><link rel="prefetch" href="../../../assets/js/124.8f825397.js"><link rel="prefetch" href="../../../assets/js/125.5aeb6a14.js"><link rel="prefetch" href="../../../assets/js/126.d123a8d0.js"><link rel="prefetch" href="../../../assets/js/127.304f7d06.js"><link rel="prefetch" href="../../../assets/js/128.2ca9ab9f.js"><link rel="prefetch" href="../../../assets/js/129.aed9dd42.js"><link rel="prefetch" href="../../../assets/js/13.ff5fc08a.js"><link rel="prefetch" href="../../../assets/js/130.d1e427aa.js"><link rel="prefetch" href="../../../assets/js/131.e8acd661.js"><link rel="prefetch" href="../../../assets/js/132.d2cde300.js"><link rel="prefetch" href="../../../assets/js/133.94a549e1.js"><link rel="prefetch" href="../../../assets/js/134.f37d898f.js"><link rel="prefetch" href="../../../assets/js/135.5da45cdc.js"><link rel="prefetch" href="../../../assets/js/137.7a8852ed.js"><link rel="prefetch" href="../../../assets/js/14.c7cbb382.js"><link rel="prefetch" href="../../../assets/js/15.55139b89.js"><link rel="prefetch" href="../../../assets/js/16.9f3c07a7.js"><link rel="prefetch" href="../../../assets/js/17.72d686ed.js"><link rel="prefetch" href="../../../assets/js/18.1c6047e9.js"><link rel="prefetch" href="../../../assets/js/19.9f7dcea5.js"><link rel="prefetch" href="../../../assets/js/20.0236f27b.js"><link rel="prefetch" href="../../../assets/js/21.7a5deced.js"><link rel="prefetch" href="../../../assets/js/22.eee7cfec.js"><link rel="prefetch" href="../../../assets/js/23.b941d2e9.js"><link rel="prefetch" href="../../../assets/js/24.e201aca8.js"><link rel="prefetch" href="../../../assets/js/25.05cde63b.js"><link rel="prefetch" href="../../../assets/js/26.489f6ddf.js"><link rel="prefetch" href="../../../assets/js/27.50f69b62.js"><link rel="prefetch" href="../../../assets/js/28.7b582c33.js"><link rel="prefetch" href="../../../assets/js/29.0cd0f0e1.js"><link rel="prefetch" href="../../../assets/js/3.d4fbab88.js"><link rel="prefetch" href="../../../assets/js/30.286220ec.js"><link rel="prefetch" href="../../../assets/js/31.30f2a16d.js"><link rel="prefetch" href="../../../assets/js/32.b6a7bac9.js"><link rel="prefetch" href="../../../assets/js/33.8fbdd44a.js"><link rel="prefetch" href="../../../assets/js/34.29e175d5.js"><link rel="prefetch" href="../../../assets/js/35.f911631c.js"><link rel="prefetch" href="../../../assets/js/36.58457e61.js"><link rel="prefetch" href="../../../assets/js/37.3b2984fb.js"><link rel="prefetch" href="../../../assets/js/38.7f4e507a.js"><link rel="prefetch" href="../../../assets/js/39.f716febf.js"><link rel="prefetch" href="../../../assets/js/4.534c1876.js"><link rel="prefetch" href="../../../assets/js/40.311063cb.js"><link rel="prefetch" href="../../../assets/js/41.1dc252ff.js"><link rel="prefetch" href="../../../assets/js/42.778ef103.js"><link rel="prefetch" href="../../../assets/js/43.1dde03b0.js"><link rel="prefetch" href="../../../assets/js/44.0857a0d8.js"><link rel="prefetch" href="../../../assets/js/45.8f4bbe78.js"><link rel="prefetch" href="../../../assets/js/46.b1e08511.js"><link rel="prefetch" href="../../../assets/js/47.c9f64738.js"><link rel="prefetch" href="../../../assets/js/48.f507e042.js"><link rel="prefetch" href="../../../assets/js/49.7c941e1a.js"><link rel="prefetch" href="../../../assets/js/5.3a9152c4.js"><link rel="prefetch" href="../../../assets/js/50.bce5c239.js"><link rel="prefetch" href="../../../assets/js/51.cf2b6662.js"><link rel="prefetch" href="../../../assets/js/52.d2bf78ee.js"><link rel="prefetch" href="../../../assets/js/53.fd480845.js"><link rel="prefetch" href="../../../assets/js/54.c30e799f.js"><link rel="prefetch" href="../../../assets/js/55.a95d9aa6.js"><link rel="prefetch" href="../../../assets/js/56.f73731e0.js"><link rel="prefetch" href="../../../assets/js/57.425eef27.js"><link rel="prefetch" href="../../../assets/js/58.c970f341.js"><link rel="prefetch" href="../../../assets/js/59.d04ec4d0.js"><link rel="prefetch" href="../../../assets/js/6.af8ab9f3.js"><link rel="prefetch" href="../../../assets/js/60.04f32979.js"><link rel="prefetch" href="../../../assets/js/61.1745576b.js"><link rel="prefetch" href="../../../assets/js/62.1b998b1c.js"><link rel="prefetch" href="../../../assets/js/63.a5a142b4.js"><link rel="prefetch" href="../../../assets/js/64.b64d5e75.js"><link rel="prefetch" href="../../../assets/js/65.e55f2d17.js"><link rel="prefetch" href="../../../assets/js/66.2b933661.js"><link rel="prefetch" href="../../../assets/js/67.b4473f7b.js"><link rel="prefetch" href="../../../assets/js/68.188621a5.js"><link rel="prefetch" href="../../../assets/js/69.5ffca16a.js"><link rel="prefetch" href="../../../assets/js/7.56ce43bc.js"><link rel="prefetch" href="../../../assets/js/70.80ee8502.js"><link rel="prefetch" href="../../../assets/js/71.293690cb.js"><link rel="prefetch" href="../../../assets/js/72.54cd9ddd.js"><link rel="prefetch" href="../../../assets/js/73.cc6e499e.js"><link rel="prefetch" href="../../../assets/js/74.d9e294b2.js"><link rel="prefetch" href="../../../assets/js/75.f9484389.js"><link rel="prefetch" href="../../../assets/js/76.2d9f4320.js"><link rel="prefetch" href="../../../assets/js/77.809fe4a1.js"><link rel="prefetch" href="../../../assets/js/78.df6acbd4.js"><link rel="prefetch" href="../../../assets/js/79.ebba4d96.js"><link rel="prefetch" href="../../../assets/js/8.ae30cd98.js"><link rel="prefetch" href="../../../assets/js/80.eb3529e9.js"><link rel="prefetch" href="../../../assets/js/81.f891f703.js"><link rel="prefetch" href="../../../assets/js/82.35be2ecb.js"><link rel="prefetch" href="../../../assets/js/83.670ce005.js"><link rel="prefetch" href="../../../assets/js/84.f15be292.js"><link rel="prefetch" href="../../../assets/js/85.2a7d8662.js"><link rel="prefetch" href="../../../assets/js/86.25f5cad5.js"><link rel="prefetch" href="../../../assets/js/87.f7ecf143.js"><link rel="prefetch" href="../../../assets/js/88.036784db.js"><link rel="prefetch" href="../../../assets/js/89.1d39dde8.js"><link rel="prefetch" href="../../../assets/js/9.5e62c730.js"><link rel="prefetch" href="../../../assets/js/90.49100c87.js"><link rel="prefetch" href="../../../assets/js/91.6564e9a9.js"><link rel="prefetch" href="../../../assets/js/92.e43c292d.js"><link rel="prefetch" href="../../../assets/js/93.79910658.js"><link rel="prefetch" href="../../../assets/js/94.e44f349c.js"><link rel="prefetch" href="../../../assets/js/95.0d8cda38.js"><link rel="prefetch" href="../../../assets/js/96.56fd8eba.js"><link rel="prefetch" href="../../../assets/js/97.cc2ae791.js"><link rel="prefetch" href="../../../assets/js/98.7d9360ae.js"><link rel="prefetch" href="../../../assets/js/99.e2c3cde9.js"><link rel="prefetch" href="../../../assets/js/vendors~docsearch.344a1317.js"> <link rel="stylesheet" href="../../../assets/css/0.styles.bf49ba33.css"> </head> <body> <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><img src="../../../images/ipfs-logo.svg" alt="IPFS Docs" class="logo"> <span class="site-name can-hide">IPFS Docs</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="../../../install/" class="nav-link"> Get Started </a></div><div class="nav-item"><a href="../../../concepts/" class="nav-link"> Concepts </a></div><div class="nav-item"><a href="../../../how-to/" class="nav-link"> Guides </a></div><div class="nav-item"><a href="../../../reference/" class="nav-link router-link-active"> Reference </a></div><div class="nav-item"><a href="../../../project/" class="nav-link"> Project </a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="Case Studies" class="dropdown-title"><span class="title">Case Studies</span> <span class="arrow down"></span></button> <button type="button" aria-label="Case Studies" class="mobile-dropdown-title"><span class="title">Case Studies</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="../../../case-studies/arbol/" class="nav-link"> Arbol </a></li><li class="dropdown-item"><!----> <a href="../../../case-studies/audius.html" class="nav-link"> Audius </a></li><li class="dropdown-item"><!----> <a href="../../../case-studies/fleek.html" class="nav-link"> Fleek </a></li><li class="dropdown-item"><!----> <a href="../../../case-studies/likecoin.html" class="nav-link"> LikeCoin </a></li><li class="dropdown-item"><!----> <a href="../../../case-studies/morpheus.html" class="nav-link"> Morpheus.Network </a></li><li class="dropdown-item"><!----> <a href="../../../case-studies/snapshot.html" class="nav-link"> Snapshot </a></li></ul></div></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="../../../install/" class="nav-link"> Get Started </a></div><div class="nav-item"><a href="../../../concepts/" class="nav-link"> Concepts </a></div><div class="nav-item"><a href="../../../how-to/" class="nav-link"> Guides </a></div><div class="nav-item"><a href="../../../reference/" class="nav-link router-link-active"> Reference </a></div><div class="nav-item"><a href="../../../project/" class="nav-link"> Project </a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="Case Studies" class="dropdown-title"><span class="title">Case Studies</span> <span class="arrow down"></span></button> <button type="button" aria-label="Case Studies" class="mobile-dropdown-title"><span class="title">Case Studies</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="../../../case-studies/arbol/" class="nav-link"> Arbol </a></li><li class="dropdown-item"><!----> <a href="../../../case-studies/audius.html" class="nav-link"> Audius </a></li><li class="dropdown-item"><!----> <a href="../../../case-studies/fleek.html" class="nav-link"> Fleek </a></li><li class="dropdown-item"><!----> <a href="../../../case-studies/likecoin.html" class="nav-link"> LikeCoin </a></li><li class="dropdown-item"><!----> <a href="../../../case-studies/morpheus.html" class="nav-link"> Morpheus.Network </a></li><li class="dropdown-item"><!----> <a href="../../../case-studies/snapshot.html" class="nav-link"> Snapshot </a></li></ul></div></div> <!----></nav> <ul class="sidebar-links"><li><a href="../../../reference/diagnostic-tools/" class="sidebar-link">Diagnostic tools</a></li><li><a href="../../../reference/http/gateway/" class="sidebar-link">HTTP Gateway</a></li><li><a href="../../../reference/js/api/" class="sidebar-link">IPFS in JS</a></li><li><a href="../../../reference/go/api/" class="sidebar-link">Advanced Kubo Usage</a></li><li><a href="../../../reference/kubo/cli/" class="sidebar-link">Kubo CLI</a></li><li><a href="../../../reference/kubo/rpc/" aria-current="page" class="active sidebar-link">Kubo RPC API</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#getting-started" class="sidebar-link">Getting started</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#http-status-codes" class="sidebar-link">HTTP status codes</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#origin-based-security" class="sidebar-link">Origin-based security</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#rpc-commands" class="sidebar-link">RPC commands</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-add" class="sidebar-link">/api/v0/add</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-bitswap-ledger" class="sidebar-link">/api/v0/bitswap/ledger</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-bitswap-reprovide" class="sidebar-link">/api/v0/bitswap/reprovide</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-bitswap-stat" class="sidebar-link">/api/v0/bitswap/stat</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-bitswap-wantlist" class="sidebar-link">/api/v0/bitswap/wantlist</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-block-get" class="sidebar-link">/api/v0/block/get</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-block-put" class="sidebar-link">/api/v0/block/put</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-block-rm" class="sidebar-link">/api/v0/block/rm</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-block-stat" class="sidebar-link">/api/v0/block/stat</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-bootstrap" class="sidebar-link">/api/v0/bootstrap</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-bootstrap-add" class="sidebar-link">/api/v0/bootstrap/add</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-bootstrap-add-default" class="sidebar-link">/api/v0/bootstrap/add/default</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-bootstrap-list" class="sidebar-link">/api/v0/bootstrap/list</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-bootstrap-rm" class="sidebar-link">/api/v0/bootstrap/rm</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-bootstrap-rm-all" class="sidebar-link">/api/v0/bootstrap/rm/all</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-cat" class="sidebar-link">/api/v0/cat</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-cid-base32" class="sidebar-link">/api/v0/cid/base32</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-cid-bases" class="sidebar-link">/api/v0/cid/bases</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-cid-codecs" class="sidebar-link">/api/v0/cid/codecs</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-cid-format" class="sidebar-link">/api/v0/cid/format</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-cid-hashes" class="sidebar-link">/api/v0/cid/hashes</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-commands" class="sidebar-link">/api/v0/commands</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-config" class="sidebar-link">/api/v0/config</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-config-profile-apply" class="sidebar-link">/api/v0/config/profile/apply</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-config-replace" class="sidebar-link">/api/v0/config/replace</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-config-show" class="sidebar-link">/api/v0/config/show</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-dag-export" class="sidebar-link">/api/v0/dag/export</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-dag-get" class="sidebar-link">/api/v0/dag/get</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-dag-import" class="sidebar-link">/api/v0/dag/import</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-dag-put" class="sidebar-link">/api/v0/dag/put</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-dag-resolve" class="sidebar-link">/api/v0/dag/resolve</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-dag-stat" class="sidebar-link">/api/v0/dag/stat</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-diag-cmds" class="sidebar-link">/api/v0/diag/cmds</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-diag-cmds-clear" class="sidebar-link">/api/v0/diag/cmds/clear</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-diag-cmds-set-time" class="sidebar-link">/api/v0/diag/cmds/set-time</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-diag-profile" class="sidebar-link">/api/v0/diag/profile</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-diag-sys" class="sidebar-link">/api/v0/diag/sys</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-files-chcid" class="sidebar-link">/api/v0/files/chcid</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-files-cp" class="sidebar-link">/api/v0/files/cp</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-files-flush" class="sidebar-link">/api/v0/files/flush</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-files-ls" class="sidebar-link">/api/v0/files/ls</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-files-mkdir" class="sidebar-link">/api/v0/files/mkdir</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-files-mv" class="sidebar-link">/api/v0/files/mv</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-files-read" class="sidebar-link">/api/v0/files/read</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-files-rm" class="sidebar-link">/api/v0/files/rm</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-files-stat" class="sidebar-link">/api/v0/files/stat</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-files-write" class="sidebar-link">/api/v0/files/write</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-filestore-dups" class="sidebar-link">/api/v0/filestore/dups</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-filestore-ls" class="sidebar-link">/api/v0/filestore/ls</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-filestore-verify" class="sidebar-link">/api/v0/filestore/verify</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-get" class="sidebar-link">/api/v0/get</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-id" class="sidebar-link">/api/v0/id</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-key-gen" class="sidebar-link">/api/v0/key/gen</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-key-import" class="sidebar-link">/api/v0/key/import</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-key-list" class="sidebar-link">/api/v0/key/list</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-key-rename" class="sidebar-link">/api/v0/key/rename</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-key-rm" class="sidebar-link">/api/v0/key/rm</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-log-level" class="sidebar-link">/api/v0/log/level</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-log-ls" class="sidebar-link">/api/v0/log/ls</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-ls" class="sidebar-link">/api/v0/ls</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-multibase-decode" class="sidebar-link">/api/v0/multibase/decode</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-multibase-encode" class="sidebar-link">/api/v0/multibase/encode</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-multibase-list" class="sidebar-link">/api/v0/multibase/list</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-multibase-transcode" class="sidebar-link">/api/v0/multibase/transcode</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-name-publish" class="sidebar-link">/api/v0/name/publish</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-name-resolve" class="sidebar-link">/api/v0/name/resolve</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-pin-add" class="sidebar-link">/api/v0/pin/add</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-pin-ls" class="sidebar-link">/api/v0/pin/ls</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-pin-remote-add" class="sidebar-link">/api/v0/pin/remote/add</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-pin-remote-ls" class="sidebar-link">/api/v0/pin/remote/ls</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-pin-remote-rm" class="sidebar-link">/api/v0/pin/remote/rm</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-pin-remote-service-add" class="sidebar-link">/api/v0/pin/remote/service/add</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-pin-remote-service-ls" class="sidebar-link">/api/v0/pin/remote/service/ls</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-pin-remote-service-rm" class="sidebar-link">/api/v0/pin/remote/service/rm</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-pin-rm" class="sidebar-link">/api/v0/pin/rm</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-pin-update" class="sidebar-link">/api/v0/pin/update</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-pin-verify" class="sidebar-link">/api/v0/pin/verify</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-ping" class="sidebar-link">/api/v0/ping</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-refs" class="sidebar-link">/api/v0/refs</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-refs-local" class="sidebar-link">/api/v0/refs/local</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-repo-gc" class="sidebar-link">/api/v0/repo/gc</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-repo-ls" class="sidebar-link">/api/v0/repo/ls</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-repo-stat" class="sidebar-link">/api/v0/repo/stat</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-repo-verify" class="sidebar-link">/api/v0/repo/verify</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-repo-version" class="sidebar-link">/api/v0/repo/version</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-resolve" class="sidebar-link">/api/v0/resolve</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-routing-findpeer" class="sidebar-link">/api/v0/routing/findpeer</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-routing-findprovs" class="sidebar-link">/api/v0/routing/findprovs</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-shutdown" class="sidebar-link">/api/v0/shutdown</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-stats-bitswap" class="sidebar-link">/api/v0/stats/bitswap</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-stats-bw" class="sidebar-link">/api/v0/stats/bw</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-stats-dht" class="sidebar-link">/api/v0/stats/dht</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-stats-provide" class="sidebar-link">/api/v0/stats/provide</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-stats-repo" class="sidebar-link">/api/v0/stats/repo</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-swarm-addrs" class="sidebar-link">/api/v0/swarm/addrs</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-swarm-addrs-listen" class="sidebar-link">/api/v0/swarm/addrs/listen</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-swarm-addrs-local" class="sidebar-link">/api/v0/swarm/addrs/local</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-swarm-connect" class="sidebar-link">/api/v0/swarm/connect</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-swarm-disconnect" class="sidebar-link">/api/v0/swarm/disconnect</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-swarm-filters" class="sidebar-link">/api/v0/swarm/filters</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-swarm-filters-add" class="sidebar-link">/api/v0/swarm/filters/add</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-swarm-filters-rm" class="sidebar-link">/api/v0/swarm/filters/rm</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-swarm-peering-add" class="sidebar-link">/api/v0/swarm/peering/add</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-swarm-peering-ls" class="sidebar-link">/api/v0/swarm/peering/ls</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-swarm-peering-rm" class="sidebar-link">/api/v0/swarm/peering/rm</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-swarm-peers" class="sidebar-link">/api/v0/swarm/peers</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-version" class="sidebar-link">/api/v0/version</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-version-check" class="sidebar-link">/api/v0/version/check</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-version-deps" class="sidebar-link">/api/v0/version/deps</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#experimental-rpc-commands" class="sidebar-link">Experimental RPC commands</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-files-chmod" class="sidebar-link">/api/v0/files/chmod</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-files-touch" class="sidebar-link">/api/v0/files/touch</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-key-sign" class="sidebar-link">/api/v0/key/sign</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-key-verify" class="sidebar-link">/api/v0/key/verify</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-log-tail" class="sidebar-link">/api/v0/log/tail</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-mount" class="sidebar-link">/api/v0/mount</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-name-inspect" class="sidebar-link">/api/v0/name/inspect</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-name-pubsub-cancel" class="sidebar-link">/api/v0/name/pubsub/cancel</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-name-pubsub-state" class="sidebar-link">/api/v0/name/pubsub/state</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-name-pubsub-subs" class="sidebar-link">/api/v0/name/pubsub/subs</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-p2p-close" class="sidebar-link">/api/v0/p2p/close</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-p2p-forward" class="sidebar-link">/api/v0/p2p/forward</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-p2p-listen" class="sidebar-link">/api/v0/p2p/listen</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-p2p-ls" class="sidebar-link">/api/v0/p2p/ls</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-p2p-stream-close" class="sidebar-link">/api/v0/p2p/stream/close</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-p2p-stream-ls" class="sidebar-link">/api/v0/p2p/stream/ls</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-routing-get" class="sidebar-link">/api/v0/routing/get</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-routing-provide" class="sidebar-link">/api/v0/routing/provide</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-routing-put" class="sidebar-link">/api/v0/routing/put</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-swarm-resources" class="sidebar-link">/api/v0/swarm/resources</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#deprecated-rpc-commands" class="sidebar-link">Deprecated RPC commands</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-dht-query" class="sidebar-link">/api/v0/dht/query</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-object-diff" class="sidebar-link">/api/v0/object/diff</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-object-patch-add-link" class="sidebar-link">/api/v0/object/patch/add-link</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-object-patch-rm-link" class="sidebar-link">/api/v0/object/patch/rm-link</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-pubsub-ls" class="sidebar-link">/api/v0/pubsub/ls</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-pubsub-peers" class="sidebar-link">/api/v0/pubsub/peers</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-pubsub-pub" class="sidebar-link">/api/v0/pubsub/pub</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-pubsub-sub" class="sidebar-link">/api/v0/pubsub/sub</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#removed-rpc-commands" class="sidebar-link">Removed RPC commands</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-dht-findpeer" class="sidebar-link">/api/v0/dht/findpeer</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-dht-findprovs" class="sidebar-link">/api/v0/dht/findprovs</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-dht-get" class="sidebar-link">/api/v0/dht/get</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-dht-provide" class="sidebar-link">/api/v0/dht/provide</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-dht-put" class="sidebar-link">/api/v0/dht/put</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-object-data" class="sidebar-link">/api/v0/object/data</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-object-get" class="sidebar-link">/api/v0/object/get</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-object-links" class="sidebar-link">/api/v0/object/links</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-object-new" class="sidebar-link">/api/v0/object/new</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-object-patch-append-data" class="sidebar-link">/api/v0/object/patch/append-data</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-object-patch-set-data" class="sidebar-link">/api/v0/object/patch/set-data</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-object-put" class="sidebar-link">/api/v0/object/put</a></li><li class="sidebar-sub-header"><a href="../../../reference/kubo/rpc/#api-v0-object-stat" class="sidebar-link">/api/v0/object/stat</a></li></ul></li><li><a href="../../../reference/kubo-rpc-cli/" class="sidebar-link">Kubo RPC API clients</a></li></ul> </aside> <main class="page" data-v-b274761c=""> <div class="theme-default-content content__default" data-v-b274761c=""><h1 id="kubo-rpc-api-v0-reference"><a href="#kubo-rpc-api-v0-reference" class="header-anchor">#</a> Kubo RPC API v0 reference</h1> <div class="custom-block tip"><p class="custom-block-title">Generated on 2025-02-14, from kubo v0.33.2</p> <p>This document was autogenerated from <a href="https://github.com/ipfs/kubo/releases/tag/v0.33.2" target="_blank" rel="noopener noreferrer">v0.33.2<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>. For issues and support, check out the <a href="https://github.com/ipfs/ipfs-docs/tree/main/tools/http-api-docs" target="_blank" rel="noopener noreferrer">http-api-docs<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> generator on GitHub.</p></div> <p>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.</p> <p>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 <code>ipfs</code> CLI commands use this RPC API when operating in online mode.</p> <div class="custom-block danger"><p class="custom-block-title">NEVER EXPOSE THE RPC API TO THE PUBLIC INTERNET</p> <p>The RPC API provides admin-level access to your Kubo IPFS node, including <code>/api/v0/config</code>.</p> <p>It is bound to <code>localhost</code> 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.</p> <p>To expose the RPC API to the public internet with TLS encryption and HTTP authentication, check out the <a href="../../../how-to/kubo-rpc-tls-auth/">TLS and HTTP Auth for Kubo with Caddy</a> guide.</p> <p>If you are looking for an interface designed for browsers and public internet, consider implementation-agnostic <a href="../../../reference/http/gateway/">HTTP Gateway</a> instead.</p></div> <h2 id="getting-started"><a href="#getting-started" class="header-anchor">#</a> Getting started</h2> <h3 id="alignment-with-cli-commands"><a href="#alignment-with-cli-commands" class="header-anchor">#</a> Alignment with CLI commands</h3> <p>The API under <code>/api/v0/</code> is an RPC-style API over HTTP, not a REST API.</p> <p><a href="../../../reference/kubo/cli/">Every command</a> usable from the CLI is also available through the HTTP RPC API. For example:</p> <div class="language-sh extra-class"><pre class="language-sh"><code><span class="token operator">></span> 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 <span class="token operator">></span> <span class="token function">curl</span> <span class="token parameter variable">-X</span> POST http://127.0.0.1:5001/api/v0/swarm/peers <span class="token punctuation">{</span> <span class="token string">"Strings"</span><span class="token builtin class-name">:</span> <span class="token punctuation">[</span> <span class="token string">"/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"</span>, <span class="token string">"/ip4/104.236.151.122/tcp/4001/p2p/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx"</span>, <span class="token string">"/ip4/104.236.176.52/tcp/4001/p2p/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z"</span>, <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="arguments"><a href="#arguments" class="header-anchor">#</a> Arguments</h3> <p>Arguments are added through the special query string key "arg":</p> <div class="language- extra-class"><pre class="language-text"><code>> 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", ] } </code></pre></div><p>Note that it can be used multiple times to signify multiple arguments.</p> <h3 id="flags"><a href="#flags" class="header-anchor">#</a> Flags</h3> <p>Flags are added through the query string. For example, the <code>--encoding=json</code> flag is the <code>&#x26;encoding=json</code> query parameter below:</p> <div class="language- extra-class"><pre class="language-text"><code>> curl -X POST "http://127.0.0.1:5001/api/v0/object/get?arg=QmaaqrHyAQm7gALkRW8DcfGX3u8q9rWKnxEMmf7m9z515w&#x26;encoding=json" { "Links": [ { "Name": "index.html", "Hash": "QmYftndCvcEiuSZRX7njywX2AGSeHY2ASa7VryCq1mKwEw", "Size": 1700 }, { "Name": "static", "Hash": "QmdtWFiasJeh2ymW3TD2cLHYxn1ryTuWoNpwieFyJriGTS", "Size": 2428803 } ], "Data": "CAE=" } </code></pre></div><p>Some flags may be repeated. For example, the <code>--status</code> flag may be reused as below:</p> <div class="language- extra-class"><pre class="language-text"><code>> curl -X POST "http://127.0.0.1:5001/api/v0/pin/remote/service/ls?name=myservice&#x26;status=pinned&#x26;status=pinning" </code></pre></div><div class="custom-block tip"><p class="custom-block-title">TIP</p> <p>Some arguments may belong only to the CLI but appear here too. These usually belong to client-side processing of input, particularly in the <code>add</code> command.</p> <p>Additionally, as a convenience certain CLI commands may allow passing repeated flags as delimited lists such as <code>ipfs pin remote service ls --status=pinned,pinning</code>; however, this does not apply to the HTTP API.</p></div> <h2 id="http-status-codes"><a href="#http-status-codes" class="header-anchor">#</a> HTTP status codes</h2> <p>Status codes used at the RPC layer are simple:</p> <ul><li><code>200</code> - The request was processed or is being processed (streaming)</li> <li><code>500</code> - RPC endpoint returned an error</li> <li><code>400</code> - Malformed RPC, argument type error, etc</li> <li><code>403</code> - RPC call forbidden</li> <li><code>404</code> - RPC endpoint doesn't exist</li> <li><code>405</code> - HTTP Method Not Allowed</li></ul> <p>Status code <code>500</code> means that the function <em>does</em> 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).</p> <p>Streaming endpoints fail as above, unless they have started streaming. That means they will have sent a <code>200</code> 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).</p> <p>A <code>405</code> error may mean that you are using the wrong HTTP method (i.e. GET instead of POST), and a <code>403</code> error occurs in a browser due to Origin / CORS.</p> <h2 id="origin-based-security"><a href="#origin-based-security" class="header-anchor">#</a> Origin-based security</h2> <p>When a request is sent from a browser, HTTP RPC API follows the <a href="https://en.wikipedia.org/wiki/Same-origin_policy" target="_blank" rel="noopener noreferrer">Origin-based security model<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>, and expects the <code>Origin</code> 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 <code>API.HTTPHeaders.Access-Control-Allow-Origin</code> in the config.</p> <h2 id="rpc-commands"><a href="#rpc-commands" class="header-anchor">#</a> RPC commands</h2> <h2 id="api-v0-add"><a href="#api-v0-add" class="header-anchor">#</a> /api/v0/add</h2> <p>Add a file or directory to IPFS.</p> <h3 id="arguments-2"><a href="#arguments-2" class="header-anchor">#</a> Arguments</h3> <ul><li><code>quiet</code> [bool]: Write minimal output. Required: no.</li> <li><code>quieter</code> [bool]: Write only final hash. Required: no.</li> <li><code>silent</code> [bool]: Write no output. Required: no.</li> <li><code>progress</code> [bool]: Stream progress data. Required: no.</li> <li><code>trickle</code> [bool]: Use trickle-dag format for dag generation. Required: no.</li> <li><code>only-hash</code> [bool]: Only chunk and hash - do not write to disk. Required: no.</li> <li><code>wrap-with-directory</code> [bool]: Wrap files with a directory object. Required: no.</li> <li><code>chunker</code> [string]: Chunking algorithm, size-[bytes], rabin-[min]-[avg]-[max] or buzhash. Required: no.</li> <li><code>raw-leaves</code> [bool]: Use raw blocks for leaf nodes. Required: no.</li> <li><code>nocopy</code> [bool]: Add the file using filestore. Implies raw-leaves. (experimental). Required: no.</li> <li><code>fscache</code> [bool]: Check the filestore for pre-existing blocks. (experimental). Required: no.</li> <li><code>cid-version</code> [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.</li> <li><code>hash</code> [string]: Hash function to use. Implies CIDv1 if not sha2-256. (experimental). Required: no.</li> <li><code>inline</code> [bool]: Inline small blocks into CIDs. (experimental). Required: no.</li> <li><code>inline-limit</code> [int]: Maximum block size to inline. (experimental). Default: <code>32</code>. Required: no.</li> <li><code>pin</code> [bool]: Pin locally to protect added files from garbage collection. Default: <code>true</code>. Required: no.</li> <li><code>to-files</code> [string]: Add reference to Files API (MFS) at the provided path. Required: no.</li> <li><code>preserve-mode</code> [bool]: Apply existing POSIX permissions to created UnixFS entries. Disables raw-leaves. (experimental). Required: no.</li> <li><code>preserve-mtime</code> [bool]: Apply existing POSIX modification time to created UnixFS entries. Disables raw-leaves. (experimental). Required: no.</li> <li><code>mode</code> [uint]: Custom POSIX file mode to store in created UnixFS entries. Disables raw-leaves. (experimental). Required: no.</li> <li><code>mtime</code> [int64]: Custom POSIX modification time to store in created UnixFS entries (seconds before or after the Unix Epoch). Disables raw-leaves. (experimental). Required: no.</li> <li><code>mtime-nsecs</code> [uint]: Custom POSIX modification time (optional time fraction in nanoseconds). Required: no.</li></ul> <h3 id="request-body"><a href="#request-body" class="header-anchor">#</a> Request Body</h3> <p>Argument <code>path</code> 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'.</p> <p>The <code>add</code> command not only allows adding files, but also uploading directories and complex hierarchies.</p> <p>This happens as follows: Every part in the multipart request is a <em>directory</em> or a <em>file</em> to be added to IPFS.</p> <p>Directory parts have a special content type <code>application/x-directory</code>. These parts do not carry any data. The part headers look as follows:</p> <div class="language- extra-class"><pre class="language-text"><code>Content-Disposition: form-data; name="file"; filename="folderName" Content-Type: application/x-directory </code></pre></div><p>File parts carry the file payload after the following headers:</p> <div class="language- extra-class"><pre class="language-text"><code>Abspath: /absolute/path/to/file.txt Content-Disposition: form-data; name="file"; filename="folderName%2Ffile.txt" Content-Type: application/octet-stream ...contents... </code></pre></div><p>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.</p> <p>The <code>Abspath</code> header is included for filestore/urlstore features that are enabled with the <code>nocopy</code> 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.</p> <h3 id="response"><a href="#response" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Bytes"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int64>"</span><span class="token punctuation">,</span> <span class="token property">"Hash"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Mode"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Mtime"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int64>"</span><span class="token punctuation">,</span> <span class="token property">"MtimeNsecs"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span><span class="token punctuation">,</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Size"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example"><a href="#curl-example" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/add?quiet=&#x3C;value>&#x26;quieter=&#x3C;value>&#x26;silent=&#x3C;value>&#x26;progress=&#x3C;value>&#x26;trickle=&#x3C;value>&#x26;only-hash=&#x3C;value>&#x26;wrap-with-directory=&#x3C;value>&#x26;chunker=&#x3C;value>&#x26;raw-leaves=&#x3C;value>&#x26;nocopy=&#x3C;value>&#x26;fscache=&#x3C;value>&#x26;cid-version=&#x3C;value>&#x26;hash=&#x3C;value>&#x26;inline=&#x3C;value>&#x26;inline-limit=32&#x26;pin=true&#x26;to-files=&#x3C;value>&#x26;preserve-mode=&#x3C;value>&#x26;preserve-mtime=&#x3C;value>&#x26;mode=&#x3C;value>&#x26;mtime=&#x3C;value>&#x26;mtime-nsecs=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-bitswap-ledger"><a href="#api-v0-bitswap-ledger" class="header-anchor">#</a> /api/v0/bitswap/ledger</h2> <p>Show the current ledger for a peer.</p> <h3 id="arguments-3"><a href="#arguments-3" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: The PeerID (B58) of the ledger to inspect. Required: <strong>yes</strong>.</li></ul> <h3 id="response-2"><a href="#response-2" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Exchanged"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"Peer"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Recv"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"Sent"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"Value"</span><span class="token operator">:</span> <span class="token string">"&#x3C;float64>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-2"><a href="#curl-example-2" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/bitswap/ledger?arg=&#x3C;peer>"</code></p> <hr> <h2 id="api-v0-bitswap-reprovide"><a href="#api-v0-bitswap-reprovide" class="header-anchor">#</a> /api/v0/bitswap/reprovide</h2> <p>Trigger reprovider.</p> <h3 id="arguments-4"><a href="#arguments-4" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-3"><a href="#response-3" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-3"><a href="#curl-example-3" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/bitswap/reprovide"</code></p> <hr> <h2 id="api-v0-bitswap-stat"><a href="#api-v0-bitswap-stat" class="header-anchor">#</a> /api/v0/bitswap/stat</h2> <p>Show some diagnostic information on the bitswap agent.</p> <h3 id="arguments-5"><a href="#arguments-5" class="header-anchor">#</a> Arguments</h3> <ul><li><code>verbose</code> [bool]: Print extra information. Required: no.</li> <li><code>human</code> [bool]: Print sizes in human readable format (e.g., 1K 234M 2G). Required: no.</li></ul> <h3 id="response-4"><a href="#response-4" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"BlocksReceived"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"BlocksSent"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"DataReceived"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"DataSent"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"DupBlksReceived"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"DupDataReceived"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"MessagesReceived"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"Peers"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"Wantlist"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"/"</span><span class="token operator">:</span> <span class="token string">"&#x3C;cid-string>"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-4"><a href="#curl-example-4" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/bitswap/stat?verbose=&#x3C;value>&#x26;human=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-bitswap-wantlist"><a href="#api-v0-bitswap-wantlist" class="header-anchor">#</a> /api/v0/bitswap/wantlist</h2> <p>Show blocks currently on the wantlist.</p> <h3 id="arguments-6"><a href="#arguments-6" class="header-anchor">#</a> Arguments</h3> <ul><li><code>peer</code> [string]: Specify which peer to show wantlist for. Required: no.</li></ul> <h3 id="response-5"><a href="#response-5" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Keys"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"/"</span><span class="token operator">:</span> <span class="token string">"&#x3C;cid-string>"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-5"><a href="#curl-example-5" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/bitswap/wantlist?peer=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-block-get"><a href="#api-v0-block-get" class="header-anchor">#</a> /api/v0/block/get</h2> <p>Get a raw IPFS block.</p> <h3 id="arguments-7"><a href="#arguments-7" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: The CID of an existing block to get. Required: <strong>yes</strong>.</li></ul> <h3 id="response-6"><a href="#response-6" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-6"><a href="#curl-example-6" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/block/get?arg=&#x3C;cid>"</code></p> <hr> <h2 id="api-v0-block-put"><a href="#api-v0-block-put" class="header-anchor">#</a> /api/v0/block/put</h2> <p>Store input as an IPFS block.</p> <h3 id="arguments-8"><a href="#arguments-8" class="header-anchor">#</a> Arguments</h3> <ul><li><code>cid-codec</code> [string]: Multicodec to use in returned CID. Default: <code>raw</code>. Required: no.</li> <li><code>mhtype</code> [string]: Multihash hash function. Required: no.</li> <li><code>mhlen</code> [int]: Multihash hash length. Default: <code>-1</code>. Required: no.</li> <li><code>pin</code> [bool]: Pin added blocks recursively. Default: <code>false</code>. Required: no.</li> <li><code>allow-big-block</code> [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: <code>false</code>. Required: no.</li> <li><code>format</code> [string]: Use legacy format for returned CID (DEPRECATED). Required: no.</li></ul> <h3 id="request-body-2"><a href="#request-body-2" class="header-anchor">#</a> Request Body</h3> <p>Argument <code>data</code> 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'.</p> <h3 id="response-7"><a href="#response-7" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Key"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Size"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-7"><a href="#curl-example-7" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/block/put?cid-codec=raw&#x26;mhtype=&#x3C;value>&#x26;mhlen=-1&#x26;pin=false&#x26;allow-big-block=false&#x26;format=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-block-rm"><a href="#api-v0-block-rm" class="header-anchor">#</a> /api/v0/block/rm</h2> <p>Remove IPFS block(s) from the local datastore.</p> <h3 id="arguments-9"><a href="#arguments-9" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: CIDs of block(s) to remove. Required: <strong>yes</strong>.</li> <li><code>force</code> [bool]: Ignore nonexistent blocks. Required: no.</li> <li><code>quiet</code> [bool]: Write minimal output. Required: no.</li></ul> <h3 id="response-8"><a href="#response-8" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Error"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Hash"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-8"><a href="#curl-example-8" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/block/rm?arg=&#x3C;cid>&#x26;force=&#x3C;value>&#x26;quiet=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-block-stat"><a href="#api-v0-block-stat" class="header-anchor">#</a> /api/v0/block/stat</h2> <p>Print information of a raw IPFS block.</p> <h3 id="arguments-10"><a href="#arguments-10" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: The CID of an existing block to stat. Required: <strong>yes</strong>.</li></ul> <h3 id="response-9"><a href="#response-9" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Key"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Size"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-9"><a href="#curl-example-9" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/block/stat?arg=&#x3C;cid>"</code></p> <hr> <h2 id="api-v0-bootstrap"><a href="#api-v0-bootstrap" class="header-anchor">#</a> /api/v0/bootstrap</h2> <p>Show or edit the list of bootstrap peers.</p> <h3 id="arguments-11"><a href="#arguments-11" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-10"><a href="#response-10" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Peers"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-10"><a href="#curl-example-10" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/bootstrap"</code></p> <hr> <h2 id="api-v0-bootstrap-add"><a href="#api-v0-bootstrap-add" class="header-anchor">#</a> /api/v0/bootstrap/add</h2> <p>Add peers to the bootstrap list.</p> <h3 id="arguments-12"><a href="#arguments-12" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: A peer to add to the bootstrap list (in the format '&#x3C;multiaddr>/&#x3C;peerID>') Required: no.</li> <li><code>default</code> [bool]: Add default bootstrap nodes. (Deprecated, use 'default' subcommand instead). Required: no.</li></ul> <h3 id="response-11"><a href="#response-11" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Peers"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-11"><a href="#curl-example-11" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/bootstrap/add?arg=&#x3C;peer>&#x26;default=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-bootstrap-add-default"><a href="#api-v0-bootstrap-add-default" class="header-anchor">#</a> /api/v0/bootstrap/add/default</h2> <p>Add default peers to the bootstrap list.</p> <h3 id="arguments-13"><a href="#arguments-13" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-12"><a href="#response-12" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Peers"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-12"><a href="#curl-example-12" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/bootstrap/add/default"</code></p> <hr> <h2 id="api-v0-bootstrap-list"><a href="#api-v0-bootstrap-list" class="header-anchor">#</a> /api/v0/bootstrap/list</h2> <p>Show peers in the bootstrap list.</p> <h3 id="arguments-14"><a href="#arguments-14" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-13"><a href="#response-13" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Peers"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-13"><a href="#curl-example-13" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/bootstrap/list"</code></p> <hr> <h2 id="api-v0-bootstrap-rm"><a href="#api-v0-bootstrap-rm" class="header-anchor">#</a> /api/v0/bootstrap/rm</h2> <p>Remove peers from the bootstrap list.</p> <h3 id="arguments-15"><a href="#arguments-15" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: A peer to add to the bootstrap list (in the format '&#x3C;multiaddr>/&#x3C;peerID>') Required: no.</li> <li><code>all</code> [bool]: Remove all bootstrap peers. (Deprecated, use 'all' subcommand). Required: no.</li></ul> <h3 id="response-14"><a href="#response-14" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Peers"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-14"><a href="#curl-example-14" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/bootstrap/rm?arg=&#x3C;peer>&#x26;all=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-bootstrap-rm-all"><a href="#api-v0-bootstrap-rm-all" class="header-anchor">#</a> /api/v0/bootstrap/rm/all</h2> <p>Remove all peers from the bootstrap list.</p> <h3 id="arguments-16"><a href="#arguments-16" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-15"><a href="#response-15" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Peers"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-15"><a href="#curl-example-15" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/bootstrap/rm/all"</code></p> <hr> <h2 id="api-v0-cat"><a href="#api-v0-cat" class="header-anchor">#</a> /api/v0/cat</h2> <p>Show IPFS object data.</p> <h3 id="arguments-17"><a href="#arguments-17" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: The path to the IPFS object(s) to be outputted. Required: <strong>yes</strong>.</li> <li><code>offset</code> [int64]: Byte offset to begin reading from. Required: no.</li> <li><code>length</code> [int64]: Maximum number of bytes to read. Required: no.</li> <li><code>progress</code> [bool]: Stream progress data. Default: <code>true</code>. Required: no.</li></ul> <h3 id="response-16"><a href="#response-16" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-16"><a href="#curl-example-16" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/cat?arg=&#x3C;ipfs-path>&#x26;offset=&#x3C;value>&#x26;length=&#x3C;value>&#x26;progress=true"</code></p> <hr> <h2 id="api-v0-cid-base32"><a href="#api-v0-cid-base32" class="header-anchor">#</a> /api/v0/cid/base32</h2> <p>Convert CIDs to Base32 CID version 1.</p> <h3 id="arguments-18"><a href="#arguments-18" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: CIDs to convert. Required: <strong>yes</strong>.</li></ul> <h3 id="response-17"><a href="#response-17" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"CidStr"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"ErrorMsg"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Formatted"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-17"><a href="#curl-example-17" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/cid/base32?arg=&#x3C;cid>"</code></p> <hr> <h2 id="api-v0-cid-bases"><a href="#api-v0-cid-bases" class="header-anchor">#</a> /api/v0/cid/bases</h2> <p>List available multibase encodings.</p> <h3 id="arguments-19"><a href="#arguments-19" class="header-anchor">#</a> Arguments</h3> <ul><li><code>prefix</code> [bool]: also include the single letter prefixes in addition to the code. Required: no.</li> <li><code>numeric</code> [bool]: also include numeric codes. Required: no.</li></ul> <h3 id="response-18"><a href="#response-18" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Code"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span><span class="token punctuation">,</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> </code></pre></div><h3 id="curl-example-18"><a href="#curl-example-18" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/cid/bases?prefix=&#x3C;value>&#x26;numeric=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-cid-codecs"><a href="#api-v0-cid-codecs" class="header-anchor">#</a> /api/v0/cid/codecs</h2> <p>List available CID multicodecs.</p> <h3 id="arguments-20"><a href="#arguments-20" class="header-anchor">#</a> Arguments</h3> <ul><li><code>numeric</code> [bool]: also include numeric codes. Required: no.</li> <li><code>supported</code> [bool]: list only codecs supported by go-ipfs commands. Required: no.</li></ul> <h3 id="response-19"><a href="#response-19" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Code"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span><span class="token punctuation">,</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> </code></pre></div><h3 id="curl-example-19"><a href="#curl-example-19" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/cid/codecs?numeric=&#x3C;value>&#x26;supported=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-cid-format"><a href="#api-v0-cid-format" class="header-anchor">#</a> /api/v0/cid/format</h2> <p>Format and convert a CID in various useful ways.</p> <h3 id="arguments-21"><a href="#arguments-21" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: CIDs to format. Required: <strong>yes</strong>.</li> <li><code>f</code> [string]: Printf style format string. Default: %s. Default: <code>%s</code>. Required: no.</li> <li><code>v</code> [string]: CID version to convert to. Required: no.</li> <li><code>mc</code> [string]: CID multicodec to convert to. Required: no.</li> <li><code>b</code> [string]: Multibase to display CID in. Required: no.</li></ul> <h3 id="response-20"><a href="#response-20" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"CidStr"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"ErrorMsg"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Formatted"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-20"><a href="#curl-example-20" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/cid/format?arg=&#x3C;cid>&#x26;f=%s&#x26;v=&#x3C;value>&#x26;mc=&#x3C;value>&#x26;b=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-cid-hashes"><a href="#api-v0-cid-hashes" class="header-anchor">#</a> /api/v0/cid/hashes</h2> <p>List available multihashes.</p> <h3 id="arguments-22"><a href="#arguments-22" class="header-anchor">#</a> Arguments</h3> <ul><li><code>numeric</code> [bool]: also include numeric codes. Required: no.</li> <li><code>supported</code> [bool]: list only codecs supported by go-ipfs commands. Required: no.</li></ul> <h3 id="response-21"><a href="#response-21" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Code"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span><span class="token punctuation">,</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> </code></pre></div><h3 id="curl-example-21"><a href="#curl-example-21" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/cid/hashes?numeric=&#x3C;value>&#x26;supported=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-commands"><a href="#api-v0-commands" class="header-anchor">#</a> /api/v0/commands</h2> <p>List all available commands.</p> <h3 id="arguments-23"><a href="#arguments-23" class="header-anchor">#</a> Arguments</h3> <ul><li><code>flags</code> [bool]: Show command flags. Required: no.</li></ul> <h3 id="response-22"><a href="#response-22" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Options"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Names"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"Subcommands"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Options"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Names"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"Subcommands"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"..."</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-22"><a href="#curl-example-22" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/commands?flags=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-config"><a href="#api-v0-config" class="header-anchor">#</a> /api/v0/config</h2> <p>Get and set IPFS config values.</p> <h3 id="arguments-24"><a href="#arguments-24" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: The key of the config entry (e.g. "Addresses.API"). Required: <strong>yes</strong>.</li> <li><code>arg</code> [string]: The value to set the config entry to. Required: no.</li> <li><code>bool</code> [bool]: Set a boolean value. Required: no.</li> <li><code>json</code> [bool]: Parse stringified JSON. Required: no.</li></ul> <h3 id="response-23"><a href="#response-23" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Key"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Value"</span><span class="token operator">:</span> <span class="token string">"&#x3C;object>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-23"><a href="#curl-example-23" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/config?arg=&#x3C;key>&#x26;arg=&#x3C;value>&#x26;bool=&#x3C;value>&#x26;json=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-config-profile-apply"><a href="#api-v0-config-profile-apply" class="header-anchor">#</a> /api/v0/config/profile/apply</h2> <p>Apply profile to config.</p> <h3 id="arguments-25"><a href="#arguments-25" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: The profile to apply to the config. Required: <strong>yes</strong>.</li> <li><code>dry-run</code> [bool]: print difference between the current config and the config that would be generated. Required: no.</li></ul> <h3 id="response-24"><a href="#response-24" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"NewCfg"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"&#x3C;string>"</span><span class="token operator">:</span> <span class="token string">"&#x3C;object>"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token property">"OldCfg"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"&#x3C;string>"</span><span class="token operator">:</span> <span class="token string">"&#x3C;object>"</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-24"><a href="#curl-example-24" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/config/profile/apply?arg=&#x3C;profile>&#x26;dry-run=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-config-replace"><a href="#api-v0-config-replace" class="header-anchor">#</a> /api/v0/config/replace</h2> <p>Replace the config with &#x3C;file>.</p> <h3 id="arguments-26"><a href="#arguments-26" class="header-anchor">#</a> Arguments</h3> <h3 id="request-body-3"><a href="#request-body-3" class="header-anchor">#</a> Request Body</h3> <p>Argument <code>file</code> 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'.</p> <h3 id="response-25"><a href="#response-25" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-25"><a href="#curl-example-25" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/config/replace"</code></p> <hr> <h2 id="api-v0-config-show"><a href="#api-v0-config-show" class="header-anchor">#</a> /api/v0/config/show</h2> <p>Output config file contents.</p> <h3 id="arguments-27"><a href="#arguments-27" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-26"><a href="#response-26" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"&#x3C;string>"</span><span class="token operator">:</span> <span class="token string">"&#x3C;object>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-26"><a href="#curl-example-26" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/config/show"</code></p> <hr> <h2 id="api-v0-dag-export"><a href="#api-v0-dag-export" class="header-anchor">#</a> /api/v0/dag/export</h2> <p>Streams the selected DAG as a .car stream on stdout.</p> <h3 id="arguments-28"><a href="#arguments-28" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: CID of a root to recursively export Required: <strong>yes</strong>.</li> <li><code>progress</code> [bool]: Display progress on CLI. Defaults to true when STDERR is a TTY. Required: no.</li></ul> <h3 id="response-27"><a href="#response-27" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-27"><a href="#curl-example-27" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/dag/export?arg=&#x3C;root>&#x26;progress=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-dag-get"><a href="#api-v0-dag-get" class="header-anchor">#</a> /api/v0/dag/get</h2> <p>Get a DAG node from IPFS.</p> <h3 id="arguments-29"><a href="#arguments-29" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: The object to get Required: <strong>yes</strong>.</li> <li><code>output-codec</code> [string]: Format that the object will be encoded as. Default: <code>dag-json</code>. Required: no.</li></ul> <h3 id="response-28"><a href="#response-28" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-28"><a href="#curl-example-28" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/dag/get?arg=&#x3C;ref>&#x26;output-codec=dag-json"</code></p> <hr> <h2 id="api-v0-dag-import"><a href="#api-v0-dag-import" class="header-anchor">#</a> /api/v0/dag/import</h2> <p>Import the contents of .car files</p> <h3 id="arguments-30"><a href="#arguments-30" class="header-anchor">#</a> Arguments</h3> <ul><li><code>pin-roots</code> [bool]: Pin optional roots listed in the .car headers after importing. Default: <code>true</code>. Required: no.</li> <li><code>silent</code> [bool]: No output. Required: no.</li> <li><code>stats</code> [bool]: Output stats. Required: no.</li> <li><code>allow-big-block</code> [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: <code>false</code>. Required: no.</li></ul> <h3 id="request-body-4"><a href="#request-body-4" class="header-anchor">#</a> Request Body</h3> <p>Argument <code>path</code> 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'.</p> <h3 id="response-29"><a href="#response-29" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Root"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"Cid"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"/"</span><span class="token operator">:</span> <span class="token string">"&#x3C;cid-string>"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token property">"PinErrorMsg"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token property">"Stats"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"BlockBytesCount"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"BlockCount"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-29"><a href="#curl-example-29" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/dag/import?pin-roots=true&#x26;silent=&#x3C;value>&#x26;stats=&#x3C;value>&#x26;allow-big-block=false"</code></p> <hr> <h2 id="api-v0-dag-put"><a href="#api-v0-dag-put" class="header-anchor">#</a> /api/v0/dag/put</h2> <p>Add a DAG node to IPFS.</p> <h3 id="arguments-31"><a href="#arguments-31" class="header-anchor">#</a> Arguments</h3> <ul><li><code>store-codec</code> [string]: Codec that the stored object will be encoded with. Default: <code>dag-cbor</code>. Required: no.</li> <li><code>input-codec</code> [string]: Codec that the input object is encoded in. Default: <code>dag-json</code>. Required: no.</li> <li><code>pin</code> [bool]: Pin this object when adding. Required: no.</li> <li><code>hash</code> [string]: Hash function to use. Required: no.</li> <li><code>allow-big-block</code> [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: <code>false</code>. Required: no.</li></ul> <h3 id="request-body-5"><a href="#request-body-5" class="header-anchor">#</a> Request Body</h3> <p>Argument <code>object data</code> 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'.</p> <h3 id="response-30"><a href="#response-30" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Cid"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"/"</span><span class="token operator">:</span> <span class="token string">"&#x3C;cid-string>"</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-30"><a href="#curl-example-30" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/dag/put?store-codec=dag-cbor&#x26;input-codec=dag-json&#x26;pin=&#x3C;value>&#x26;hash=&#x3C;value>&#x26;allow-big-block=false"</code></p> <hr> <h2 id="api-v0-dag-resolve"><a href="#api-v0-dag-resolve" class="header-anchor">#</a> /api/v0/dag/resolve</h2> <p>Resolve IPLD block.</p> <h3 id="arguments-32"><a href="#arguments-32" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: The path to resolve Required: <strong>yes</strong>.</li></ul> <h3 id="response-31"><a href="#response-31" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Cid"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"/"</span><span class="token operator">:</span> <span class="token string">"&#x3C;cid-string>"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token property">"RemPath"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-31"><a href="#curl-example-31" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/dag/resolve?arg=&#x3C;ref>"</code></p> <hr> <h2 id="api-v0-dag-stat"><a href="#api-v0-dag-stat" class="header-anchor">#</a> /api/v0/dag/stat</h2> <p>Gets stats for a DAG.</p> <h3 id="arguments-33"><a href="#arguments-33" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: CID of a DAG root to get statistics for Required: <strong>yes</strong>.</li> <li><code>progress</code> [bool]: Return progressive data while reading through the DAG. Default: <code>true</code>. Required: no.</li></ul> <h3 id="response-32"><a href="#response-32" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"DagStats"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Cid"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"/"</span><span class="token operator">:</span> <span class="token string">"&#x3C;cid-string>"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token property">"NumBlocks"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int64>"</span><span class="token punctuation">,</span> <span class="token property">"Size"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"Ratio"</span><span class="token operator">:</span> <span class="token string">"&#x3C;float32>"</span><span class="token punctuation">,</span> <span class="token property">"SharedSize"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"TotalSize"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"UniqueBlocks"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-32"><a href="#curl-example-32" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/dag/stat?arg=&#x3C;root>&#x26;progress=true"</code></p> <hr> <h2 id="api-v0-diag-cmds"><a href="#api-v0-diag-cmds" class="header-anchor">#</a> /api/v0/diag/cmds</h2> <p>List commands run on this IPFS node.</p> <h3 id="arguments-34"><a href="#arguments-34" class="header-anchor">#</a> Arguments</h3> <ul><li><code>verbose</code> [bool]: Print extra information. Required: no.</li></ul> <h3 id="response-33"><a href="#response-33" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Active"</span><span class="token operator">:</span> <span class="token string">"&#x3C;bool>"</span><span class="token punctuation">,</span> <span class="token property">"Args"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"Command"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"EndTime"</span><span class="token operator">:</span> <span class="token string">"&#x3C;timestamp>"</span><span class="token punctuation">,</span> <span class="token property">"ID"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span><span class="token punctuation">,</span> <span class="token property">"Options"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"&#x3C;string>"</span><span class="token operator">:</span> <span class="token string">"&#x3C;object>"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token property">"StartTime"</span><span class="token operator">:</span> <span class="token string">"&#x3C;timestamp>"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> </code></pre></div><h3 id="curl-example-33"><a href="#curl-example-33" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/diag/cmds?verbose=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-diag-cmds-clear"><a href="#api-v0-diag-cmds-clear" class="header-anchor">#</a> /api/v0/diag/cmds/clear</h2> <p>Clear inactive requests from the log.</p> <h3 id="arguments-35"><a href="#arguments-35" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-34"><a href="#response-34" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-34"><a href="#curl-example-34" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/diag/cmds/clear"</code></p> <hr> <h2 id="api-v0-diag-cmds-set-time"><a href="#api-v0-diag-cmds-set-time" class="header-anchor">#</a> /api/v0/diag/cmds/set-time</h2> <p>Set how long to keep inactive requests in the log.</p> <h3 id="arguments-36"><a href="#arguments-36" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Time to keep inactive requests in log. Required: <strong>yes</strong>.</li></ul> <h3 id="response-35"><a href="#response-35" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-35"><a href="#curl-example-35" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/diag/cmds/set-time?arg=&#x3C;time>"</code></p> <hr> <h2 id="api-v0-diag-profile"><a href="#api-v0-diag-profile" class="header-anchor">#</a> /api/v0/diag/profile</h2> <p>Collect a performance profile for debugging.</p> <h3 id="arguments-37"><a href="#arguments-37" class="header-anchor">#</a> Arguments</h3> <ul><li><code>output</code> [string]: The path where the output .zip should be stored. Default: ./ipfs-profile-[timestamp].zip. Required: no.</li> <li><code>collectors</code> [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: <code>[goroutines-stack goroutines-pprof version heap allocs bin cpu mutex block trace]</code>. Required: no.</li> <li><code>profile-time</code> [string]: The amount of time spent profiling. If this is set to 0, then sampling profiles are skipped. Default: <code>30s</code>. Required: no.</li> <li><code>mutex-profile-fraction</code> [int]: The fraction 1/n of mutex contention events that are reported in the mutex profile. Default: <code>4</code>. Required: no.</li> <li><code>block-profile-rate</code> [string]: The duration to wait between sampling goroutine-blocking events for the blocking profile. Default: <code>1ms</code>. Required: no.</li></ul> <h3 id="response-36"><a href="#response-36" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-36"><a href="#curl-example-36" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/diag/profile?output=&#x3C;value>&#x26;collectors=[goroutines-stack goroutines-pprof version heap allocs bin cpu mutex block trace]&#x26;profile-time=30s&#x26;mutex-profile-fraction=4&#x26;block-profile-rate=1ms"</code></p> <hr> <h2 id="api-v0-diag-sys"><a href="#api-v0-diag-sys" class="header-anchor">#</a> /api/v0/diag/sys</h2> <p>Print system diagnostic information.</p> <h3 id="arguments-38"><a href="#arguments-38" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-37"><a href="#response-37" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-37"><a href="#curl-example-37" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/diag/sys"</code></p> <hr> <h2 id="api-v0-files-chcid"><a href="#api-v0-files-chcid" class="header-anchor">#</a> /api/v0/files/chcid</h2> <p>Change the CID version or hash function of the root node of a given path.</p> <h3 id="arguments-39"><a href="#arguments-39" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Path to change. Default: '/'. Required: no.</li> <li><code>cid-version</code> [int]: Cid version to use. (experimental). Required: no.</li> <li><code>hash</code> [string]: Hash function to use. Will set Cid version to 1 if used. (experimental). Required: no.</li></ul> <h3 id="response-38"><a href="#response-38" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-38"><a href="#curl-example-38" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/files/chcid?arg=&#x3C;path>&#x26;cid-version=&#x3C;value>&#x26;hash=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-files-cp"><a href="#api-v0-files-cp" class="header-anchor">#</a> /api/v0/files/cp</h2> <p>Add references to IPFS files and directories in MFS (or copy within MFS).</p> <h3 id="arguments-40"><a href="#arguments-40" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Source IPFS or MFS path to copy. Required: <strong>yes</strong>.</li> <li><code>arg</code> [string]: Destination within MFS. Required: <strong>yes</strong>.</li> <li><code>parents</code> [bool]: Make parent directories as needed. Required: no.</li></ul> <h3 id="response-39"><a href="#response-39" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-39"><a href="#curl-example-39" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/files/cp?arg=&#x3C;source>&#x26;arg=&#x3C;dest>&#x26;parents=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-files-flush"><a href="#api-v0-files-flush" class="header-anchor">#</a> /api/v0/files/flush</h2> <p>Flush a given path's data to disk.</p> <h3 id="arguments-41"><a href="#arguments-41" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Path to flush. Default: '/'. Required: no.</li></ul> <h3 id="response-40"><a href="#response-40" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Cid"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-40"><a href="#curl-example-40" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/files/flush?arg=&#x3C;path>"</code></p> <hr> <h2 id="api-v0-files-ls"><a href="#api-v0-files-ls" class="header-anchor">#</a> /api/v0/files/ls</h2> <p>List directories in the local mutable namespace.</p> <h3 id="arguments-42"><a href="#arguments-42" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Path to show listing for. Defaults to '/'. Required: no.</li> <li><code>long</code> [bool]: Use long listing format. Required: no.</li> <li><code>U</code> [bool]: Do not sort; list entries in directory order. Required: no.</li></ul> <h3 id="response-41"><a href="#response-41" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Entries"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Hash"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Size"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int64>"</span><span class="token punctuation">,</span> <span class="token property">"Type"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-41"><a href="#curl-example-41" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/files/ls?arg=&#x3C;path>&#x26;long=&#x3C;value>&#x26;U=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-files-mkdir"><a href="#api-v0-files-mkdir" class="header-anchor">#</a> /api/v0/files/mkdir</h2> <p>Make directories.</p> <h3 id="arguments-43"><a href="#arguments-43" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Path to dir to make. Required: <strong>yes</strong>.</li> <li><code>parents</code> [bool]: No error if existing, make parent directories as needed. Required: no.</li> <li><code>cid-version</code> [int]: Cid version to use. (experimental). Required: no.</li> <li><code>hash</code> [string]: Hash function to use. Will set Cid version to 1 if used. (experimental). Required: no.</li></ul> <h3 id="response-42"><a href="#response-42" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-42"><a href="#curl-example-42" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/files/mkdir?arg=&#x3C;path>&#x26;parents=&#x3C;value>&#x26;cid-version=&#x3C;value>&#x26;hash=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-files-mv"><a href="#api-v0-files-mv" class="header-anchor">#</a> /api/v0/files/mv</h2> <p>Move files.</p> <h3 id="arguments-44"><a href="#arguments-44" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Source file to move. Required: <strong>yes</strong>.</li> <li><code>arg</code> [string]: Destination path for file to be moved to. Required: <strong>yes</strong>.</li></ul> <h3 id="response-43"><a href="#response-43" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-43"><a href="#curl-example-43" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/files/mv?arg=&#x3C;source>&#x26;arg=&#x3C;dest>"</code></p> <hr> <h2 id="api-v0-files-read"><a href="#api-v0-files-read" class="header-anchor">#</a> /api/v0/files/read</h2> <p>Read a file from MFS.</p> <h3 id="arguments-45"><a href="#arguments-45" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Path to file to be read. Required: <strong>yes</strong>.</li> <li><code>offset</code> [int64]: Byte offset to begin reading from. Required: no.</li> <li><code>count</code> [int64]: Maximum number of bytes to read. Required: no.</li></ul> <h3 id="response-44"><a href="#response-44" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-44"><a href="#curl-example-44" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/files/read?arg=&#x3C;path>&#x26;offset=&#x3C;value>&#x26;count=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-files-rm"><a href="#api-v0-files-rm" class="header-anchor">#</a> /api/v0/files/rm</h2> <p>Remove a file from MFS.</p> <h3 id="arguments-46"><a href="#arguments-46" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: File to remove. Required: <strong>yes</strong>.</li> <li><code>recursive</code> [bool]: Recursively remove directories. Required: no.</li> <li><code>force</code> [bool]: Forcibly remove target at path; implies -r for directories. Required: no.</li></ul> <h3 id="response-45"><a href="#response-45" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-45"><a href="#curl-example-45" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/files/rm?arg=&#x3C;path>&#x26;recursive=&#x3C;value>&#x26;force=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-files-stat"><a href="#api-v0-files-stat" class="header-anchor">#</a> /api/v0/files/stat</h2> <p>Display file status.</p> <h3 id="arguments-47"><a href="#arguments-47" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Path to node to stat. Required: <strong>yes</strong>.</li> <li><code>format</code> [string]: Print statistics in given format. Allowed tokens: &#x3C;hash> &#x3C;size> &#x3C;cumulsize> &#x3C;type> &#x3C;childs> and optional &#x3C;mode> &#x3C;mode-octal> &#x3C;mtime> &#x3C;mtime-secs> &#x3C;mtime-nsecs>.Conflicts with other format options. Default: &#x3C;hash> Size: &#x3C;size> CumulativeSize: &#x3C;cumulsize> ChildBlocks: &#x3C;childs> Type: &#x3C;type> Mode: &#x3C;mode> (&#x3C;mode-octal>) Mtime: &#x3C;mtime>. Default: <code>&#x3C;hash> Size: &#x3C;size> CumulativeSize: &#x3C;cumulsize> ChildBlocks: &#x3C;childs> Type: &#x3C;type> Mode: &#x3C;mode> (&#x3C;mode-octal>) Mtime: &#x3C;mtime></code>. Required: no.</li> <li><code>hash</code> [bool]: Print only hash. Implies '--format=&#x3C;hash>'. Conflicts with other format options. Required: no.</li> <li><code>size</code> [bool]: Print only size. Implies '--format=&#x3C;cumulsize>'. Conflicts with other format options. Required: no.</li> <li><code>with-local</code> [bool]: Compute the amount of the dag that is local, and if possible the total size. Required: no.</li></ul> <h3 id="response-46"><a href="#response-46" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Blocks"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span><span class="token punctuation">,</span> <span class="token property">"CumulativeSize"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"Hash"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Local"</span><span class="token operator">:</span> <span class="token string">"&#x3C;bool>"</span><span class="token punctuation">,</span> <span class="token property">"Mode"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint32>"</span><span class="token punctuation">,</span> <span class="token property">"Mtime"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int64>"</span><span class="token punctuation">,</span> <span class="token property">"MtimeNsecs"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span><span class="token punctuation">,</span> <span class="token property">"Size"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"SizeLocal"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"Type"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"WithLocality"</span><span class="token operator">:</span> <span class="token string">"&#x3C;bool>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-46"><a href="#curl-example-46" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/files/stat?arg=&#x3C;path>&#x26;format=&#x3C;hash> Size: &#x3C;size> CumulativeSize: &#x3C;cumulsize> ChildBlocks: &#x3C;childs> Type: &#x3C;type> Mode: &#x3C;mode> (&#x3C;mode-octal>) Mtime: &#x3C;mtime>&#x26;hash=&#x3C;value>&#x26;size=&#x3C;value>&#x26;with-local=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-files-write"><a href="#api-v0-files-write" class="header-anchor">#</a> /api/v0/files/write</h2> <p>Append to (modify) a file in MFS.</p> <h3 id="arguments-48"><a href="#arguments-48" class="header-anchor">#</a> Arguments</h3> <ul><li><p><code>arg</code> [string]: Path to write to. Required: <strong>yes</strong>.</p></li> <li><p><code>offset</code> [int64]: Byte offset to begin writing at. Required: no.</p></li> <li><p><code>create</code> [bool]: Create the file if it does not exist. Required: no.</p></li> <li><p><code>parents</code> [bool]: Make parent directories as needed. Required: no.</p></li> <li><p><code>truncate</code> [bool]: Truncate the file to size zero before writing. Required: no.</p></li> <li><p><code>count</code> [int64]: Maximum number of bytes to read. Required: no.</p></li> <li><p><code>raw-leaves</code> [bool]: Use raw blocks for newly created leaf nodes. (experimental). Required: no.</p></li> <li><p><code>cid-version</code> [int]: Cid version to use. (experimental). Required: no.</p></li> <li><p><code>hash</code> [string]: Hash function to use. Will set Cid version to 1 if used. (experimental). Required: no.</p></li></ul> <h3 id="request-body-6"><a href="#request-body-6" class="header-anchor">#</a> Request Body</h3> <p>Argument <code>data</code> 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'.</p> <h3 id="response-47"><a href="#response-47" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-47"><a href="#curl-example-47" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/files/write?arg=&#x3C;path>&#x26;offset=&#x3C;value>&#x26;create=&#x3C;value>&#x26;parents=&#x3C;value>&#x26;truncate=&#x3C;value>&#x26;count=&#x3C;value>&#x26;raw-leaves=&#x3C;value>&#x26;cid-version=&#x3C;value>&#x26;hash=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-filestore-dups"><a href="#api-v0-filestore-dups" class="header-anchor">#</a> /api/v0/filestore/dups</h2> <p>List blocks that are both in the filestore and standard block storage.</p> <h3 id="arguments-49"><a href="#arguments-49" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-48"><a href="#response-48" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Err"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Ref"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-48"><a href="#curl-example-48" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/filestore/dups"</code></p> <hr> <h2 id="api-v0-filestore-ls"><a href="#api-v0-filestore-ls" class="header-anchor">#</a> /api/v0/filestore/ls</h2> <p>List objects in filestore.</p> <h3 id="arguments-50"><a href="#arguments-50" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Cid of objects to list. Required: no.</li> <li><code>file-order</code> [bool]: sort the results based on the path of the backing file. Required: no.</li></ul> <h3 id="response-49"><a href="#response-49" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"ErrorMsg"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"FilePath"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Key"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"/"</span><span class="token operator">:</span> <span class="token string">"&#x3C;cid-string>"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token property">"Offset"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"Size"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"Status"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int32>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-49"><a href="#curl-example-49" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/filestore/ls?arg=&#x3C;obj>&#x26;file-order=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-filestore-verify"><a href="#api-v0-filestore-verify" class="header-anchor">#</a> /api/v0/filestore/verify</h2> <p>Verify objects in filestore.</p> <h3 id="arguments-51"><a href="#arguments-51" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Cid of objects to verify. Required: no.</li> <li><code>file-order</code> [bool]: verify the objects based on the order of the backing file. Required: no.</li></ul> <h3 id="response-50"><a href="#response-50" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"ErrorMsg"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"FilePath"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Key"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"/"</span><span class="token operator">:</span> <span class="token string">"&#x3C;cid-string>"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token property">"Offset"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"Size"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"Status"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int32>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-50"><a href="#curl-example-50" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/filestore/verify?arg=&#x3C;obj>&#x26;file-order=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-get"><a href="#api-v0-get" class="header-anchor">#</a> /api/v0/get</h2> <p>Download IPFS objects.</p> <h3 id="arguments-52"><a href="#arguments-52" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: The path to the IPFS object(s) to be outputted. Required: <strong>yes</strong>.</li> <li><code>output</code> [string]: The path where the output should be stored. Required: no.</li> <li><code>archive</code> [bool]: Output a TAR archive. Required: no.</li> <li><code>compress</code> [bool]: Compress the output with GZIP compression. Required: no.</li> <li><code>compression-level</code> [int]: The level of compression (1-9). Required: no.</li> <li><code>progress</code> [bool]: Stream progress data. Default: <code>true</code>. Required: no.</li></ul> <h3 id="response-51"><a href="#response-51" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-51"><a href="#curl-example-51" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/get?arg=&#x3C;ipfs-path>&#x26;output=&#x3C;value>&#x26;archive=&#x3C;value>&#x26;compress=&#x3C;value>&#x26;compression-level=&#x3C;value>&#x26;progress=true"</code></p> <hr> <h2 id="api-v0-id"><a href="#api-v0-id" class="header-anchor">#</a> /api/v0/id</h2> <p>Show IPFS node id info.</p> <h3 id="arguments-53"><a href="#arguments-53" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Peer.ID of node to look up. Required: no.</li> <li><code>format</code> [string]: Optional output format. Required: no.</li> <li><code>peerid-base</code> [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: <code>b58mh</code>. Required: no.</li></ul> <h3 id="response-52"><a href="#response-52" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Addresses"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"AgentVersion"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"ID"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Protocols"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"PublicKey"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-52"><a href="#curl-example-52" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/id?arg=&#x3C;peerid>&#x26;format=&#x3C;value>&#x26;peerid-base=b58mh"</code></p> <hr> <h2 id="api-v0-key-gen"><a href="#api-v0-key-gen" class="header-anchor">#</a> /api/v0/key/gen</h2> <p>Create a new keypair</p> <h3 id="arguments-54"><a href="#arguments-54" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: name of key to create Required: <strong>yes</strong>.</li> <li><code>type</code> [string]: type of the key to create: rsa, ed25519. Default: <code>ed25519</code>. Required: no.</li> <li><code>size</code> [int]: size of the key to generate. Required: no.</li> <li><code>ipns-base</code> [string]: Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash. Takes {b58mh|base36|k|base32|b...}. Default: <code>base36</code>. Required: no.</li></ul> <h3 id="response-53"><a href="#response-53" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Id"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-53"><a href="#curl-example-53" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/key/gen?arg=&#x3C;name>&#x26;type=ed25519&#x26;size=&#x3C;value>&#x26;ipns-base=base36"</code></p> <hr> <h2 id="api-v0-key-import"><a href="#api-v0-key-import" class="header-anchor">#</a> /api/v0/key/import</h2> <p>Import a key and prints imported key id</p> <h3 id="arguments-55"><a href="#arguments-55" class="header-anchor">#</a> Arguments</h3> <ul><li><p><code>arg</code> [string]: name to associate with key in keychain Required: <strong>yes</strong>.</p></li> <li><p><code>ipns-base</code> [string]: Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash. Takes {b58mh|base36|k|base32|b...}. Default: <code>base36</code>. Required: no.</p></li> <li><p><code>format</code> [string]: The format of the private key to import, libp2p-protobuf-cleartext or pem-pkcs8-cleartext. Default: <code>libp2p-protobuf-cleartext</code>. Required: no.</p></li> <li><p><code>allow-any-key-type</code> [bool]: Allow importing any key type. Default: <code>false</code>. Required: no.</p></li></ul> <h3 id="request-body-7"><a href="#request-body-7" class="header-anchor">#</a> Request Body</h3> <p>Argument <code>key</code> 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'.</p> <h3 id="response-54"><a href="#response-54" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Id"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-54"><a href="#curl-example-54" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/key/import?arg=&#x3C;name>&#x26;ipns-base=base36&#x26;format=libp2p-protobuf-cleartext&#x26;allow-any-key-type=false"</code></p> <hr> <h2 id="api-v0-key-list"><a href="#api-v0-key-list" class="header-anchor">#</a> /api/v0/key/list</h2> <p>List all local keypairs.</p> <h3 id="arguments-56"><a href="#arguments-56" class="header-anchor">#</a> Arguments</h3> <ul><li><code>l</code> [bool]: Show extra information about keys. Required: no.</li> <li><code>ipns-base</code> [string]: Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash. Takes {b58mh|base36|k|base32|b...}. Default: <code>base36</code>. Required: no.</li></ul> <h3 id="response-55"><a href="#response-55" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Keys"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Id"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-55"><a href="#curl-example-55" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/key/list?l=&#x3C;value>&#x26;ipns-base=base36"</code></p> <hr> <h2 id="api-v0-key-rename"><a href="#api-v0-key-rename" class="header-anchor">#</a> /api/v0/key/rename</h2> <p>Rename a keypair.</p> <h3 id="arguments-57"><a href="#arguments-57" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: name of key to rename Required: <strong>yes</strong>.</li> <li><code>arg</code> [string]: new name of the key Required: <strong>yes</strong>.</li> <li><code>force</code> [bool]: Allow to overwrite an existing key. Required: no.</li> <li><code>ipns-base</code> [string]: Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash. Takes {b58mh|base36|k|base32|b...}. Default: <code>base36</code>. Required: no.</li></ul> <h3 id="response-56"><a href="#response-56" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Id"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Now"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Overwrite"</span><span class="token operator">:</span> <span class="token string">"&#x3C;bool>"</span><span class="token punctuation">,</span> <span class="token property">"Was"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-56"><a href="#curl-example-56" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/key/rename?arg=&#x3C;name>&#x26;arg=&#x3C;newName>&#x26;force=&#x3C;value>&#x26;ipns-base=base36"</code></p> <hr> <h2 id="api-v0-key-rm"><a href="#api-v0-key-rm" class="header-anchor">#</a> /api/v0/key/rm</h2> <p>Remove a keypair.</p> <h3 id="arguments-58"><a href="#arguments-58" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: names of keys to remove Required: <strong>yes</strong>.</li> <li><code>l</code> [bool]: Show extra information about keys. Required: no.</li> <li><code>ipns-base</code> [string]: Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash. Takes {b58mh|base36|k|base32|b...}. Default: <code>base36</code>. Required: no.</li></ul> <h3 id="response-57"><a href="#response-57" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Keys"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Id"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-57"><a href="#curl-example-57" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/key/rm?arg=&#x3C;name>&#x26;l=&#x3C;value>&#x26;ipns-base=base36"</code></p> <hr> <h2 id="api-v0-log-level"><a href="#api-v0-log-level" class="header-anchor">#</a> /api/v0/log/level</h2> <p>Change the logging level.</p> <h3 id="arguments-59"><a href="#arguments-59" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: The subsystem logging identifier. Use 'all' for all subsystems. Required: <strong>yes</strong>.</li> <li><code>arg</code> [string]: The log level, with 'debug' the most verbose and 'fatal' the least verbose. One of: debug, info, warn, error, dpanic, panic, fatal. Required: <strong>yes</strong>.</li></ul> <h3 id="response-58"><a href="#response-58" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Message"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-58"><a href="#curl-example-58" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/log/level?arg=&#x3C;subsystem>&#x26;arg=&#x3C;level>"</code></p> <hr> <h2 id="api-v0-log-ls"><a href="#api-v0-log-ls" class="header-anchor">#</a> /api/v0/log/ls</h2> <p>List the logging subsystems.</p> <h3 id="arguments-60"><a href="#arguments-60" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-59"><a href="#response-59" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Strings"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-59"><a href="#curl-example-59" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/log/ls"</code></p> <hr> <h2 id="api-v0-ls"><a href="#api-v0-ls" class="header-anchor">#</a> /api/v0/ls</h2> <p>List directory contents for Unix filesystem objects.</p> <h3 id="arguments-61"><a href="#arguments-61" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: The path to the IPFS object(s) to list links from. Required: <strong>yes</strong>.</li> <li><code>headers</code> [bool]: Print table headers (Hash, Size, Name). Required: no.</li> <li><code>resolve-type</code> [bool]: Resolve linked objects to find out their types. Default: <code>true</code>. Required: no.</li> <li><code>size</code> [bool]: Resolve linked objects to find out their file size. Default: <code>true</code>. Required: no.</li> <li><code>stream</code> [bool]: Enable experimental streaming of directory entries as they are traversed. Required: no.</li></ul> <h3 id="response-60"><a href="#response-60" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Objects"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Hash"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Links"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Hash"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"ModTime"</span><span class="token operator">:</span> <span class="token string">"&#x3C;timestamp>"</span><span class="token punctuation">,</span> <span class="token property">"Mode"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint32>"</span><span class="token punctuation">,</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Size"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"Target"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Type"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int32>"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-60"><a href="#curl-example-60" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/ls?arg=&#x3C;ipfs-path>&#x26;headers=&#x3C;value>&#x26;resolve-type=true&#x26;size=true&#x26;stream=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-multibase-decode"><a href="#api-v0-multibase-decode" class="header-anchor">#</a> /api/v0/multibase/decode</h2> <p>Decode multibase string</p> <h3 id="arguments-62"><a href="#arguments-62" class="header-anchor">#</a> Arguments</h3> <h3 id="request-body-8"><a href="#request-body-8" class="header-anchor">#</a> Request Body</h3> <p>Argument <code>encoded_file</code> 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'.</p> <h3 id="response-61"><a href="#response-61" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-61"><a href="#curl-example-61" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/multibase/decode"</code></p> <hr> <h2 id="api-v0-multibase-encode"><a href="#api-v0-multibase-encode" class="header-anchor">#</a> /api/v0/multibase/encode</h2> <p>Encode data into multibase string</p> <h3 id="arguments-63"><a href="#arguments-63" class="header-anchor">#</a> Arguments</h3> <ul><li><code>b</code> [string]: multibase encoding. Default: <code>base64url</code>. Required: no.</li></ul> <h3 id="request-body-9"><a href="#request-body-9" class="header-anchor">#</a> Request Body</h3> <p>Argument <code>file</code> 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'.</p> <h3 id="response-62"><a href="#response-62" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-62"><a href="#curl-example-62" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/multibase/encode?b=base64url"</code></p> <hr> <h2 id="api-v0-multibase-list"><a href="#api-v0-multibase-list" class="header-anchor">#</a> /api/v0/multibase/list</h2> <p>List available multibase encodings.</p> <h3 id="arguments-64"><a href="#arguments-64" class="header-anchor">#</a> Arguments</h3> <ul><li><code>prefix</code> [bool]: also include the single letter prefixes in addition to the code. Required: no.</li> <li><code>numeric</code> [bool]: also include numeric codes. Required: no.</li></ul> <h3 id="response-63"><a href="#response-63" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Code"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span><span class="token punctuation">,</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> </code></pre></div><h3 id="curl-example-63"><a href="#curl-example-63" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/multibase/list?prefix=&#x3C;value>&#x26;numeric=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-multibase-transcode"><a href="#api-v0-multibase-transcode" class="header-anchor">#</a> /api/v0/multibase/transcode</h2> <p>Transcode multibase string between bases</p> <h3 id="arguments-65"><a href="#arguments-65" class="header-anchor">#</a> Arguments</h3> <ul><li><code>b</code> [string]: multibase encoding. Default: <code>base64url</code>. Required: no.</li></ul> <h3 id="request-body-10"><a href="#request-body-10" class="header-anchor">#</a> Request Body</h3> <p>Argument <code>encoded_file</code> 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'.</p> <h3 id="response-64"><a href="#response-64" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-64"><a href="#curl-example-64" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/multibase/transcode?b=base64url"</code></p> <hr> <h2 id="api-v0-name-publish"><a href="#api-v0-name-publish" class="header-anchor">#</a> /api/v0/name/publish</h2> <p>Publish IPNS names.</p> <h3 id="arguments-66"><a href="#arguments-66" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: ipfs path of the object to be published. Required: <strong>yes</strong>.</li> <li><code>key</code> [string]: Name of the key to be used or a valid PeerID, as listed by 'ipfs key list -l'. Default: <code>self</code>. Required: no.</li> <li><code>resolve</code> [bool]: Check if the given path can be resolved before publishing. Default: <code>true</code>. Required: no.</li> <li><code>lifetime</code> [string]: Time duration the signed record will be valid for. Accepts durations such as "300s", "1.5h" or "7d2h45m". Default: <code>48h0m0s</code>. Required: no.</li> <li><code>ttl</code> [string]: Time duration hint, akin to --lifetime, indicating how long to cache this record before checking for updates. Default: <code>1h0m0s</code>. Required: no.</li> <li><code>quieter</code> [bool]: Write only final IPNS Name encoded as CIDv1 (for use in /ipns content paths). Required: no.</li> <li><code>v1compat</code> [bool]: Produce a backward-compatible IPNS Record by including fields for both V1 and V2 signatures. Default: <code>true</code>. Required: no.</li> <li><code>allow-offline</code> [bool]: When --offline, save the IPNS record to the local datastore without broadcasting to the network (instead of failing). Required: no.</li> <li><code>ipns-base</code> [string]: Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash. Takes {b58mh|base36|k|base32|b...}. Default: <code>base36</code>. Required: no.</li></ul> <h3 id="response-65"><a href="#response-65" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Value"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-65"><a href="#curl-example-65" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/name/publish?arg=&#x3C;ipfs-path>&#x26;key=self&#x26;resolve=true&#x26;lifetime=48h0m0s&#x26;ttl=1h0m0s&#x26;quieter=&#x3C;value>&#x26;v1compat=true&#x26;allow-offline=&#x3C;value>&#x26;ipns-base=base36"</code></p> <hr> <h2 id="api-v0-name-resolve"><a href="#api-v0-name-resolve" class="header-anchor">#</a> /api/v0/name/resolve</h2> <p>Resolve IPNS names.</p> <h3 id="arguments-67"><a href="#arguments-67" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: The IPNS name to resolve. Defaults to your node's peerID. Required: no.</li> <li><code>recursive</code> [bool]: Resolve until the result is not an IPNS name. Default: <code>true</code>. Required: no.</li> <li><code>nocache</code> [bool]: Do not use cached entries. Required: no.</li> <li><code>dht-record-count</code> [uint]: Number of records to request for DHT resolution. Default: <code>16</code>. Required: no.</li> <li><code>dht-timeout</code> [string]: Max time to collect values during DHT resolution e.g. "30s". Pass 0 for no timeout. Default: <code>1m0s</code>. Required: no.</li> <li><code>stream</code> [bool]: Stream entries as they are found. Required: no.</li></ul> <h3 id="response-66"><a href="#response-66" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Path"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-66"><a href="#curl-example-66" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/name/resolve?arg=&#x3C;name>&#x26;recursive=true&#x26;nocache=&#x3C;value>&#x26;dht-record-count=16&#x26;dht-timeout=1m0s&#x26;stream=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-pin-add"><a href="#api-v0-pin-add" class="header-anchor">#</a> /api/v0/pin/add</h2> <p>Pin objects to local storage.</p> <h3 id="arguments-68"><a href="#arguments-68" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Path to object(s) to be pinned. Required: <strong>yes</strong>.</li> <li><code>recursive</code> [bool]: Recursively pin the object linked to by the specified object(s). Default: <code>true</code>. Required: no.</li> <li><code>name</code> [string]: An optional name for created pin(s). Required: no.</li> <li><code>progress</code> [bool]: Show progress. Required: no.</li></ul> <h3 id="response-67"><a href="#response-67" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Pins"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"Progress"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-67"><a href="#curl-example-67" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/pin/add?arg=&#x3C;ipfs-path>&#x26;recursive=true&#x26;name=&#x3C;value>&#x26;progress=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-pin-ls"><a href="#api-v0-pin-ls" class="header-anchor">#</a> /api/v0/pin/ls</h2> <p>List objects pinned to local storage.</p> <h3 id="arguments-69"><a href="#arguments-69" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Path to object(s) to be listed. Required: no.</li> <li><code>type</code> [string]: The type of pinned keys to list. Can be "direct", "indirect", "recursive", or "all". Default: <code>all</code>. Required: no.</li> <li><code>quiet</code> [bool]: Output only the CIDs of pins. Required: no.</li> <li><code>name</code> [string]: Limit returned pins to ones with names that contain the value provided (case-sensitive, partial match). Implies --names=true. Required: no.</li> <li><code>stream</code> [bool]: Enable streaming of pins as they are discovered. Required: no.</li> <li><code>names</code> [bool]: Include pin names in the output (slower, disabled by default). Required: no.</li></ul> <h3 id="response-68"><a href="#response-68" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"PinLsList"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"Keys"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"&#x3C;string>"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Type"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token property">"PinLsObject"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"Cid"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Type"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-68"><a href="#curl-example-68" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/pin/ls?arg=&#x3C;ipfs-path>&#x26;type=all&#x26;quiet=&#x3C;value>&#x26;name=&#x3C;value>&#x26;stream=&#x3C;value>&#x26;names=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-pin-remote-add"><a href="#api-v0-pin-remote-add" class="header-anchor">#</a> /api/v0/pin/remote/add</h2> <p>Pin object to remote pinning service.</p> <h3 id="arguments-70"><a href="#arguments-70" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: CID or Path to be pinned. Required: <strong>yes</strong>.</li> <li><code>service</code> [string]: Name of the remote pinning service to use (mandatory). Required: no.</li> <li><code>name</code> [string]: An optional name for the pin. Required: no.</li> <li><code>background</code> [bool]: Add to the queue on the remote service and return immediately (does not wait for pinned status). Default: <code>false</code>. Required: no.</li></ul> <h3 id="response-69"><a href="#response-69" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Cid"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Status"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-69"><a href="#curl-example-69" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/pin/remote/add?arg=&#x3C;ipfs-path>&#x26;service=&#x3C;value>&#x26;name=&#x3C;value>&#x26;background=false"</code></p> <hr> <h2 id="api-v0-pin-remote-ls"><a href="#api-v0-pin-remote-ls" class="header-anchor">#</a> /api/v0/pin/remote/ls</h2> <p>List objects pinned to remote pinning service.</p> <h3 id="arguments-71"><a href="#arguments-71" class="header-anchor">#</a> Arguments</h3> <ul><li><code>service</code> [string]: Name of the remote pinning service to use (mandatory). Required: no.</li> <li><code>name</code> [string]: Return pins with names that contain the value provided (case-sensitive, exact match). Required: no.</li> <li><code>cid</code> [array]: Return pins for the specified CIDs (comma-separated). Required: no.</li> <li><code>status</code> [array]: Return pins with the specified statuses (queued,pinning,pinned,failed). Default: <code>[pinned]</code>. Required: no.</li></ul> <h3 id="response-70"><a href="#response-70" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Cid"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Status"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-70"><a href="#curl-example-70" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/pin/remote/ls?service=&#x3C;value>&#x26;name=&#x3C;value>&#x26;cid=&#x3C;value>&#x26;status=[pinned]"</code></p> <hr> <h2 id="api-v0-pin-remote-rm"><a href="#api-v0-pin-remote-rm" class="header-anchor">#</a> /api/v0/pin/remote/rm</h2> <p>Remove pins from remote pinning service.</p> <h3 id="arguments-72"><a href="#arguments-72" class="header-anchor">#</a> Arguments</h3> <ul><li><code>service</code> [string]: Name of the remote pinning service to use (mandatory). Required: no.</li> <li><code>name</code> [string]: Remove pins with names that contain provided value (case-sensitive, exact match). Required: no.</li> <li><code>cid</code> [array]: Remove pins for the specified CIDs. Required: no.</li> <li><code>status</code> [array]: Remove pins with the specified statuses (queued,pinning,pinned,failed). Default: <code>[pinned]</code>. Required: no.</li> <li><code>force</code> [bool]: Allow removal of multiple pins matching the query without additional confirmation. Default: <code>false</code>. Required: no.</li></ul> <h3 id="response-71"><a href="#response-71" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-71"><a href="#curl-example-71" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/pin/remote/rm?service=&#x3C;value>&#x26;name=&#x3C;value>&#x26;cid=&#x3C;value>&#x26;status=[pinned]&#x26;force=false"</code></p> <hr> <h2 id="api-v0-pin-remote-service-add"><a href="#api-v0-pin-remote-service-add" class="header-anchor">#</a> /api/v0/pin/remote/service/add</h2> <p>Add remote pinning service.</p> <h3 id="arguments-73"><a href="#arguments-73" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Service name. Required: <strong>yes</strong>.</li> <li><code>arg</code> [string]: Service endpoint. Required: <strong>yes</strong>.</li> <li><code>arg</code> [string]: Service key. Required: <strong>yes</strong>.</li></ul> <h3 id="response-72"><a href="#response-72" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-72"><a href="#curl-example-72" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/pin/remote/service/add?arg=&#x3C;service>&#x26;arg=&#x3C;endpoint>&#x26;arg=&#x3C;key>"</code></p> <hr> <h2 id="api-v0-pin-remote-service-ls"><a href="#api-v0-pin-remote-service-ls" class="header-anchor">#</a> /api/v0/pin/remote/service/ls</h2> <p>List remote pinning services.</p> <h3 id="arguments-74"><a href="#arguments-74" class="header-anchor">#</a> Arguments</h3> <ul><li><code>stat</code> [bool]: Try to fetch and display current pin count on remote service (queued/pinning/pinned/failed). Default: <code>false</code>. Required: no.</li></ul> <h3 id="response-73"><a href="#response-73" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"RemoteServices"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"ApiEndpoint"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Service"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Stat"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"PinCount"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"Failed"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span><span class="token punctuation">,</span> <span class="token property">"Pinned"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span><span class="token punctuation">,</span> <span class="token property">"Pinning"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span><span class="token punctuation">,</span> <span class="token property">"Queued"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token property">"Status"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-73"><a href="#curl-example-73" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/pin/remote/service/ls?stat=false"</code></p> <hr> <h2 id="api-v0-pin-remote-service-rm"><a href="#api-v0-pin-remote-service-rm" class="header-anchor">#</a> /api/v0/pin/remote/service/rm</h2> <p>Remove remote pinning service.</p> <h3 id="arguments-75"><a href="#arguments-75" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Name of remote pinning service to remove. Required: <strong>yes</strong>.</li></ul> <h3 id="response-74"><a href="#response-74" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-74"><a href="#curl-example-74" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/pin/remote/service/rm?arg=&#x3C;service>"</code></p> <hr> <h2 id="api-v0-pin-rm"><a href="#api-v0-pin-rm" class="header-anchor">#</a> /api/v0/pin/rm</h2> <p>Remove object from pin-list.</p> <h3 id="arguments-76"><a href="#arguments-76" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Path to object(s) to be unpinned. Required: <strong>yes</strong>.</li> <li><code>recursive</code> [bool]: Recursively unpin the object linked to by the specified object(s). Default: <code>true</code>. Required: no.</li></ul> <h3 id="response-75"><a href="#response-75" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Pins"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-75"><a href="#curl-example-75" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/pin/rm?arg=&#x3C;ipfs-path>&#x26;recursive=true"</code></p> <hr> <h2 id="api-v0-pin-update"><a href="#api-v0-pin-update" class="header-anchor">#</a> /api/v0/pin/update</h2> <p>Update a recursive pin.</p> <h3 id="arguments-77"><a href="#arguments-77" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Path to old object. Required: <strong>yes</strong>.</li> <li><code>arg</code> [string]: Path to a new object to be pinned. Required: <strong>yes</strong>.</li> <li><code>unpin</code> [bool]: Remove the old pin. Default: <code>true</code>. Required: no.</li></ul> <h3 id="response-76"><a href="#response-76" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Pins"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-76"><a href="#curl-example-76" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/pin/update?arg=&#x3C;from-path>&#x26;arg=&#x3C;to-path>&#x26;unpin=true"</code></p> <hr> <h2 id="api-v0-pin-verify"><a href="#api-v0-pin-verify" class="header-anchor">#</a> /api/v0/pin/verify</h2> <p>Verify that recursive pins are complete.</p> <h3 id="arguments-78"><a href="#arguments-78" class="header-anchor">#</a> Arguments</h3> <ul><li><code>verbose</code> [bool]: Also write the hashes of non-broken pins. Required: no.</li> <li><code>quiet</code> [bool]: Write just hashes of broken pins. Required: no.</li></ul> <h3 id="response-77"><a href="#response-77" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Cid"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Err"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"PinStatus"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"BadNodes"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Cid"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Err"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"Ok"</span><span class="token operator">:</span> <span class="token string">"&#x3C;bool>"</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-77"><a href="#curl-example-77" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/pin/verify?verbose=&#x3C;value>&#x26;quiet=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-ping"><a href="#api-v0-ping" class="header-anchor">#</a> /api/v0/ping</h2> <p>Send echo request packets to IPFS hosts.</p> <h3 id="arguments-79"><a href="#arguments-79" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: ID of peer to be pinged. Required: <strong>yes</strong>.</li> <li><code>count</code> [int]: Number of ping messages to send. Default: <code>10</code>. Required: no.</li></ul> <h3 id="response-78"><a href="#response-78" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Success"</span><span class="token operator">:</span> <span class="token string">"&#x3C;bool>"</span><span class="token punctuation">,</span> <span class="token property">"Text"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Time"</span><span class="token operator">:</span> <span class="token string">"&#x3C;duration-ns>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-78"><a href="#curl-example-78" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/ping?arg=&#x3C;peer ID>&#x26;count=10"</code></p> <hr> <h2 id="api-v0-refs"><a href="#api-v0-refs" class="header-anchor">#</a> /api/v0/refs</h2> <p>List links (references) from an object.</p> <h3 id="arguments-80"><a href="#arguments-80" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Path to the object(s) to list refs from. Required: <strong>yes</strong>.</li> <li><code>format</code> [string]: Emit edges with given format. Available tokens: &#x3C;src> &#x3C;dst> &#x3C;linkname>. Default: &#x3C;dst>. Default: <code>&#x3C;dst></code>. Required: no.</li> <li><code>edges</code> [bool]: Emit edge format: <code>&#x26;lt;from&#x26;gt; -&#x26;gt; &#x26;lt;to&#x26;gt;</code>. Required: no.</li> <li><code>unique</code> [bool]: Omit duplicate refs from output. Required: no.</li> <li><code>recursive</code> [bool]: Recursively list links of child nodes. Required: no.</li> <li><code>max-depth</code> [int]: Only for recursive refs, limits fetch and listing to the given depth. Default: <code>-1</code>. Required: no.</li></ul> <h3 id="response-79"><a href="#response-79" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Err"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Ref"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-79"><a href="#curl-example-79" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/refs?arg=&#x3C;ipfs-path>&#x26;format=&#x3C;dst>&#x26;edges=&#x3C;value>&#x26;unique=&#x3C;value>&#x26;recursive=&#x3C;value>&#x26;max-depth=-1"</code></p> <hr> <h2 id="api-v0-refs-local"><a href="#api-v0-refs-local" class="header-anchor">#</a> /api/v0/refs/local</h2> <p>List all local references.</p> <h3 id="arguments-81"><a href="#arguments-81" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-80"><a href="#response-80" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Err"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Ref"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-80"><a href="#curl-example-80" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/refs/local"</code></p> <hr> <h2 id="api-v0-repo-gc"><a href="#api-v0-repo-gc" class="header-anchor">#</a> /api/v0/repo/gc</h2> <p>Perform a garbage collection sweep on the repo.</p> <h3 id="arguments-82"><a href="#arguments-82" class="header-anchor">#</a> Arguments</h3> <ul><li><code>stream-errors</code> [bool]: Stream errors. Required: no.</li> <li><code>quiet</code> [bool]: Write minimal output. Required: no.</li> <li><code>silent</code> [bool]: Write no output. Required: no.</li></ul> <h3 id="response-81"><a href="#response-81" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Error"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Key"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"/"</span><span class="token operator">:</span> <span class="token string">"&#x3C;cid-string>"</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-81"><a href="#curl-example-81" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/repo/gc?stream-errors=&#x3C;value>&#x26;quiet=&#x3C;value>&#x26;silent=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-repo-ls"><a href="#api-v0-repo-ls" class="header-anchor">#</a> /api/v0/repo/ls</h2> <p>List all local references.</p> <h3 id="arguments-83"><a href="#arguments-83" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-82"><a href="#response-82" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Err"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Ref"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-82"><a href="#curl-example-82" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/repo/ls"</code></p> <hr> <h2 id="api-v0-repo-stat"><a href="#api-v0-repo-stat" class="header-anchor">#</a> /api/v0/repo/stat</h2> <p>Get stats for the currently used repo.</p> <h3 id="arguments-84"><a href="#arguments-84" class="header-anchor">#</a> Arguments</h3> <ul><li><code>size-only</code> [bool]: Only report RepoSize and StorageMax. Required: no.</li> <li><code>human</code> [bool]: Print sizes in human readable format (e.g., 1K 234M 2G). Required: no.</li></ul> <h3 id="response-83"><a href="#response-83" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"NumObjects"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"RepoPath"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"SizeStat"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"RepoSize"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"StorageMax"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token property">"Version"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-83"><a href="#curl-example-83" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/repo/stat?size-only=&#x3C;value>&#x26;human=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-repo-verify"><a href="#api-v0-repo-verify" class="header-anchor">#</a> /api/v0/repo/verify</h2> <p>Verify all blocks in repo are not corrupted.</p> <h3 id="arguments-85"><a href="#arguments-85" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-84"><a href="#response-84" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Msg"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Progress"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-84"><a href="#curl-example-84" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/repo/verify"</code></p> <hr> <h2 id="api-v0-repo-version"><a href="#api-v0-repo-version" class="header-anchor">#</a> /api/v0/repo/version</h2> <p>Show the repo version.</p> <h3 id="arguments-86"><a href="#arguments-86" class="header-anchor">#</a> Arguments</h3> <ul><li><code>quiet</code> [bool]: Write minimal output. Required: no.</li></ul> <h3 id="response-85"><a href="#response-85" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Version"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-85"><a href="#curl-example-85" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/repo/version?quiet=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-resolve"><a href="#api-v0-resolve" class="header-anchor">#</a> /api/v0/resolve</h2> <p>Resolve the value of names to IPFS.</p> <h3 id="arguments-87"><a href="#arguments-87" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: The name to resolve. Required: <strong>yes</strong>.</li> <li><code>recursive</code> [bool]: Resolve until the result is an IPFS name. Default: <code>true</code>. Required: no.</li> <li><code>dht-record-count</code> [int]: Number of records to request for DHT resolution. Required: no.</li> <li><code>dht-timeout</code> [string]: Max time to collect values during DHT resolution e.g. "30s". Pass 0 for no timeout. Required: no.</li></ul> <h3 id="response-86"><a href="#response-86" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Path"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-86"><a href="#curl-example-86" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/resolve?arg=&#x3C;name>&#x26;recursive=true&#x26;dht-record-count=&#x3C;value>&#x26;dht-timeout=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-routing-findpeer"><a href="#api-v0-routing-findpeer" class="header-anchor">#</a> /api/v0/routing/findpeer</h2> <p>Find the multiaddresses associated with a Peer ID.</p> <h3 id="arguments-88"><a href="#arguments-88" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: The ID of the peer to search for. Required: <strong>yes</strong>.</li> <li><code>verbose</code> [bool]: Print extra information. Required: no.</li></ul> <h3 id="response-87"><a href="#response-87" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Extra"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"ID"</span><span class="token operator">:</span> <span class="token string">"&#x3C;peer-id>"</span><span class="token punctuation">,</span> <span class="token property">"Responses"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Addrs"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;multiaddr-string>"</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"ID"</span><span class="token operator">:</span> <span class="token string">"peer-id"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"Type"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-87"><a href="#curl-example-87" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/routing/findpeer?arg=&#x3C;peerID>&#x26;verbose=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-routing-findprovs"><a href="#api-v0-routing-findprovs" class="header-anchor">#</a> /api/v0/routing/findprovs</h2> <p>Find peers that can provide a specific value, given a key.</p> <h3 id="arguments-89"><a href="#arguments-89" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: The key to find providers for. Required: <strong>yes</strong>.</li> <li><code>verbose</code> [bool]: Print extra information. Required: no.</li> <li><code>num-providers</code> [int]: The number of providers to find. Default: <code>20</code>. Required: no.</li></ul> <h3 id="response-88"><a href="#response-88" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Extra"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"ID"</span><span class="token operator">:</span> <span class="token string">"&#x3C;peer-id>"</span><span class="token punctuation">,</span> <span class="token property">"Responses"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Addrs"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;multiaddr-string>"</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"ID"</span><span class="token operator">:</span> <span class="token string">"peer-id"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"Type"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-88"><a href="#curl-example-88" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/routing/findprovs?arg=&#x3C;key>&#x26;verbose=&#x3C;value>&#x26;num-providers=20"</code></p> <hr> <h2 id="api-v0-shutdown"><a href="#api-v0-shutdown" class="header-anchor">#</a> /api/v0/shutdown</h2> <p>Shut down the IPFS daemon.</p> <h3 id="arguments-90"><a href="#arguments-90" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-89"><a href="#response-89" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-89"><a href="#curl-example-89" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/shutdown"</code></p> <hr> <h2 id="api-v0-stats-bitswap"><a href="#api-v0-stats-bitswap" class="header-anchor">#</a> /api/v0/stats/bitswap</h2> <p>Show some diagnostic information on the bitswap agent.</p> <h3 id="arguments-91"><a href="#arguments-91" class="header-anchor">#</a> Arguments</h3> <ul><li><code>verbose</code> [bool]: Print extra information. Required: no.</li> <li><code>human</code> [bool]: Print sizes in human readable format (e.g., 1K 234M 2G). Required: no.</li></ul> <h3 id="response-90"><a href="#response-90" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"BlocksReceived"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"BlocksSent"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"DataReceived"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"DataSent"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"DupBlksReceived"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"DupDataReceived"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"MessagesReceived"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"Peers"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"Wantlist"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"/"</span><span class="token operator">:</span> <span class="token string">"&#x3C;cid-string>"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-90"><a href="#curl-example-90" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/stats/bitswap?verbose=&#x3C;value>&#x26;human=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-stats-bw"><a href="#api-v0-stats-bw" class="header-anchor">#</a> /api/v0/stats/bw</h2> <p>Print IPFS bandwidth information.</p> <h3 id="arguments-92"><a href="#arguments-92" class="header-anchor">#</a> Arguments</h3> <ul><li><p><code>peer</code> [string]: Specify a peer to print bandwidth for. Required: no.</p></li> <li><p><code>proto</code> [string]: Specify a protocol to print bandwidth for. Required: no.</p></li> <li><p><code>poll</code> [bool]: Print bandwidth at an interval. Required: no.</p></li> <li><p><code>interval</code> [string]: Time interval to wait between updating output, if 'poll' is true.</p> <p>This accepts durations such as "300s", "1.5h" or "2h45m". Valid time units are: "ns", "us" (or "µs"), "ms", "s", "m", "h". Default: <code>1s</code>. Required: no.</p></li></ul> <h3 id="response-91"><a href="#response-91" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"RateIn"</span><span class="token operator">:</span> <span class="token string">"&#x3C;float64>"</span><span class="token punctuation">,</span> <span class="token property">"RateOut"</span><span class="token operator">:</span> <span class="token string">"&#x3C;float64>"</span><span class="token punctuation">,</span> <span class="token property">"TotalIn"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int64>"</span><span class="token punctuation">,</span> <span class="token property">"TotalOut"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int64>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-91"><a href="#curl-example-91" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/stats/bw?peer=&#x3C;value>&#x26;proto=&#x3C;value>&#x26;poll=&#x3C;value>&#x26;interval=1s"</code></p> <hr> <h2 id="api-v0-stats-dht"><a href="#api-v0-stats-dht" class="header-anchor">#</a> /api/v0/stats/dht</h2> <p>Returns statistics about the node's DHT(s).</p> <h3 id="arguments-93"><a href="#arguments-93" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [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.</li></ul> <h3 id="response-92"><a href="#response-92" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Buckets"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"LastRefresh"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Peers"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"AgentVersion"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Connected"</span><span class="token operator">:</span> <span class="token string">"&#x3C;bool>"</span><span class="token punctuation">,</span> <span class="token property">"ID"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"LastQueriedAt"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"LastUsefulAt"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-92"><a href="#curl-example-92" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/stats/dht?arg=&#x3C;dht>"</code></p> <hr> <h2 id="api-v0-stats-provide"><a href="#api-v0-stats-provide" class="header-anchor">#</a> /api/v0/stats/provide</h2> <p>Returns statistics about the node's (re)provider system.</p> <h3 id="arguments-94"><a href="#arguments-94" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-93"><a href="#response-93" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"AvgProvideDuration"</span><span class="token operator">:</span> <span class="token string">"&#x3C;duration-ns>"</span><span class="token punctuation">,</span> <span class="token property">"LastReprovideBatchSize"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"LastReprovideDuration"</span><span class="token operator">:</span> <span class="token string">"&#x3C;duration-ns>"</span><span class="token punctuation">,</span> <span class="token property">"LastRun"</span><span class="token operator">:</span> <span class="token string">"&#x3C;timestamp>"</span><span class="token punctuation">,</span> <span class="token property">"ReprovideInterval"</span><span class="token operator">:</span> <span class="token string">"&#x3C;duration-ns>"</span><span class="token punctuation">,</span> <span class="token property">"TotalProvides"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-93"><a href="#curl-example-93" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/stats/provide"</code></p> <hr> <h2 id="api-v0-stats-repo"><a href="#api-v0-stats-repo" class="header-anchor">#</a> /api/v0/stats/repo</h2> <p>Get stats for the currently used repo.</p> <h3 id="arguments-95"><a href="#arguments-95" class="header-anchor">#</a> Arguments</h3> <ul><li><code>size-only</code> [bool]: Only report RepoSize and StorageMax. Required: no.</li> <li><code>human</code> [bool]: Print sizes in human readable format (e.g., 1K 234M 2G). Required: no.</li></ul> <h3 id="response-94"><a href="#response-94" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"NumObjects"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"RepoPath"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"SizeStat"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"RepoSize"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"StorageMax"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token property">"Version"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-94"><a href="#curl-example-94" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/stats/repo?size-only=&#x3C;value>&#x26;human=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-swarm-addrs"><a href="#api-v0-swarm-addrs" class="header-anchor">#</a> /api/v0/swarm/addrs</h2> <p>List known addresses. Useful for debugging.</p> <h3 id="arguments-96"><a href="#arguments-96" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-95"><a href="#response-95" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Addrs"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"&#x3C;string>"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-95"><a href="#curl-example-95" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/swarm/addrs"</code></p> <hr> <h2 id="api-v0-swarm-addrs-listen"><a href="#api-v0-swarm-addrs-listen" class="header-anchor">#</a> /api/v0/swarm/addrs/listen</h2> <p>List interface listening addresses.</p> <h3 id="arguments-97"><a href="#arguments-97" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-96"><a href="#response-96" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Strings"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-96"><a href="#curl-example-96" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/swarm/addrs/listen"</code></p> <hr> <h2 id="api-v0-swarm-addrs-local"><a href="#api-v0-swarm-addrs-local" class="header-anchor">#</a> /api/v0/swarm/addrs/local</h2> <p>List local addresses.</p> <h3 id="arguments-98"><a href="#arguments-98" class="header-anchor">#</a> Arguments</h3> <ul><li><code>id</code> [bool]: Show peer ID in addresses. Required: no.</li></ul> <h3 id="response-97"><a href="#response-97" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Strings"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-97"><a href="#curl-example-97" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/swarm/addrs/local?id=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-swarm-connect"><a href="#api-v0-swarm-connect" class="header-anchor">#</a> /api/v0/swarm/connect</h2> <p>Open connection to a given peer.</p> <h3 id="arguments-99"><a href="#arguments-99" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Address of peer to connect to. Required: <strong>yes</strong>.</li></ul> <h3 id="response-98"><a href="#response-98" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Strings"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-98"><a href="#curl-example-98" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/swarm/connect?arg=&#x3C;address>"</code></p> <hr> <h2 id="api-v0-swarm-disconnect"><a href="#api-v0-swarm-disconnect" class="header-anchor">#</a> /api/v0/swarm/disconnect</h2> <p>Close connection to a given address.</p> <h3 id="arguments-100"><a href="#arguments-100" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Address of peer to disconnect from. Required: <strong>yes</strong>.</li></ul> <h3 id="response-99"><a href="#response-99" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Strings"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-99"><a href="#curl-example-99" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/swarm/disconnect?arg=&#x3C;address>"</code></p> <hr> <h2 id="api-v0-swarm-filters"><a href="#api-v0-swarm-filters" class="header-anchor">#</a> /api/v0/swarm/filters</h2> <p>Manipulate address filters.</p> <h3 id="arguments-101"><a href="#arguments-101" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-100"><a href="#response-100" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Strings"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-100"><a href="#curl-example-100" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/swarm/filters"</code></p> <hr> <h2 id="api-v0-swarm-filters-add"><a href="#api-v0-swarm-filters-add" class="header-anchor">#</a> /api/v0/swarm/filters/add</h2> <p>Add an address filter.</p> <h3 id="arguments-102"><a href="#arguments-102" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Multiaddr to filter. Required: <strong>yes</strong>.</li></ul> <h3 id="response-101"><a href="#response-101" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Strings"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-101"><a href="#curl-example-101" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/swarm/filters/add?arg=&#x3C;address>"</code></p> <hr> <h2 id="api-v0-swarm-filters-rm"><a href="#api-v0-swarm-filters-rm" class="header-anchor">#</a> /api/v0/swarm/filters/rm</h2> <p>Remove an address filter.</p> <h3 id="arguments-103"><a href="#arguments-103" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Multiaddr filter to remove. Required: <strong>yes</strong>.</li></ul> <h3 id="response-102"><a href="#response-102" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Strings"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-102"><a href="#curl-example-102" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/swarm/filters/rm?arg=&#x3C;address>"</code></p> <hr> <h2 id="api-v0-swarm-peering-add"><a href="#api-v0-swarm-peering-add" class="header-anchor">#</a> /api/v0/swarm/peering/add</h2> <p>Add peers into the peering subsystem.</p> <h3 id="arguments-104"><a href="#arguments-104" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: address of peer to add into the peering subsystem Required: <strong>yes</strong>.</li></ul> <h3 id="response-103"><a href="#response-103" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"ID"</span><span class="token operator">:</span> <span class="token string">"&#x3C;peer-id>"</span><span class="token punctuation">,</span> <span class="token property">"Status"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-103"><a href="#curl-example-103" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/swarm/peering/add?arg=&#x3C;address>"</code></p> <hr> <h2 id="api-v0-swarm-peering-ls"><a href="#api-v0-swarm-peering-ls" class="header-anchor">#</a> /api/v0/swarm/peering/ls</h2> <p>List peers registered in the peering subsystem.</p> <h3 id="arguments-105"><a href="#arguments-105" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-104"><a href="#response-104" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Peers"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Addrs"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;multiaddr-string>"</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"ID"</span><span class="token operator">:</span> <span class="token string">"peer-id"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-104"><a href="#curl-example-104" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/swarm/peering/ls"</code></p> <hr> <h2 id="api-v0-swarm-peering-rm"><a href="#api-v0-swarm-peering-rm" class="header-anchor">#</a> /api/v0/swarm/peering/rm</h2> <p>Remove a peer from the peering subsystem.</p> <h3 id="arguments-106"><a href="#arguments-106" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: ID of peer to remove from the peering subsystem Required: <strong>yes</strong>.</li></ul> <h3 id="response-105"><a href="#response-105" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"ID"</span><span class="token operator">:</span> <span class="token string">"&#x3C;peer-id>"</span><span class="token punctuation">,</span> <span class="token property">"Status"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-105"><a href="#curl-example-105" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/swarm/peering/rm?arg=&#x3C;ID>"</code></p> <hr> <h2 id="api-v0-swarm-peers"><a href="#api-v0-swarm-peers" class="header-anchor">#</a> /api/v0/swarm/peers</h2> <p>List peers with open connections.</p> <h3 id="arguments-107"><a href="#arguments-107" class="header-anchor">#</a> Arguments</h3> <ul><li><code>verbose</code> [bool]: display all extra information. Required: no.</li> <li><code>streams</code> [bool]: Also list information about open streams for each peer. Required: no.</li> <li><code>latency</code> [bool]: Also list information about latency to each peer. Required: no.</li> <li><code>direction</code> [bool]: Also list information about the direction of connection. Required: no.</li> <li><code>identify</code> [bool]: Also list information about peers identify. Required: no.</li></ul> <h3 id="response-106"><a href="#response-106" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Peers"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Addr"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Direction"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span><span class="token punctuation">,</span> <span class="token property">"Identify"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"Addresses"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"AgentVersion"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"ID"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Protocols"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"PublicKey"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token property">"Latency"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Muxer"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Peer"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Streams"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Protocol"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-106"><a href="#curl-example-106" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/swarm/peers?verbose=&#x3C;value>&#x26;streams=&#x3C;value>&#x26;latency=&#x3C;value>&#x26;direction=&#x3C;value>&#x26;identify=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-version"><a href="#api-v0-version" class="header-anchor">#</a> /api/v0/version</h2> <p>Show IPFS version information.</p> <h3 id="arguments-108"><a href="#arguments-108" class="header-anchor">#</a> Arguments</h3> <ul><li><code>number</code> [bool]: Only show the version number. Required: no.</li> <li><code>commit</code> [bool]: Show the commit hash. Required: no.</li> <li><code>repo</code> [bool]: Show repo version. Required: no.</li> <li><code>all</code> [bool]: Show all version information. Required: no.</li></ul> <h3 id="response-107"><a href="#response-107" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Commit"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Golang"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Repo"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"System"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Version"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-107"><a href="#curl-example-107" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/version?number=&#x3C;value>&#x26;commit=&#x3C;value>&#x26;repo=&#x3C;value>&#x26;all=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-version-check"><a href="#api-v0-version-check" class="header-anchor">#</a> /api/v0/version/check</h2> <p>Checks Kubo version against connected peers.</p> <h3 id="arguments-109"><a href="#arguments-109" class="header-anchor">#</a> Arguments</h3> <ul><li><code>min-percent</code> [int]: Percentage (1-100) of sampled peers with the new Kubo version needed to trigger an update warning. Default: <code>5</code>. Required: no.</li></ul> <h3 id="response-108"><a href="#response-108" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"GreatestVersion"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"PeersSampled"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span><span class="token punctuation">,</span> <span class="token property">"RunningVersion"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"UpdateAvailable"</span><span class="token operator">:</span> <span class="token string">"&#x3C;bool>"</span><span class="token punctuation">,</span> <span class="token property">"WithGreaterVersion"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-108"><a href="#curl-example-108" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/version/check?min-percent=5"</code></p> <hr> <h2 id="api-v0-version-deps"><a href="#api-v0-version-deps" class="header-anchor">#</a> /api/v0/version/deps</h2> <p>Shows information about dependencies used for build.</p> <h3 id="arguments-110"><a href="#arguments-110" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-109"><a href="#response-109" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Path"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"ReplacedBy"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Sum"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Version"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-109"><a href="#curl-example-109" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/version/deps"</code></p> <hr> <h2 id="experimental-rpc-commands"><a href="#experimental-rpc-commands" class="header-anchor">#</a> Experimental RPC commands</h2> <p>Below commands are experimental and should be used with care. The API may change in future releases.</p> <h2 id="api-v0-files-chmod"><a href="#api-v0-files-chmod" class="header-anchor">#</a> /api/v0/files/chmod</h2> <div class="custom-block warning"><p class="custom-block-title">EXPERIMENTAL</p> <p>This command is experimental.</p></div> <p>Change optional POSIX mode permissions</p> <h3 id="arguments-111"><a href="#arguments-111" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Mode to apply to node (numeric notation) Required: <strong>yes</strong>.</li> <li><code>arg</code> [string]: Path to apply mode Required: <strong>yes</strong>.</li></ul> <h3 id="response-110"><a href="#response-110" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-110"><a href="#curl-example-110" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/files/chmod?arg=&#x3C;mode>&#x26;arg=&#x3C;path>"</code></p> <hr> <h2 id="api-v0-files-touch"><a href="#api-v0-files-touch" class="header-anchor">#</a> /api/v0/files/touch</h2> <div class="custom-block warning"><p class="custom-block-title">EXPERIMENTAL</p> <p>This command is experimental.</p></div> <p>Set or change optional POSIX modification times.</p> <h3 id="arguments-112"><a href="#arguments-112" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Path of target to update. Required: <strong>yes</strong>.</li> <li><code>mtime</code> [int64]: Modification time in seconds before or since the Unix Epoch to apply to created UnixFS entries. Required: no.</li> <li><code>mtime-nsecs</code> [uint]: Modification time fraction in nanoseconds. Required: no.</li></ul> <h3 id="response-111"><a href="#response-111" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-111"><a href="#curl-example-111" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/files/touch?arg=&#x3C;path>&#x26;mtime=&#x3C;value>&#x26;mtime-nsecs=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-key-sign"><a href="#api-v0-key-sign" class="header-anchor">#</a> /api/v0/key/sign</h2> <div class="custom-block warning"><p class="custom-block-title">EXPERIMENTAL</p> <p>This command is experimental.</p></div> <p>Generates a signature for the given data with a specified key. Useful for proving the key ownership.</p> <h3 id="arguments-113"><a href="#arguments-113" class="header-anchor">#</a> Arguments</h3> <ul><li><code>key</code> [string]: The name of the key to use for signing. Required: no.</li> <li><code>ipns-base</code> [string]: Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash. Takes {b58mh|base36|k|base32|b...}. Default: <code>base36</code>. Required: no.</li></ul> <h3 id="request-body-11"><a href="#request-body-11" class="header-anchor">#</a> Request Body</h3> <p>Argument <code>data</code> 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'.</p> <h3 id="response-112"><a href="#response-112" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Key"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"Id"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token property">"Signature"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-112"><a href="#curl-example-112" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/key/sign?key=&#x3C;value>&#x26;ipns-base=base36"</code></p> <hr> <h2 id="api-v0-key-verify"><a href="#api-v0-key-verify" class="header-anchor">#</a> /api/v0/key/verify</h2> <div class="custom-block warning"><p class="custom-block-title">EXPERIMENTAL</p> <p>This command is experimental.</p></div> <p>Verify that the given data and signature match.</p> <h3 id="arguments-114"><a href="#arguments-114" class="header-anchor">#</a> Arguments</h3> <ul><li><code>key</code> [string]: The name of the key to use for signing. Required: no.</li> <li><code>signature</code> [string]: Multibase-encoded signature to verify. Required: no.</li> <li><code>ipns-base</code> [string]: Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash. Takes {b58mh|base36|k|base32|b...}. Default: <code>base36</code>. Required: no.</li></ul> <h3 id="request-body-12"><a href="#request-body-12" class="header-anchor">#</a> Request Body</h3> <p>Argument <code>data</code> 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'.</p> <h3 id="response-113"><a href="#response-113" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Key"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"Id"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token property">"SignatureValid"</span><span class="token operator">:</span> <span class="token string">"&#x3C;bool>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-113"><a href="#curl-example-113" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/key/verify?key=&#x3C;value>&#x26;signature=&#x3C;value>&#x26;ipns-base=base36"</code></p> <hr> <h2 id="api-v0-log-tail"><a href="#api-v0-log-tail" class="header-anchor">#</a> /api/v0/log/tail</h2> <div class="custom-block warning"><p class="custom-block-title">EXPERIMENTAL</p> <p>This command is experimental.</p></div> <p>Read the event log.</p> <h3 id="arguments-115"><a href="#arguments-115" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-114"><a href="#response-114" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-114"><a href="#curl-example-114" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/log/tail"</code></p> <hr> <h2 id="api-v0-mount"><a href="#api-v0-mount" class="header-anchor">#</a> /api/v0/mount</h2> <div class="custom-block warning"><p class="custom-block-title">EXPERIMENTAL</p> <p>This command is experimental.</p></div> <p>Mounts IPFS to the filesystem (read-only).</p> <h3 id="arguments-116"><a href="#arguments-116" class="header-anchor">#</a> Arguments</h3> <ul><li><code>ipfs-path</code> [string]: The path where IPFS should be mounted. Required: no.</li> <li><code>ipns-path</code> [string]: The path where IPNS should be mounted. Required: no.</li></ul> <h3 id="response-115"><a href="#response-115" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"FuseAllowOther"</span><span class="token operator">:</span> <span class="token string">"&#x3C;bool>"</span><span class="token punctuation">,</span> <span class="token property">"IPFS"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"IPNS"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-115"><a href="#curl-example-115" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/mount?ipfs-path=&#x3C;value>&#x26;ipns-path=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-name-inspect"><a href="#api-v0-name-inspect" class="header-anchor">#</a> /api/v0/name/inspect</h2> <div class="custom-block warning"><p class="custom-block-title">EXPERIMENTAL</p> <p>This command is experimental.</p></div> <p>Inspects an IPNS Record</p> <h3 id="arguments-117"><a href="#arguments-117" class="header-anchor">#</a> Arguments</h3> <ul><li><code>verify</code> [string]: CID of the public IPNS key to validate against. Required: no.</li> <li><code>dump</code> [bool]: Include a full hex dump of the raw Protobuf record. Default: <code>true</code>. Required: no.</li></ul> <h3 id="request-body-13"><a href="#request-body-13" class="header-anchor">#</a> Request Body</h3> <p>Argument <code>record</code> 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'.</p> <h3 id="response-116"><a href="#response-116" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Entry"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"Sequence"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span><span class="token punctuation">,</span> <span class="token property">"TTL"</span><span class="token operator">:</span> <span class="token string">"&#x3C;duration-ns>"</span><span class="token punctuation">,</span> <span class="token property">"Validity"</span><span class="token operator">:</span> <span class="token string">"&#x3C;timestamp>"</span><span class="token punctuation">,</span> <span class="token property">"ValidityType"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int64>"</span><span class="token punctuation">,</span> <span class="token property">"Value"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token property">"HexDump"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"PbSize"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span><span class="token punctuation">,</span> <span class="token property">"SignatureType"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Validation"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Reason"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Valid"</span><span class="token operator">:</span> <span class="token string">"&#x3C;bool>"</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-116"><a href="#curl-example-116" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/name/inspect?verify=&#x3C;value>&#x26;dump=true"</code></p> <hr> <h2 id="api-v0-name-pubsub-cancel"><a href="#api-v0-name-pubsub-cancel" class="header-anchor">#</a> /api/v0/name/pubsub/cancel</h2> <div class="custom-block warning"><p class="custom-block-title">EXPERIMENTAL</p> <p>This command is experimental.</p></div> <p>Cancel a name subscription.</p> <h3 id="arguments-118"><a href="#arguments-118" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Name to cancel the subscription for. Required: <strong>yes</strong>.</li></ul> <h3 id="response-117"><a href="#response-117" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Canceled"</span><span class="token operator">:</span> <span class="token string">"&#x3C;bool>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-117"><a href="#curl-example-117" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/name/pubsub/cancel?arg=&#x3C;name>"</code></p> <hr> <h2 id="api-v0-name-pubsub-state"><a href="#api-v0-name-pubsub-state" class="header-anchor">#</a> /api/v0/name/pubsub/state</h2> <div class="custom-block warning"><p class="custom-block-title">EXPERIMENTAL</p> <p>This command is experimental.</p></div> <p>Query the state of IPNS pubsub.</p> <h3 id="arguments-119"><a href="#arguments-119" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-118"><a href="#response-118" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Enabled"</span><span class="token operator">:</span> <span class="token string">"&#x3C;bool>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-118"><a href="#curl-example-118" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/name/pubsub/state"</code></p> <hr> <h2 id="api-v0-name-pubsub-subs"><a href="#api-v0-name-pubsub-subs" class="header-anchor">#</a> /api/v0/name/pubsub/subs</h2> <div class="custom-block warning"><p class="custom-block-title">EXPERIMENTAL</p> <p>This command is experimental.</p></div> <p>Show current name subscriptions.</p> <h3 id="arguments-120"><a href="#arguments-120" class="header-anchor">#</a> Arguments</h3> <ul><li><code>ipns-base</code> [string]: Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash. Takes {b58mh|base36|k|base32|b...}. Default: <code>base36</code>. Required: no.</li></ul> <h3 id="response-119"><a href="#response-119" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Strings"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-119"><a href="#curl-example-119" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/name/pubsub/subs?ipns-base=base36"</code></p> <hr> <h2 id="api-v0-p2p-close"><a href="#api-v0-p2p-close" class="header-anchor">#</a> /api/v0/p2p/close</h2> <div class="custom-block warning"><p class="custom-block-title">EXPERIMENTAL</p> <p>This command is experimental.</p></div> <p>Stop listening for new connections to forward.</p> <h3 id="arguments-121"><a href="#arguments-121" class="header-anchor">#</a> Arguments</h3> <ul><li><code>all</code> [bool]: Close all listeners. Required: no.</li> <li><code>protocol</code> [string]: Match protocol name. Required: no.</li> <li><code>listen-address</code> [string]: Match listen address. Required: no.</li> <li><code>target-address</code> [string]: Match target address. Required: no.</li></ul> <h3 id="response-120"><a href="#response-120" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token string">"&#x3C;int>"</span> </code></pre></div><h3 id="curl-example-120"><a href="#curl-example-120" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/p2p/close?all=&#x3C;value>&#x26;protocol=&#x3C;value>&#x26;listen-address=&#x3C;value>&#x26;target-address=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-p2p-forward"><a href="#api-v0-p2p-forward" class="header-anchor">#</a> /api/v0/p2p/forward</h2> <div class="custom-block warning"><p class="custom-block-title">EXPERIMENTAL</p> <p>This command is experimental.</p></div> <p>Forward connections to libp2p service.</p> <h3 id="arguments-122"><a href="#arguments-122" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Protocol name. Required: <strong>yes</strong>.</li> <li><code>arg</code> [string]: Listening endpoint. Required: <strong>yes</strong>.</li> <li><code>arg</code> [string]: Target endpoint. Required: <strong>yes</strong>.</li> <li><code>allow-custom-protocol</code> [bool]: Don't require /x/ prefix. Required: no.</li></ul> <h3 id="response-121"><a href="#response-121" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-121"><a href="#curl-example-121" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/p2p/forward?arg=&#x3C;protocol>&#x26;arg=&#x3C;listen-address>&#x26;arg=&#x3C;target-address>&#x26;allow-custom-protocol=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-p2p-listen"><a href="#api-v0-p2p-listen" class="header-anchor">#</a> /api/v0/p2p/listen</h2> <div class="custom-block warning"><p class="custom-block-title">EXPERIMENTAL</p> <p>This command is experimental.</p></div> <p>Create libp2p service.</p> <h3 id="arguments-123"><a href="#arguments-123" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Protocol name. Required: <strong>yes</strong>.</li> <li><code>arg</code> [string]: Target endpoint. Required: <strong>yes</strong>.</li> <li><code>allow-custom-protocol</code> [bool]: Don't require /x/ prefix. Required: no.</li> <li><code>report-peer-id</code> [bool]: Send remote base58 peerid to target when a new connection is established. Required: no.</li></ul> <h3 id="response-122"><a href="#response-122" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-122"><a href="#curl-example-122" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/p2p/listen?arg=&#x3C;protocol>&#x26;arg=&#x3C;target-address>&#x26;allow-custom-protocol=&#x3C;value>&#x26;report-peer-id=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-p2p-ls"><a href="#api-v0-p2p-ls" class="header-anchor">#</a> /api/v0/p2p/ls</h2> <div class="custom-block warning"><p class="custom-block-title">EXPERIMENTAL</p> <p>This command is experimental.</p></div> <p>List active p2p listeners.</p> <h3 id="arguments-124"><a href="#arguments-124" class="header-anchor">#</a> Arguments</h3> <ul><li><code>headers</code> [bool]: Print table headers (Protocol, Listen, Target). Required: no.</li></ul> <h3 id="response-123"><a href="#response-123" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Listeners"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"ListenAddress"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Protocol"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"TargetAddress"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-123"><a href="#curl-example-123" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/p2p/ls?headers=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-p2p-stream-close"><a href="#api-v0-p2p-stream-close" class="header-anchor">#</a> /api/v0/p2p/stream/close</h2> <div class="custom-block warning"><p class="custom-block-title">EXPERIMENTAL</p> <p>This command is experimental.</p></div> <p>Close active p2p stream.</p> <h3 id="arguments-125"><a href="#arguments-125" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Stream identifier Required: no.</li> <li><code>all</code> [bool]: Close all streams. Required: no.</li></ul> <h3 id="response-124"><a href="#response-124" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-124"><a href="#curl-example-124" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/p2p/stream/close?arg=&#x3C;id>&#x26;all=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-p2p-stream-ls"><a href="#api-v0-p2p-stream-ls" class="header-anchor">#</a> /api/v0/p2p/stream/ls</h2> <div class="custom-block warning"><p class="custom-block-title">EXPERIMENTAL</p> <p>This command is experimental.</p></div> <p>List active p2p streams.</p> <h3 id="arguments-126"><a href="#arguments-126" class="header-anchor">#</a> Arguments</h3> <ul><li><code>headers</code> [bool]: Print table headers (ID, Protocol, Local, Remote). Required: no.</li></ul> <h3 id="response-125"><a href="#response-125" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Streams"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"HandlerID"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"OriginAddress"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Protocol"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"TargetAddress"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-125"><a href="#curl-example-125" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/p2p/stream/ls?headers=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-routing-get"><a href="#api-v0-routing-get" class="header-anchor">#</a> /api/v0/routing/get</h2> <div class="custom-block warning"><p class="custom-block-title">EXPERIMENTAL</p> <p>This command is experimental.</p></div> <p>Given a key, query the routing system for its best value.</p> <h3 id="arguments-127"><a href="#arguments-127" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: The key to find a value for. Required: <strong>yes</strong>.</li></ul> <h3 id="response-126"><a href="#response-126" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Extra"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"ID"</span><span class="token operator">:</span> <span class="token string">"&#x3C;peer-id>"</span><span class="token punctuation">,</span> <span class="token property">"Responses"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Addrs"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;multiaddr-string>"</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"ID"</span><span class="token operator">:</span> <span class="token string">"peer-id"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"Type"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-126"><a href="#curl-example-126" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/routing/get?arg=&#x3C;key>"</code></p> <hr> <h2 id="api-v0-routing-provide"><a href="#api-v0-routing-provide" class="header-anchor">#</a> /api/v0/routing/provide</h2> <div class="custom-block warning"><p class="custom-block-title">EXPERIMENTAL</p> <p>This command is experimental.</p></div> <p>Announce to the network that you are providing given values.</p> <h3 id="arguments-128"><a href="#arguments-128" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: The key[s] to send provide records for. Required: <strong>yes</strong>.</li> <li><code>verbose</code> [bool]: Print extra information. Required: no.</li> <li><code>recursive</code> [bool]: Recursively provide entire graph. Required: no.</li></ul> <h3 id="response-127"><a href="#response-127" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Extra"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"ID"</span><span class="token operator">:</span> <span class="token string">"&#x3C;peer-id>"</span><span class="token punctuation">,</span> <span class="token property">"Responses"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Addrs"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;multiaddr-string>"</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"ID"</span><span class="token operator">:</span> <span class="token string">"peer-id"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"Type"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-127"><a href="#curl-example-127" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/routing/provide?arg=&#x3C;key>&#x26;verbose=&#x3C;value>&#x26;recursive=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-routing-put"><a href="#api-v0-routing-put" class="header-anchor">#</a> /api/v0/routing/put</h2> <div class="custom-block warning"><p class="custom-block-title">EXPERIMENTAL</p> <p>This command is experimental.</p></div> <p>Write a key/value pair to the routing system.</p> <h3 id="arguments-129"><a href="#arguments-129" class="header-anchor">#</a> Arguments</h3> <ul><li><p><code>arg</code> [string]: The key to store the value at. Required: <strong>yes</strong>.</p></li> <li><p><code>allow-offline</code> [bool]: When offline, save the IPNS record to the local datastore without broadcasting to the network instead of simply failing. Required: no.</p></li></ul> <h3 id="request-body-14"><a href="#request-body-14" class="header-anchor">#</a> Request Body</h3> <p>Argument <code>value-file</code> 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'.</p> <h3 id="response-128"><a href="#response-128" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Extra"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"ID"</span><span class="token operator">:</span> <span class="token string">"&#x3C;peer-id>"</span><span class="token punctuation">,</span> <span class="token property">"Responses"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Addrs"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;multiaddr-string>"</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"ID"</span><span class="token operator">:</span> <span class="token string">"peer-id"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"Type"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-128"><a href="#curl-example-128" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/routing/put?arg=&#x3C;key>&#x26;allow-offline=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-swarm-resources"><a href="#api-v0-swarm-resources" class="header-anchor">#</a> /api/v0/swarm/resources</h2> <div class="custom-block warning"><p class="custom-block-title">EXPERIMENTAL</p> <p>This command is experimental.</p></div> <p>Get a summary of all resources accounted for by the libp2p Resource Manager.</p> <h3 id="arguments-130"><a href="#arguments-130" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-129"><a href="#response-129" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token string">"&#x3C;object>"</span> </code></pre></div><h3 id="curl-example-129"><a href="#curl-example-129" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/swarm/resources"</code></p> <hr> <h2 id="deprecated-rpc-commands"><a href="#deprecated-rpc-commands" class="header-anchor">#</a> Deprecated RPC commands</h2> <p>Below commands are deprecated and will be removed in the future.</p> <h2 id="api-v0-dht-query"><a href="#api-v0-dht-query" class="header-anchor">#</a> /api/v0/dht/query</h2> <div class="custom-block warning"><p class="custom-block-title">DEPRECATED</p> <p>This command is deprecated.</p></div> <p>Find the closest Peer IDs to a given Peer ID by querying the DHT.</p> <h3 id="arguments-131"><a href="#arguments-131" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: The peerID to run the query against. Required: <strong>yes</strong>.</li> <li><code>verbose</code> [bool]: Print extra information. Required: no.</li></ul> <h3 id="response-130"><a href="#response-130" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Extra"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"ID"</span><span class="token operator">:</span> <span class="token string">"&#x3C;peer-id>"</span><span class="token punctuation">,</span> <span class="token property">"Responses"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Addrs"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;multiaddr-string>"</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"ID"</span><span class="token operator">:</span> <span class="token string">"peer-id"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token property">"Type"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-130"><a href="#curl-example-130" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/dht/query?arg=&#x3C;peerID>&#x26;verbose=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-object-diff"><a href="#api-v0-object-diff" class="header-anchor">#</a> /api/v0/object/diff</h2> <div class="custom-block warning"><p class="custom-block-title">DEPRECATED</p> <p>This command is deprecated.</p></div> <p>Display the diff between two IPFS objects.</p> <h3 id="arguments-132"><a href="#arguments-132" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Object to diff against. Required: <strong>yes</strong>.</li> <li><code>arg</code> [string]: Object to diff. Required: <strong>yes</strong>.</li> <li><code>verbose</code> [bool]: Print extra information. Required: no.</li></ul> <h3 id="response-131"><a href="#response-131" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Changes"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"After"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"/"</span><span class="token operator">:</span> <span class="token string">"&#x3C;cid-string>"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token property">"Before"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"/"</span><span class="token operator">:</span> <span class="token string">"&#x3C;cid-string>"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token property">"Path"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Type"</span><span class="token operator">:</span> <span class="token string">"&#x3C;int>"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-131"><a href="#curl-example-131" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/object/diff?arg=&#x3C;obj_a>&#x26;arg=&#x3C;obj_b>&#x26;verbose=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-object-patch-add-link"><a href="#api-v0-object-patch-add-link" class="header-anchor">#</a> /api/v0/object/patch/add-link</h2> <div class="custom-block warning"><p class="custom-block-title">DEPRECATED</p> <p>This command is deprecated.</p></div> <p>Deprecated way to add a link to a given dag-pb.</p> <h3 id="arguments-133"><a href="#arguments-133" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: The hash of the node to modify. Required: <strong>yes</strong>.</li> <li><code>arg</code> [string]: Name of link to create. Required: <strong>yes</strong>.</li> <li><code>arg</code> [string]: IPFS object to add link to. Required: <strong>yes</strong>.</li> <li><code>create</code> [bool]: Create intermediary nodes. Required: no.</li></ul> <h3 id="response-132"><a href="#response-132" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Hash"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Links"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Hash"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Size"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-132"><a href="#curl-example-132" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/object/patch/add-link?arg=&#x3C;root>&#x26;arg=&#x3C;name>&#x26;arg=&#x3C;ref>&#x26;create=&#x3C;value>"</code></p> <hr> <h2 id="api-v0-object-patch-rm-link"><a href="#api-v0-object-patch-rm-link" class="header-anchor">#</a> /api/v0/object/patch/rm-link</h2> <div class="custom-block warning"><p class="custom-block-title">DEPRECATED</p> <p>This command is deprecated.</p></div> <p>Deprecated way to remove a link from dag-pb object.</p> <h3 id="arguments-134"><a href="#arguments-134" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: The hash of the node to modify. Required: <strong>yes</strong>.</li> <li><code>arg</code> [string]: Name of the link to remove. Required: <strong>yes</strong>.</li></ul> <h3 id="response-133"><a href="#response-133" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Hash"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Links"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token property">"Hash"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Name"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"Size"</span><span class="token operator">:</span> <span class="token string">"&#x3C;uint64>"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-133"><a href="#curl-example-133" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/object/patch/rm-link?arg=&#x3C;root>&#x26;arg=&#x3C;name>"</code></p> <hr> <h2 id="api-v0-pubsub-ls"><a href="#api-v0-pubsub-ls" class="header-anchor">#</a> /api/v0/pubsub/ls</h2> <div class="custom-block warning"><p class="custom-block-title">DEPRECATED</p> <p>This command is deprecated.</p></div> <p>List subscribed topics by name.</p> <h3 id="arguments-135"><a href="#arguments-135" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-134"><a href="#response-134" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Strings"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-134"><a href="#curl-example-134" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/pubsub/ls"</code></p> <hr> <h2 id="api-v0-pubsub-peers"><a href="#api-v0-pubsub-peers" class="header-anchor">#</a> /api/v0/pubsub/peers</h2> <div class="custom-block warning"><p class="custom-block-title">DEPRECATED</p> <p>This command is deprecated.</p></div> <p>List peers we are currently pubsubbing with.</p> <h3 id="arguments-136"><a href="#arguments-136" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Topic to list connected peers of. Required: no.</li></ul> <h3 id="response-135"><a href="#response-135" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"Strings"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-135"><a href="#curl-example-135" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/pubsub/peers?arg=&#x3C;topic>"</code></p> <hr> <h2 id="api-v0-pubsub-pub"><a href="#api-v0-pubsub-pub" class="header-anchor">#</a> /api/v0/pubsub/pub</h2> <div class="custom-block warning"><p class="custom-block-title">DEPRECATED</p> <p>This command is deprecated.</p></div> <p>Publish data to a given pubsub topic.</p> <h3 id="arguments-137"><a href="#arguments-137" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Topic to publish to (multibase encoded when sent over HTTP RPC). Required: <strong>yes</strong>.</li></ul> <h3 id="request-body-15"><a href="#request-body-15" class="header-anchor">#</a> Request Body</h3> <p>Argument <code>data</code> 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'.</p> <h3 id="response-136"><a href="#response-136" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-136"><a href="#curl-example-136" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/pubsub/pub?arg=&#x3C;topic>"</code></p> <hr> <h2 id="api-v0-pubsub-sub"><a href="#api-v0-pubsub-sub" class="header-anchor">#</a> /api/v0/pubsub/sub</h2> <div class="custom-block warning"><p class="custom-block-title">DEPRECATED</p> <p>This command is deprecated.</p></div> <p>Subscribe to messages on a given topic.</p> <h3 id="arguments-138"><a href="#arguments-138" class="header-anchor">#</a> Arguments</h3> <ul><li><code>arg</code> [string]: Name of topic to subscribe to (multibase encoded when sent over HTTP RPC). Required: <strong>yes</strong>.</li></ul> <h3 id="response-137"><a href="#response-137" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">"data"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"from"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"seqno"</span><span class="token operator">:</span> <span class="token string">"&#x3C;string>"</span><span class="token punctuation">,</span> <span class="token property">"topicIDs"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"&#x3C;string>"</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span> </code></pre></div><h3 id="curl-example-137"><a href="#curl-example-137" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/pubsub/sub?arg=&#x3C;topic>"</code></p> <hr> <h2 id="removed-rpc-commands"><a href="#removed-rpc-commands" class="header-anchor">#</a> Removed RPC commands</h2> <p>Below commands were removed, listing them here only for documentation purposes.</p> <h2 id="api-v0-dht-findpeer"><a href="#api-v0-dht-findpeer" class="header-anchor">#</a> /api/v0/dht/findpeer</h2> <div class="custom-block warning"><p class="custom-block-title">REMOVED</p> <p>This command is removed.</p></div> <p>Removed, use 'ipfs routing' instead.</p> <h3 id="arguments-139"><a href="#arguments-139" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-138"><a href="#response-138" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-138"><a href="#curl-example-138" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/dht/findpeer"</code></p> <hr> <h2 id="api-v0-dht-findprovs"><a href="#api-v0-dht-findprovs" class="header-anchor">#</a> /api/v0/dht/findprovs</h2> <div class="custom-block warning"><p class="custom-block-title">REMOVED</p> <p>This command is removed.</p></div> <p>Removed, use 'ipfs routing' instead.</p> <h3 id="arguments-140"><a href="#arguments-140" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-139"><a href="#response-139" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-139"><a href="#curl-example-139" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/dht/findprovs"</code></p> <hr> <h2 id="api-v0-dht-get"><a href="#api-v0-dht-get" class="header-anchor">#</a> /api/v0/dht/get</h2> <div class="custom-block warning"><p class="custom-block-title">REMOVED</p> <p>This command is removed.</p></div> <p>Removed, use 'ipfs routing' instead.</p> <h3 id="arguments-141"><a href="#arguments-141" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-140"><a href="#response-140" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-140"><a href="#curl-example-140" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/dht/get"</code></p> <hr> <h2 id="api-v0-dht-provide"><a href="#api-v0-dht-provide" class="header-anchor">#</a> /api/v0/dht/provide</h2> <div class="custom-block warning"><p class="custom-block-title">REMOVED</p> <p>This command is removed.</p></div> <p>Removed, use 'ipfs routing' instead.</p> <h3 id="arguments-142"><a href="#arguments-142" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-141"><a href="#response-141" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-141"><a href="#curl-example-141" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/dht/provide"</code></p> <hr> <h2 id="api-v0-dht-put"><a href="#api-v0-dht-put" class="header-anchor">#</a> /api/v0/dht/put</h2> <div class="custom-block warning"><p class="custom-block-title">REMOVED</p> <p>This command is removed.</p></div> <p>Removed, use 'ipfs routing' instead.</p> <h3 id="arguments-143"><a href="#arguments-143" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-142"><a href="#response-142" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-142"><a href="#curl-example-142" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/dht/put"</code></p> <hr> <h2 id="api-v0-object-data"><a href="#api-v0-object-data" class="header-anchor">#</a> /api/v0/object/data</h2> <div class="custom-block warning"><p class="custom-block-title">REMOVED</p> <p>This command is removed.</p></div> <p>Removed, use 'ipfs dag' or 'ipfs files' instead.</p> <h3 id="arguments-144"><a href="#arguments-144" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-143"><a href="#response-143" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-143"><a href="#curl-example-143" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/object/data"</code></p> <hr> <h2 id="api-v0-object-get"><a href="#api-v0-object-get" class="header-anchor">#</a> /api/v0/object/get</h2> <div class="custom-block warning"><p class="custom-block-title">REMOVED</p> <p>This command is removed.</p></div> <p>Removed, use 'ipfs dag' or 'ipfs files' instead.</p> <h3 id="arguments-145"><a href="#arguments-145" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-144"><a href="#response-144" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-144"><a href="#curl-example-144" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/object/get"</code></p> <hr> <h2 id="api-v0-object-links"><a href="#api-v0-object-links" class="header-anchor">#</a> /api/v0/object/links</h2> <div class="custom-block warning"><p class="custom-block-title">REMOVED</p> <p>This command is removed.</p></div> <p>Removed, use 'ipfs dag' or 'ipfs files' instead.</p> <h3 id="arguments-146"><a href="#arguments-146" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-145"><a href="#response-145" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-145"><a href="#curl-example-145" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/object/links"</code></p> <hr> <h2 id="api-v0-object-new"><a href="#api-v0-object-new" class="header-anchor">#</a> /api/v0/object/new</h2> <div class="custom-block warning"><p class="custom-block-title">REMOVED</p> <p>This command is removed.</p></div> <p>Removed, use 'ipfs dag' or 'ipfs files' instead.</p> <h3 id="arguments-147"><a href="#arguments-147" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-146"><a href="#response-146" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-146"><a href="#curl-example-146" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/object/new"</code></p> <hr> <h2 id="api-v0-object-patch-append-data"><a href="#api-v0-object-patch-append-data" class="header-anchor">#</a> /api/v0/object/patch/append-data</h2> <div class="custom-block warning"><p class="custom-block-title">REMOVED</p> <p>This command is removed.</p></div> <p>Removed, use 'ipfs dag' or 'ipfs files' instead.</p> <h3 id="arguments-148"><a href="#arguments-148" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-147"><a href="#response-147" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-147"><a href="#curl-example-147" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/object/patch/append-data"</code></p> <hr> <h2 id="api-v0-object-patch-set-data"><a href="#api-v0-object-patch-set-data" class="header-anchor">#</a> /api/v0/object/patch/set-data</h2> <div class="custom-block warning"><p class="custom-block-title">REMOVED</p> <p>This command is removed.</p></div> <p>Removed, use 'ipfs dag' or 'ipfs files' instead.</p> <h3 id="arguments-149"><a href="#arguments-149" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-148"><a href="#response-148" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-148"><a href="#curl-example-148" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/object/patch/set-data"</code></p> <hr> <h2 id="api-v0-object-put"><a href="#api-v0-object-put" class="header-anchor">#</a> /api/v0/object/put</h2> <div class="custom-block warning"><p class="custom-block-title">REMOVED</p> <p>This command is removed.</p></div> <p>Removed, use 'ipfs dag' or 'ipfs files' instead.</p> <h3 id="arguments-150"><a href="#arguments-150" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-149"><a href="#response-149" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-149"><a href="#curl-example-149" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/object/put"</code></p> <hr> <h2 id="api-v0-object-stat"><a href="#api-v0-object-stat" class="header-anchor">#</a> /api/v0/object/stat</h2> <div class="custom-block warning"><p class="custom-block-title">REMOVED</p> <p>This command is removed.</p></div> <p>Removed, use 'ipfs dag' or 'ipfs files' instead.</p> <h3 id="arguments-151"><a href="#arguments-151" class="header-anchor">#</a> Arguments</h3> <p>This endpoint takes no arguments.</p> <h3 id="response-150"><a href="#response-150" class="header-anchor">#</a> Response</h3> <p>On success, the call to this endpoint will return with 200 and the following body:</p> <div class="language-json extra-class"><pre class="language-json"><code>This endpoint returns a `text/plain` response body. </code></pre></div><h3 id="curl-example-150"><a href="#curl-example-150" class="header-anchor">#</a> cURL Example</h3> <p><code>curl -X POST "http://127.0.0.1:5001/api/v0/object/stat"</code></p> <hr></div> <div class="content-footer" data-v-b274761c=""><div class="feedback content-feedback" data-v-063e6196="" data-v-b274761c=""><h3 data-v-063e6196="">Was this information helpful?</h3> <div class="feedback-actions" data-v-063e6196=""><button title="Yes" class="btn btn-primary" data-v-063e6196=""> Yes </button> <button title="No" class="btn btn-primary" data-v-063e6196=""> No </button></div> <!----> <div class="feedback-edit-or-issue" data-v-063e6196=""><div class="local-page-edit" data-v-063e6196=""><div class="local-edit-link"><a href="https://github.com/ipfs/ipfs-docs/edit/main/docs/reference/kubo/rpc.md" target="_blank" rel="noopener noreferrer">Edit this page</a> <span> on GitHub or <a href="https://github.com/ipfs/ipfs-docs/issues/new?assignees=&#x26;labels=need%2Ftriage&#x26;template=open_an_issue.md&#x26;title=Kubo RPC API" target="_blank" rel="noopener noreferrer">open an issue</a></span></div></div></div></div> <div class="legacy-callout" data-v-21e6796e="" data-v-b274761c=""><p data-v-21e6796e=""><b data-v-21e6796e="">Help us improve this site!</b></p> <section data-v-21e6796e=""><div class="block" data-v-21e6796e=""><ul data-v-21e6796e=""><li data-v-21e6796e=""><a href="https://github.com/ipfs/ipfs-docs/issues/new?assignees=&#x26;labels=OKR+3%3A+Content+Improvement%2C+docs-ipfs&#x26;template=content-request.md&#x26;title=%5BCONTENT+REQUEST%5D+%28add+your+title+here%21%29" target="_blank" rel="noopener noreferrer" data-v-21e6796e="">Suggest new content</a></li></ul></div> <div class="block" data-v-21e6796e=""><ul data-v-21e6796e=""><li data-v-21e6796e=""><a href="https://github.com/ipfs/ipfs-docs/issues/new?assignees=&#x26;labels=OKR+3%3A+Content+Improvement%2C+docs-ipfs&#x26;template=documentation-issue.md&#x26;title=%5BDOCS+ISSUE%5D+%28add+your+title+here%21%29" target="_blank" rel="noopener noreferrer" data-v-21e6796e="">Give general feedback</a></li></ul></div></section></div> <footer class="page-edit" data-v-b274761c=""><!----> <!----></footer> <!----></div> <div data-v-b274761c=""></div> <div data-v-b274761c=""></div> </main></div><div class="global-ui"><!----><vuecustomtooltip></vuecustomtooltip><div></div></div></div> <script src="../../../assets/js/app.6b839e87.js" defer></script><script src="../../../assets/js/2.4d957bfb.js" defer></script><script src="../../../assets/js/1.e5bd4a62.js" defer></script><script src="../../../assets/js/136.38608eea.js" defer></script> </body></html>

Pages: 1 2 3 4 5 6 7 8 9 10