From fce5f589caba57d8a9602fae14d42d53836dca98 Mon Sep 17 00:00:00 2001 From: wrvnnull <122137078+wrvnnull@users.noreply.github.com> Date: Fri, 28 Aug 2026 01:43:49 +0800 Subject: [PATCH] docs: fix /api/v0/dag/import response to JSONL (closes #1980) The endpoint returns a JSONL body (one JSON object per line), not a single JSON document. The Stats record only appears when stats=true. Updates the documented response example to match actual behavior. --- docs/reference/kubo/rpc.md | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/docs/reference/kubo/rpc.md b/docs/reference/kubo/rpc.md index d024bf7c8..a65f2dbe9 100644 --- a/docs/reference/kubo/rpc.md +++ b/docs/reference/kubo/rpc.md @@ -1131,24 +1131,15 @@ Argument `path` is of file type. This endpoint expects one or several files (dep ### Response -On success, the call to this endpoint will return with 200 and the following body: - -```json -{ - "Root": { - "Cid": { - "/": "" - }, - "PinErrorMsg": "" - }, - "Stats": { - "BlockBytesCount": "", - "BlockCount": "" - } -} +On success, the call to this endpoint will return with 200 and a +**JSONL** body (one JSON object per line, not a single JSON document): +```jsonl +{"Root":{"Cid":{"/":""},"PinErrorMsg":"string"}} +{"Stats":{"BlockCount":,"BlockBytesCount":}} ``` +The `Stats` record is only present when the `stats=true` argument is provided. ### cURL Example `curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/dag/import?pin-roots=&local-only=&silent=&stats=&fast-provide-root=&fast-provide-dag=&fast-provide-wait=&allow-big-block=false"`