Skip to main content
GET
/
public
/
v1
/
docs
/
search
Search Documents
curl --request GET \
  --url https://api.copera.ai/public/v1/docs/search \
  --header 'Authorization: Bearer <token>'
{
  "hits": [
    {
      "_id": "<string>",
      "title": "<string>",
      "parents": [
        {
          "_id": "<string>",
          "title": "<string>"
        }
      ],
      "highlight": {
        "title": "<string>",
        "mdBody": "<string>"
      },
      "createdAt": "<string>",
      "updatedAt": "<string>"
    }
  ],
  "totalHits": 123,
  "query": "<string>"
}

Overview

Searches across all documents accessible to the authenticated user using full-text search. Results include highlighted matches for easy display.

Query Parameters

  • q (required): The search query string.

Response

Returns an array of matching documents with:
  • Document ID and title
  • Highlighted snippets showing where the query matched
  • Relevance-based ordering

Authorizations

Authorization
string
header
required

Bearer token

Query Parameters

q
string
required

Search query string

sortBy

Sort field. Defaults to updatedAt.

Available options:
createdAt
sortOrder

Sort order. Defaults to desc.

Available options:
asc
limit
number

Max results (1-50). Defaults to 20.

Required range: 1 <= x <= 50

Response

Default Response

hits
object[]
required
totalHits
number
required
query
string
required