---
title: "Team access: Search documents across bases in the shared collection."
method: GET
path: "/api/teams/{organization_id}/collections/{collection_id}/search"
---

# Team access: Search documents across bases in the shared collection.

`GET /api/teams/{organization_id}/collections/{collection_id}/search`

## Request

- Base URL: `https://okfindex.com`
- URL: `https://okfindex.com/api/teams/{organization_id}/collections/{collection_id}/search`
- Auth: none declared

Team access uses current account membership, product access and resource sharing on every request. Revocation also blocks search, originals, Markdown, OKF and ZIP downloads with an existing session or key. Sharing a collection grants current and future files in its owner's referenced bases; other owners' bases expose published files only. Sharing does not publish a resource. Only the resource owner changes sharing. The initial grant requires the owner's session with origin and CSRF checks. Organization API keys stay within their existing grants. Responses use private, no-store.
Returns: { query, items[{document,base,snippet}], next }

## Path parameters

- `organization_id` string, required
- `collection_id` string, required

## Query parameters

- `q` string, required
- `after` string

## Response `200`

{ query, items[{document,base,snippet}], next }

- object
  - `query` string, required: The requested word or phrase.
  - `items` CollectionSearchResult[], required: Matching documents, their base of origin and a bounded excerpt.
    - `document` Document, required
      - `id` string, required: The 64-character ID returned by the API.
      - `base_id` string, required: The 64-character ID returned by the API.
      - `filename` string, required: Original filename.
      - `title` string, required: Filename without extension.
      - `format` string, required: md, txt, pdf, docx or doc after conversion.
      - `managed` string, nullable, required: dataset for generated metadata; edit through save_base_dataset. Null for ordinary files.
      - `sha256` string, required: SHA-256 of stored UTF-8 text. Converted source hash is source_sha256.
      - `bytes` integer, required: Stored UTF-8 text size in bytes.
      - `status` string, required: ready or pending.
      - `created_at` string, required: Upload date, ISO 8601.
      - `api` string, required: JSON with Markdown.
      - `source_url` string, nullable: Present on document reads: source URL preserved with this version, or null for manual uploads. Also included in the exported OKF concept.
      - `source_sha256` string: SHA-256 of the original converted file.
      - `pages` integer: PDF physical page count. Zero for continuous DOC and DOCX text.
      - `review` object: PDF: completed automated review. DOC/DOCX: not_applicable, null model and zero pages reviewed.
      - `markdown_url` string, required: Markdown download.
      - `original_url` string, required: Original file download.
      - `okf_url` string, required: OKF concept URL.
    - `base` CollectionOrigin, required
      - `id` string, required: The 64-character ID returned by this API.
      - `name` string, required: Name of the base that contains the matching document.
      - `api` string, required: Base API URL for the current viewer.
      - `public_url` string, nullable, required: Public base page, or null for an owned private base.
    - `snippet` string, required: Source excerpt of up to 360 characters.
  - `next` string, nullable, required: Next page URL, or null when the bounded result is complete.

## Other responses

- `400`: Invalid query or cursor.
- `401`: A valid session or organization API key is required.
- `403`: Organization access requires the correct credential and, when applicable, MFA.
- `404`: The organization, resource or sharing grant is inaccessible.
- `405`: Team access is read-only.
- `409`: A file is not ready for export.
- `503`: Account or knowledge storage is unavailable.

---

[API](https://skmtc.dev/okfindex/apis/okf-index.md) · [All operations](https://skmtc.dev/okfindex/apis/okf-index/llms.txt) · [OpenAPI document](https://skmtc.dev/okfindex/apis/okf-index/revisions/4b13ca3c739f?raw)
