---
title: "Home Search"
method: GET
path: "/api/v1/home-search"
tags: ["Chat"]
---

# Home Search

`GET /api/v1/home-search`

## Request

- Base URL: `https://backend.caspr.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://backend.caspr.ai/api/v1/home-search`
- Auth: OAuth 2
  - Password
  - Token URL: `token`

Homepage search across the authenticated user's chats and reports.

Each result represents a chat (one row per chat); when the chat has a
generated report, the latest report's title/poster are surfaced too.
The search query (``q``) matches case-insensitively against both
``chat_title`` and the latest report's ``title``. The ``matched_on``
field on each item indicates which field actually matched.

All filters are additive (AND). Chats with no report are treated as
having status ``draft`` and domain ``standard``.

Authentication Required: Yes (JWT token)

## Query parameters

- `q` string, nullable: Case-insensitive substring matched against chat title and latest report title
- `domain` string, nullable: Comma-separated category slugs to filter by (e.g. 'standard,due_diligence')
- `status` string, nullable: Comma-separated report status values to filter by (e.g. 'draft,analysis-completed')
- `created_after` string, nullable: ISO-8601 datetime; only chats created at/after this time are returned
- `created_before` string, nullable: ISO-8601 datetime; only chats created at/before this time are returned
- `limit` integer: Page size
- `offset` integer: Pagination offset

## Response `200`

Successful Response

- HomeSearchResponse: Response for GET /home-search.
  - `success` boolean
  - `total` integer, required: Total matching items (use with limit/offset)
  - `limit` integer, required: Page size applied
  - `offset` integer, required: Offset applied
  - `items` HomeSearchItem[]: Search hits page
    - `chat_id` string, required: Chat identifier
    - `chat_title` string, nullable: Chat title
    - `report_id` string, nullable: Latest report id, if any
    - `report_title` string, nullable: Latest report title, if any
    - `status` string, required: Status of the latest report; 'draft' if no report exists
    - `domain` string, required: Report domain slug (default surfaced as 'standard')
    - `poster_image_url` string, nullable: Poster/thumbnail CDN URL
    - `created_at` string, nullable: Chat created_at, ISO-8601
    - `updated_at` string, nullable: Chat updated_at, ISO-8601
    - `matched_on` string, required: Where the search hit matched: 'chat_title', 'report_title', or 'both'

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `422`: Validation Error
- `500`: Internal Server Error

---

[API](https://skmtc.dev/caspr/apis/casper-api.md) - [All operations](https://skmtc.dev/caspr/apis/casper-api/llms.txt) - [OpenAPI document](https://skmtc.dev/caspr/apis/casper-api/revisions/f9765e3aa00c?raw)
