v1

latestOpenAPI 3.1.0Proprietary2026-07-262570100.1 KB
context

List documents

List knowledge sources or memories (id + metadata) for a tenant.

post/context/list

Request body

collectionstring

Collection scope. Defaults to the default collection when omitted. Formerly sub_tenant_id; the sub_tenant_id alias is still accepted (deprecated).

databasestring

Database/Collection are the canonical v2 names; TenantID/SubTenantID are their deprecated aliases (reconciled here in UnmarshalJSON and centrally by the TenantAliases middleware).

idsstring[]

When provided, only items with these IDs are returned. Pagination and filters still apply.

include_fieldsstring[]

Field projection — only the listed fields plus id, database, collection are returned. Only applies to type=knowledge.

pageinteger

Current page number (1-indexed).

page_sizeinteger

Number of items per page.

sub_tenant_idstring

deprecated: use collection

tenant_idstring

deprecated: use database

type'knowledge' | 'memory'

Bucket to list: knowledge (default) or memory.

Example request

{
  "collection": "team_docs",
  "database": "acme_corp",
  "filters": {
    "additional_metadata": {
      "author": "ada"
    },
    "metadata": {
      "department": "finance"
    }
  },
  "ids": [
    "HydraDoc1234",
    "HydraDoc4567"
  ],
  "include_fields": [
    "id",
    "title",
    "type"
  ],
  "page": 1,
  "page_size": 50,
  "sub_tenant_id": "sub_tenant_4567",
  "tenant_id": "tenant_1234",
  "type": "knowledge"
}

Response

OK

successboolean

Whether the request succeeded.

Example response

{
  "data": {
    "inner": {
      "message": "Success",
      "pagination": {
        "has_next": true,
        "page": 1,
        "page_size": 50,
        "total": 128,
        "total_pages": 3
      },
      "success": true,
      "total": 128
    }
  },
  "error": {
    "code": "DATABASE_NOT_FOUND",
    "message": "Database not found"
  },
  "meta": {
    "collection": "team_docs",
    "database": "acme_corp",
    "deprecation": [
      {
        "deprecated": true,
        "deprecated_field": "tenant_id",
        "deprecated_since": "2.0.1",
        "message": "tenant_id is deprecated; use database instead.",
        "preferred_field": "database"
      }
    ],
    "latency_ms": 12.3,
    "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
    "source_type": "file",
    "sub_tenant_id": "sub_tenant_4567",
    "tenant_id": "tenant_1234"
  },
  "success": true
}