Skip to content

Search

Search spans every product in a workspace — and, with the global endpoint, every workspace you belong to. Results are ACL-filtered at query time: you only ever get hits you could open.

Both endpoints accept a session JWT or API key.

Endpoint Description
GET /v1/workspaces/{wid}/search Search within one workspace
GET /v1/search Cross-workspace search over all your active memberships
Param Description
q the query text
type repeatable — restrict to object types: chat_message, mail_message, drive_file, doc, sheet, web_run, task
limit max hits

Search one workspace for docs and sheets:

Terminal window
curl -H "Authorization: Bearer knak_..." \
"https://api.knobs.io/v1/workspaces/{wid}/search?q=budget&type=doc&type=sheet&limit=10"
{
"workspaceId": "w_31ab…",
"query": "budget",
"results": [
{
"objectType": "sheet",
"objectId": "s_4be2…",
"workspaceId": "w_31ab…",
"title": "Q3 budget",
"snippet": "…marketing budget line moved to…",
"score": 12.4
}
]
}

Search everywhere you’re a member:

Terminal window
curl -H "Authorization: Bearer knak_..." \
"https://api.knobs.io/v1/search?q=onboarding+checklist"

The global response carries "scope": "my-workspaces" and each hit’s workspaceId so you can route the open. The membership scope is resolved server-side from your active memberships — a crafted query can’t widen it.

  • Hits carry title and snippet from the index; fetch the object through its product API for full content.
  • Structured operators (from:, in:, has:, before:) are not supported yet — filter with type and post-process.