Skip to main content
GET
/
threads
/
{thread_id}
/
messages
/
search
Search Messages
curl --request GET \
  --url https://api.puppeteerai.com/threads/{thread_id}/messages/search \
  --header 'Authorization: <authorization>'
{
  "matches": [
    {
      "message_id": "<string>",
      "prev_cursor": "<string>",
      "next_cursor": "<string>",
      "context": [
        {
          "message_id": "<string>",
          "role": "<string>",
          "message": "<string>",
          "timestamp": 123
        }
      ]
    }
  ],
  "pagination": {
    "cursor": "<string>"
  }
}

Headers

Authorization
string
required

Path Parameters

thread_id
string
required

Query Parameters

query
string
required

The text to search for within messages.

cursor
string | null

Base64-encoded pagination cursor. If not provided, retrieves the first batch of results.

limit
integer
default:20

Maximum number of search results to return per page.

context_size
integer
default:10

Number of messages to include before and after each match to provide conversation context.

Response

Successful Response

matches
SearchMatch · object[]
required

List of search matches with context.

pagination
CursorPagination · object
required