Search
Global search across tasks, projects, and clients, scoped to the organization and the API key holder's visibility.
A single read-only endpoint that searches tasks, projects, and clients by text and returns them in one relevance-ranked list. It shares the exact logic of the in-app command palette, so matching is accent- and case-insensitive and tolerant of partial words.
Results respect the API key holder's project visibility: projects (and their tasks) the user can't see are never returned. Clients are organization-wide. Results never cross organizations.
Endpoint
| Method | Path | Notes |
|---|---|---|
GET | /api/v1/search | Search the active organization. |
Query parameters
GET /api/v1/search?q=proposal&limit=6| Param | Type | Notes |
|---|---|---|
q | string | The search text (≤ 200 chars). Fewer than 2 characters returns an empty list. |
limit | int 1–20 | Optional. Max matches per record type before the "has more" cutoff. Defaults to 6. |
Response
Returns { data, total }, where data is the merged, relevance-ranked list and total is its length.
{
"data": [
{
"type": "task",
"id": "9b1c…",
"title": "Revisar proposta",
"subtitle": "Website Redesign · Acme Corp",
"status": "open",
"score": 4.3
},
{
"type": "project",
"id": "1f3c…",
"title": "Proposal microsite",
"subtitle": "Acme Corp",
"status": "inProgress",
"score": 3.1
}
],
"total": 2
}| Field | Type | Notes |
|---|---|---|
type | enum | task · project · client. |
id | string | The record id. |
title | string | Subject (task) or name (project, client). |
subtitle | string | null | Context: task → Project · Client; project → client name; client → null. |
status | string | null | Status token for a badge: task → open · finalized · blocked; project → the project status (notStarted, inProgress, onHold, completed, cancelled); client → active · inactive. |
score | number | Relevance (~0–5), comparable across types. Higher is more relevant. |
Matching is accent- and case-insensitive (reuniao matches "Reunião") and substring-tolerant (propos matches "Revisar proposta"). Finished tasks and completed projects are included.
Errors
| Status | When |
|---|---|
401 | Missing or invalid API key. |
422 | q longer than 200 chars, or limit outside 1–20. |