Skip to main content
POST
/
api
/
v3
/
search
Search document chunks
curl --request POST \
  --url https://api.lighton.ai/api/v3/search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>",
  "max_results": 10,
  "workspace_id": [
    123
  ],
  "tag_id": [
    123
  ],
  "file_id": [
    123
  ],
  "mode": "text",
  "skip_rerank": false,
  "include_image": false
}
'
{
  "results": [
    {
      "chunk_id": "550e8400-e29b-41d4-a716-446655440000",
      "content": "JWT tokens are signed using RS256 and expire after 1 hour.",
      "score": {
        "retrieval": 0.92,
        "reranking": 0.95
      },
      "source": {
        "file_id": 512,
        "filename": "auth-system.pdf",
        "title": "Authentication System Design",
        "mime_type": "pdf",
        "size_bytes": 482113,
        "page_start": 3,
        "page_end": 4,
        "total_pages": 12,
        "tags": [
          {
            "id": 7,
            "name": "security"
          }
        ],
        "external_metadata": null
      },
      "workspace": {
        "id": 42,
        "name": "Engineering Docs"
      }
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://developers.lighton.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

query
string
required

Natural-language search query. Maximum 1500 characters.

Maximum string length: 1500
max_results
integer
default:10

Maximum number of chunks to return after reranking. Range: 1–50.

Required range: 1 <= x <= 50
workspace_id
integer[]

Restrict search to these workspace IDs. Cannot combine with file_id.

tag_id
integer[]

Restrict to documents carrying any of these tag IDs (OR). Cannot combine with file_id.

file_id
integer[]

Restrict to specific file IDs. Cannot combine with workspace_id or tag_id.

mode
enum<string>
default:text

"text": hybrid keyword + vector search. "vision": VLM-embedded page image search.

  • text - text
  • vision - vision
Available options:
text,
vision
skip_rerank
boolean
default:false

Skip reranking for lower latency. In the response, score.reranking will be null.

include_image
boolean
default:false

Append a base64-encoded page image to each result.

Response

Ranked search results.

results
object[]
required

Ranked search results.