---
title: "List documents"
method: POST
path: "/context/list"
tags: ["context"]
---

# List documents

`POST /context/list`

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

## Request body

- ListV2ListContentRequest
  - `collection` string — Collection scope. Defaults to the default collection when omitted. Formerly `sub_tenant_id`; the `sub_tenant_id` alias is still accepted (deprecated).
  - `database` string — Database/Collection are the canonical v2 names; TenantID/SubTenantID are their deprecated aliases (reconciled here in UnmarshalJSON and centrally by the TenantAliases middleware).
  - `filters` ListContentFilter
    - `additional_metadata` object — Filters /context/list by document/additional metadata. Example: {"author": "ada"}.
    - `metadata` object — Filters /context/list by tenant/source metadata. Example: {"department": "finance"}.
    - `source_fields` object — SourceFields filters by well-known source fields such as title, type, description, url, and timestamp.
  - `ids` string[] — When provided, only items with these IDs are returned. Pagination and filters still apply.
  - `include_fields` string[] — Field projection — only the listed fields plus id, database, collection are returned. Only applies to type=knowledge.
  - `page` integer — Current page number (1-indexed).
  - `page_size` integer — Number of items per page.
  - `sub_tenant_id` string — deprecated: use collection
  - `tenant_id` string — deprecated: use database
  - `type` 'knowledge' | 'memory' — Bucket to list: `knowledge` (default) or `memory`.

## Response `200`

OK

- HandlerEnvelopeListV2SourceListResponse
  - `data` ListV2SourceListResponse
    - `inner` ListSourceListResponse
      - `message` string — Human-readable result message.
      - `pagination` DashboardPaginationMeta
        - `has_next` boolean — Whether a next page exists.
        - `has_previous` boolean — Whether a previous page exists.
        - `page` integer — Current page number (1-indexed).
        - `page_size` integer — Number of items per page.
        - `total` integer — Total number of items across all pages.
        - `total_pages` integer — Total number of pages.
      - `sources` object[] — Retrieved knowledge sources or memories for this page.
      - `success` boolean — Whether the request succeeded.
      - `total` integer — Total number of items across all pages.
  - `error` HandlerApiError
    - `code` string — Machine-readable error code (e.g. `DATABASE_NOT_FOUND`).
    - `message` string — Human-readable description of the error.
  - `meta` HandlerResponseMeta
    - `api_version` string — APIVersion echoes the version of the API that served the request (PRO-1209), sourced from reqmeta.APIVersion — the same value carried by OpenAPI info.version and /health — so a client always knows which API version produced a response. Always present (no omitempty).
    - `collection` string — Collection scope. Defaults to the default collection when omitted. Formerly `sub_tenant_id`; the `sub_tenant_id` alias is still accepted (deprecated).
    - `database` string — Owning database. Formerly `tenant_id`; the `tenant_id` alias is still accepted (deprecated).
    - `deprecation` HandlerDeprecationNotice[] — Deprecation lists any migration nudges that apply to this request — the caller used a legacy /tenants route, a legacy tenant_id/sub_tenant_id field, or the deprecated sub_tenant_ids selector. It is a non-breaking signal (the status code is unchanged); omitempty keeps it absent for fully-migrated requests. A list so independent deprecations coexist without clobbering.
      - `deprecated` boolean — Whether this response concerns a deprecated field or route.
      - `deprecated_field` string — The deprecated field name.
      - `deprecated_since` string — API version when the field was deprecated.
      - `message` string — Migration guidance message.
      - `preferred_field` string — The canonical replacement for the deprecated field.
    - `latency_ms` number — Server-side processing time in milliseconds.
    - `request_id` string — Unique identifier for this request, useful for support and tracing.
    - `source_type` string — Type of the parent source (e.g. `file`, `slack`, `notion`).
    - `sub_tenant_id` string
    - `tenant_id` string
  - `success` boolean — Whether the request succeeded.

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.dev/hydradb/apis/hydradb-application-api.md) · [All operations](https://skmtc.dev/hydradb/apis/hydradb-application-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hydradb/hydradb-application-api/revisions/c773cb4e113a/schema)
