Search API
Global search across items, projects, and workspaces within an organization.
Search API
ProBeya provides a global search endpoint that queries across all entity types — items, projects, and workspaces — within the current organization. Results are grouped by type and limited to 5 per group for fast, responsive command palette integration.
Search uses PostgreSQL case-insensitive substring matching (ILIKE %query%). All three entity type queries run in parallel for minimal latency.
Endpoints
GET /api/v1/search
Search across items, projects, and workspaces by name.
tRPC: search.query
Auth: Bearer token required (scope: read:search) or session cookie
Org context: Required
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
q | string (query) | Yes | Search query (min 1 char, max 200 chars). Alias: query |
Example:
curl -H "Authorization: Bearer probeya_sk_live_..." \
"https://acme.probeya.com/api/v1/search?q=calibration"
Response:
{
"data": {
"items": [
{
"id": "clx9it001",
"name": "Calibrate pH meter #7",
"boardId": "clx9bd001"
},
{
"id": "clx9it015",
"name": "Calibration schedule review",
"boardId": "clx9bd003"
}
],
"projects": [
{
"id": "clx9pj005",
"name": "Equipment Calibration Program",
"slug": "equipment-calibration",
"workspaceId": "clx9ws001"
}
],
"workspaces": []
}
}
Errors:
| Code | Description |
|---|---|
| 400 | Query string is empty or exceeds 200 characters |
| 401 | Missing or invalid authentication |
Search Behavior
Matching
- Case-insensitive: “OEE” matches “oee”, “OEE”, “Oee”
- Substring: “road” matches “Product Roadmap”, “roadblock”, “crossroads”
- Pattern:
%query%(both leading and trailing wildcards)
Limits
Each entity type returns a maximum of 5 results. This keeps the command palette responsive and avoids overwhelming users with too many matches.
Tenant Isolation
All queries are filtered by the current organizationId — users can never see entities from other organizations. This is enforced server-side regardless of the search query content.
Result Fields
| Entity | Fields returned |
|---|---|
| Items | id, name, boardId |
| Projects | id, name, slug, workspaceId |
| Workspaces | id, name, slug |
The slug and workspaceId/boardId fields enable the client to construct navigation URLs directly from search results without additional API calls.
Performance Considerations
The current implementation uses PostgreSQL ILIKE with leading wildcards, which cannot leverage B-tree indexes. For the current scale this is fast enough. At higher volumes, ProBeya can be configured with:
- Trigram indexes: PostgreSQL
pg_trgmextension with GIN indexes for substring search - Full-text search: PostgreSQL
tsvector/tsqueryfor weighted, ranked results - External search service: Meilisearch or Typesense for sub-millisecond results with typo tolerance
Additional REST Endpoints
Two additional read endpoints are available through the REST API but are less commonly used:
GET /api/v1/notifications
List notifications for the authenticated user with cursor-based pagination.
tRPC: notifications.list
Scope: read:notifications
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | number (query) | No | Results per page |
cursor | string (query) | No | Pagination cursor from previous response |
GET /api/v1/dashboard/stats
Get aggregate dashboard statistics for the current organization.
tRPC: dashboard.stats
Scope: read:dashboard
No parameters required.
Was this page helpful?