Search API
Cross-module semantic + keyword search across your workspace
Search across everything indexed in your workspace — records, documents, and more — with a single call. Results are ranked by relevance and filtered to the modules your API key's role can view.
Global search
Endpoint
POST https://api.getcoherence.io/v1/search
Requires the records:read scope.
Request
| Field | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Search text |
types | string[] | No | Restrict to source types (e.g. module_record, collab_doc) |
limit | number | No | Max results (default 25, max 50) |
minSimilarity | number | No | Minimum semantic similarity 0–1 (default 0.3) |
curl -X POST "https://api.getcoherence.io/v1/search" \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{ "query": "john smith", "types": ["module_record"], "limit": 20 }'Response
{
"results": [
{
"sourceType": "module_record",
"sourceId": "rec_abc123",
"title": "John Smith",
"snippet": "VP of Sales at Acme Corp…",
"metadata": { "moduleSlug": "contacts" },
"score": 0.94,
"link": "/contacts/rec_abc123"
}
],
"total": 1
}Each result has sourceType, sourceId, title, snippet, metadata, a
relevance score, and a link. module_record results are filtered to modules
the key's role can view, so search never returns records the caller couldn't read
directly.
If the search index is temporarily unavailable the endpoint degrades gracefully,
returning { "results": [], "total": 0, "fallback": true } rather than an error —
fall back to listing records with the module search parameter.
Per-module search
To search within a single module, list its records with the search parameter:
curl -X GET "https://api.getcoherence.io/v1/modules/contacts/records?search=acme" \
-H "Authorization: Bearer sk_live_..."This also supports filter[field], advancedFilter, sorting, and pagination —
see the Records API.
Related: API Overview | Records API