---
title: "Search files by relevance"
method: GET
path: "/api/projects/{project_id}/file_system/search/"
tags: ["file_system"]
---

# Search files by relevance

`GET /api/projects/{project_id}/file_system/search/`

## Request

- Base URL: `https://us.posthog.com`
- URL: `https://us.posthog.com/api/projects/{project_id}/file_system/search/`
- Auth: HTTP bearer

Ranks entries by words matched, typos, word proximity, name before folder, exact words, word position, exactness, the user's recent views, and recency.

## Path parameters

- `project_id` string, required

## Query parameters

- `limit` integer
- `per_type` integer
- `search` string, required

## Response `200`

- FileSystemRankedSearchResponse
  - `results` FileSystemRankedSearchItem[], required: Matches, best first.
    - `entry` FileSystem, required
      - `id` string, uuid, required
      - `path` string, required
      - `depth` integer, nullable, required
      - `type` string
      - `ref` string, nullable
      - `href` string, nullable
      - `meta` unknown
      - `shortcut` boolean, nullable
      - `created_at` string, date-time, required
      - `created_by` UserBasic, required
        - `id` integer, required
        - `uuid` string, uuid, required
        - `distinct_id` string, nullable
        - `first_name` string
        - `last_name` string
        - `email` string, email, required
        - `is_email_verified` boolean, nullable
        - `hedgehog_config` object, nullable, required
        - `role_at_organization` union
          - 'engineering' | 'data' | 'product' | 'founder' | 'leadership' | 'marketing' | 'sales' | 'student' | 'other': * `engineering` - Engineering * `data` - Data * `product` - Product Management * `founder` - Founder * `leadership` - Leadership * `marketing` - Marketing * `sales` - Sales / Success * `student` - Student * `other` - Other
          - ''
          - unknown
      - `last_viewed_at` string, date-time, nullable, required
      - `user_access_level` string, nullable, required: Resolved access level the user has for the object this entry references ('none' means the user can't open it). Null when access controls don't apply to the entry type.
    - `rank` integer[], required: Sort key of the match. Lower sorts first. Compare element by element with other results.
  - `matched_all_words` boolean, required: True when every result contains every search word. False when no entry matched every word and the results match only some words.
  - `matched_words` string[], required: Search words that the best result matched. Use it to tell the user which words were dropped when matched_all_words is false.
  - `type_counts` FileSystemRankedSearchTypeCount[], required: Number of matches for each type, largest first.
    - `type` string, required: File system type, for example insight or dashboard.
    - `count` integer, required: Number of matches of this type.
  - `matched_with_typos` boolean, required: True when no entry matched the words as typed, so every result is a close spelling.
  - `counts_capped` boolean, required: True when the search stopped at its candidate limit, so type_counts are lower bounds.

## Changes

> 53 revisions in range; 1 not diffed.

- **2026-10-22** `5467bde4cb3b`: 1 info
  - endpoint added
  - …this revision’s changelog is incomplete

[Operation history](https://skmtc.dev/posthog/apis/posthog-api/changes/api/projects/:project_id/file_system/search/get.md)

---

[API](https://skmtc.dev/posthog/apis/posthog-api.md) · [All operations](https://skmtc.dev/posthog/apis/posthog-api/llms.txt) · [OpenAPI document](https://skmtc.dev/posthog/apis/posthog-api/revisions/993f70ab941b?raw)
