API Reference
Search
Global full-text search across all CRM objects, optionally restricted to one object.
The Search endpoint performs a cross-object text search across your CRM data. It searches every field flagged as searchable on every object the authenticated user has access to.
Global search
GET /api/v1/searchQuery parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
query | string | -- | Required. The search term. Minimum 1 character. |
limit | number | 5 | Maximum results per object. Capped at 50 (higher values are clamped down). |
offset | number | 0 | Number of results to skip per object (for pagination). |
object | string | -- | Restrict search to a single object (e.g., contacts). |
Behavior
- The search is accent-insensitive and case-insensitive: it normalizes accents (
unaccent) and matches with trigramILIKE. - Only fields flagged as searchable in the schema are included — this requires both the field's
isSearchableflag and a type that exposes a scalar text column. CompoundEMAILSandPHONESfields are also matched (via their child tables). Objects with no searchable field are skipped. - RBAC and visibility rules are applied: the user only sees results from objects they have permission to read, and within each object only the records they are allowed to see.
- Results are grouped by object. Each group contains up to
limitmatching records (after applyingoffset). - When
objectis specified, only that object is searched. Otherwise, all accessible objects are searched in parallel.
Response
{
"query": "alice",
"results": [
{
"objectName": "contacts",
"objectLabel": "Contacts",
"total": 2,
"records": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"first_name": "Alice",
"last_name": "Martin",
"email": "alice@example.com"
},
{
"id": "660f9511-f3ac-52e5-b827-557766551111",
"first_name": "Alice",
"last_name": "Dupont",
"email": "alice.dupont@company.com"
}
]
},
{
"objectName": "companies",
"objectLabel": "Companies",
"total": 1,
"records": [
{
"id": "770a0622-a4bd-63f6-c938-668877662222",
"name": "Alice Technologies"
}
]
}
],
"total": 3
}Response fields
| Field | Type | Description |
|---|---|---|
query | string | The search term that was used |
results | array | Array of result groups, one per matching object |
results[].objectName | string | Internal object name (plural) |
results[].objectLabel | string | Display label for the object (plural) |
results[].total | number | Real number of records matching in this object (may exceed records.length when paginated) |
results[].records | array | Matching records (each with its full set of fields) |
total | number | Number of records returned in this response, summed across all groups |
Errors
| Status | Code | Description |
|---|---|---|
| 400 | MISSING_REQUIRED_FIELD | The query parameter is missing or empty |
Examples
Search across all objects:
curl -X GET "https://kasar.app/api/v1/search?query=alice" \
-H "Authorization: Bearer YOUR_API_TOKEN"Search within a specific object with pagination:
curl -X GET "https://kasar.app/api/v1/search?query=martin&object=contacts&limit=10&offset=0" \
-H "Authorization: Bearer YOUR_API_TOKEN"Search with a higher result limit:
curl -X GET "https://kasar.app/api/v1/search?query=tech&limit=20" \
-H "Authorization: Bearer YOUR_API_TOKEN"