Skip to main content
Search across multiple entity types using PostgreSQL full-text search with GIN indexes.
GET /api/v1/search
q
string
required
Search query
types
string
Comma-separated entity types to search: contacts, companies, deals, interactions. Defaults to all types.
per_type
integer
default:"5"
Maximum results per type (max 20)
Example
curl "https://api.mosscrm.com/api/v1/search?q=acme&types=contacts,deals&per_type=10" \
  -H "X-API-Key: moss_k_..."

Response

{
  "data": {
    "contacts": [
      {
        "id": "cnt_abc123",
        "first_name": "Jane",
        "last_name": "Smith",
        "email": "[email protected]"
      }
    ],
    "companies": [
      {
        "id": "cmp_abc123",
        "name": "Acme Corp",
        "domain": "acme.com"
      }
    ],
    "deals": [
      {
        "id": "deal_abc123",
        "name": "Acme Corp - Enterprise",
        "stage": "proposal",
        "value": 5000000
      }
    ],
    "interactions": []
  }
}
Results are ranked by relevance. Each entity type returns up to per_type results.