---
title: "Search Project Messages"
method: GET
path: "/projects/{project_id}/messages/search"
tags: ["Messages"]
---

# Search Project Messages

`GET /projects/{project_id}/messages/search`

## Request

- Base URL: `https://api.puppeteerai.com`
- URL: `https://api.puppeteerai.com/projects/{project_id}/messages/search`
- Auth: none declared. Required headers: `Authorization`

Newest-first messages across a project's threads that contain the query text.

## Path parameters

- `project_id` string, required

## Query parameters

- `query` string, required
- `types` string: Comma-separated thread types to search.
- `cursor` string, nullable
- `limit` integer

## Headers

- `Authorization` string, required

## Response `200`

Successful Response

- ProjectMessageSearchResponse
  - `results` ProjectMessageSearchResult[], required
    - `message_id` string, required
    - `thread_id` string, required
    - `conversation_id` integer, required
    - `role` string, required: The role of the sender: "user", "AI", "admin", or "system".
    - `snippet` string, required: The message text around the first match, cut at SNIPPET_RADIUS each side.
    - `snippet_starts_mid_text` boolean, required
    - `snippet_ends_mid_text` boolean, required
    - `timestamp` integer, required: Unix timestamp (seconds) when the message was sent.
    - `thread_alias` string, nullable, required
    - `thread_type` string, required
    - `user_phone_number` string, nullable, required
    - `voice_user_phone_number` string, nullable, required
  - `cursor` string, nullable, required: Cursor for the next page, or null when there are no more results.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/getpuppeteer/apis/puppeteer-core-api.md) - [All operations](https://skmtc.dev/getpuppeteer/apis/puppeteer-core-api/llms.txt) - [OpenAPI document](https://skmtc.dev/getpuppeteer/apis/puppeteer-core-api/revisions/94b4e928b42f?raw)
