Skip to main content
GET
/
kb
/
files
List files in a knowledge base
curl --request GET \
  --url https://asteragents.com/api/kb/files \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "files": [
    {
      "id": 456,
      "knowledgeBaseId": 123,
      "fileId": "550e8400-e29b-41d4-a716-446655440000",
      "fileName": "quarterly-report.pdf",
      "fileKey": "org_xxx/uploads/550e8400-e29b-41d4-a716-446655440000/quarterly-report.pdf",
      "contentKey": "org_xxx/contents/550e8400-e29b-41d4-a716-446655440000.md",
      "contentType": "application/pdf",
      "processingStatus": "completed",
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-01-15T10:35:00.000Z",
      "fileSize": 1048576,
      "processingError": null,
      "imageKeys": [
        "org_xxx/images/file-uuid/page-1.png",
        "org_xxx/images/file-uuid/page-2.png"
      ],
      "userMetadata": {},
      "extractedData": {}
    }
  ]
}

Authorizations

Authorization
string
header
required

JWT token from Clerk authentication.

Must be from a user with org:admin role.

Query Parameters

kbId
integer
required

The ID of the knowledge base

Example:

123

Response

Successfully retrieved files

success
boolean
required
files
object[]
required