For the complete documentation index, see llms.txt. This page is also available as Markdown.

GET /v1/knowledge-bases/{knowledge_base_id}/resources/{resource_id}

Get Resource By Id

get

Get one file resource by ID from the knowledge base.

How to use

Poll this after upload/sync. indexed indicates readiness; error needs investigation. pending_delete/deleted should not be treated as available search content.

Authentication and permissions

Required permissions: kbs.read. Resource and owner access checks also apply.

Authorizations
AuthorizationstringRequired

Personal API key (sk_...) or supported user access JWT. See Authentication and authorization for endpoint restrictions and scopes. Use exactly one Authorization header.

Path parameters
knowledge_base_idstring · uuidRequired
resource_idstring · uuidRequired
Responses
200

Successful Response

application/json

A file stored in a knowledge base.

knowledge_base_idstring · uuidRequired
created_atstring · date-timeRequired
modified_atstring · date-timeRequired
indexed_atstring · date-time · nullableOptional
resource_idstring · uuid · nullableRequired
resource_pathstring · min: 1Required
dataloader_metadataobject · Dataloader MetadataOptional
user_metadataobject · User MetadataOptional
content_hashstring · min: 1Required
content_mimestring · min: 1Required
sizeintegerRequired
statusstring · enumRequired

Processing status of a file in a knowledge base.

Possible values:
effective_permissionsstring[] · nullableOptional

Viewer's effective permissions for this file; null when not computed.

get/v1/knowledge-bases/{knowledge_base_id}/resources/{resource_id}
curl
curl --fail-with-body -sS \
  "$STACKAI_BASE_URL/v1/knowledge-bases/${KNOWLEDGE_BASE_ID}/resources/${RESOURCE_ID}" \
  -H "Authorization: Bearer $STACKAI_API_KEY"
{
  "knowledge_base_id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2026-01-01T00:00:00.000Z",
  "modified_at": "2026-01-01T00:00:00.000Z",
  "indexed_at": "2026-01-01T00:00:00.000Z",
  "resource_id": "123e4567-e89b-12d3-a456-426614174000",
  "resource_path": "text",
  "dataloader_metadata": {
    "^[^\\t\\n\\r\\f\\v]+$": null
  },
  "user_metadata": {
    "^[^\\t\\n\\r\\f\\v]+$": null
  },
  "content_hash": "text",
  "content_mime": "text",
  "size": 1,
  "status": "resource",
  "effective_permissions": [
    "text"
  ]
}

Last updated

Was this helpful?