Run an on-demand mention search
Runs a one-time search for query across the workspace’s enabled sources over the last 1/7/30 days and AI-scores the results inline using the workspace’s company profile. Results belong to the search (they do NOT appear in the mentions feed); new results count against the monthly mention quota, while results the workspace already collected are flagged alreadyInWorkspace and are free.
Blocks up to waitMs (≤25s). Returns 200 with the full result envelope if it finishes in time, otherwise 202 with a searchId + pollUrl to poll GET /api/v2/search/{searchId}.
Responses carry remaining-quota headers (X-Octolens-Mentions-Remaining always; X-Octolens-Searches-Remaining on plans with a lifetime search cap) so clients can self-throttle before hitting the quota wall.
Authorizations
Clerk API key. Create one in Settings → API Keys. Pass as Authorization: Bearer <key>. Keys carry a scope — read, write (implies read) or admin (implies write) — chosen when the key is minted. Each operation's security requirement (and its x-required-scope extension) names the minimum scope it needs; request the least-privileged key that covers the operations you call.
Body
On-demand mention search request.
Display flag only. When true, mentions the AI judged NOT relevant are also returned (marked relevance: "not_relevant"). This does NOT change billing or persistence: every mention that reaches AI scoring is saved to the search and counts against the monthly quota regardless of this flag — it only controls what the response shows. Default false.
Response
200 response
Completed on-demand search.
