KasarKasar Docs
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.

GET /api/v1/search

Query parameters

ParameterTypeDefaultDescription
querystring--Required. The search term. Minimum 1 character.
limitnumber5Maximum results per object. Capped at 50 (higher values are clamped down).
offsetnumber0Number of results to skip per object (for pagination).
objectstring--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 trigram ILIKE.
  • Only fields flagged as searchable in the schema are included — this requires both the field's isSearchable flag and a type that exposes a scalar text column. Compound EMAILS and PHONES fields 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 limit matching records (after applying offset).
  • When object is 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

FieldTypeDescription
querystringThe search term that was used
resultsarrayArray of result groups, one per matching object
results[].objectNamestringInternal object name (plural)
results[].objectLabelstringDisplay label for the object (plural)
results[].totalnumberReal number of records matching in this object (may exceed records.length when paginated)
results[].recordsarrayMatching records (each with its full set of fields)
totalnumberNumber of records returned in this response, summed across all groups

Errors

StatusCodeDescription
400MISSING_REQUIRED_FIELDThe 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"

On this page