Skip to main content
GET
/
api
/
v1
/
rag
/
document
List documents in a knowledge base
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://blackbox.dasha.ai/api/v1/rag/document', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "items": [
    {
      "documentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "knowledgeBaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "originalFileName": "<string>",
      "contentType": "<string>",
      "sizeBytes": 123,
      "contentHash": "<string>",
      "status": "Uploaded",
      "processingStartedAt": "2023-11-07T05:31:56Z",
      "processingCompletedAt": "2023-11-07T05:31:56Z",
      "errorMessage": "<string>",
      "metadata": {},
      "createdAt": "2023-11-07T05:31:56Z",
      "lastUpdatedAt": "2023-11-07T05:31:56Z"
    }
  ],
  "totalItems": 123
}

Query Parameters

kbId
string<uuid>

Knowledge base ID

status
enum<string>

Filter by status (optional)

Available options:
Uploaded,
Queued,
Processing,
Indexed,
Failed,
Cancelled,
PendingDelete,
Deleting
skip
integer<int32>
default:0

Optional, skip N records. Default 0

Required range: 0 <= x <= 2147483647
take
integer<int32>
default:20

Optional, take M records. Default 20

Required range: 1 <= x <= 1000

Response

OK

items
object[]
required
totalItems
integer<int32>
required