Misar IO Docs
MisarMailApi Reference

Search

Full-text search across emails, contacts, campaigns, and templates

The /api/search route in MisarMail is an internal fumadocs docs-search endpoint — it searches documentation content, not your account data. User-facing search is implemented via the search query parameter available on the core list endpoints documented below.

Search via list endpoints

Every major resource in MisarMail supports a search query parameter that performs full-text search across the most relevant fields. Pass it to any list endpoint alongside your other filters.

Supported endpoints

Endpointsearch searchesAuth
GET /v1/contactsemail, first_name, last_nameAPI key
GET /v1/campaignsname, subjectAPI key
GET /v1/templatesnameAPI key
GET /v1/automationsnameAPI key
GET /v1/segmentsnameAPI key
GET /api/inboxsubject, from_email, body (snippet)Session

Contacts search

GET /v1/contacts?search=jane&limit=20
Authorization: Bearer msk_...

Searches email, first_name, and last_name. Results are ranked by relevance.

{
  "contacts": [
    { "id": "con_abc1", "email": "[email protected]", "first_name": "Jane", "last_name": "Smith" },
    { "id": "con_abc2", "email": "[email protected]",    "first_name": "Jane", "last_name": "Brown" }
  ],
  "pagination": { "page": 1, "limit": 20, "total": 2 }
}

Campaigns search

GET /v1/campaigns?search=summer+sale&status=sent
Authorization: Bearer msk_...

Searches campaign name and subject. Combine with status to narrow results.


Templates search

GET /v1/templates?search=welcome
Authorization: Bearer msk_...

Searches template name.


Inbox search (session)

GET /api/inbox?search=invoice&account_id=acc_0x9f2c

Searches email subject, from_email, and body snippet. Requires session auth.


Full-text search internals

Inbox body search uses a PostgreSQL TSVECTOR index updated via trigger on every insert. This provides fast lexeme-based matching — plurals, stemming, and common stop words are handled automatically. For example, searching invoice also matches invoices and invoiced.

Boolean operators (AND, OR, NOT) are not supported in the search parameter — it always performs a prefix/stemmed match across all indexed fields.


Example: combined search and filter

# Find sent campaigns mentioning "black friday"
curl "https://api.misar.io/mail/v1/campaigns?search=black+friday&status=sent&limit=10" \
  -H "Authorization: Bearer msk_..."

# Find contacts matching "acme" with a tag filter
curl "https://api.misar.io/mail/v1/contacts?search=acme&tags=customer&limit=50" \
  -H "Authorization: Bearer msk_..."
// Contacts search
const res = await fetch(
  'https://api.misar.io/mail/v1/contacts?search=jane&limit=20',
  { headers: { Authorization: `Bearer ${MSK}` } }
);
const { contacts } = await res.json();

// Campaign search
const campaigns = await fetch(
  'https://api.misar.io/mail/v1/campaigns?search=summer+sale&status=sent',
  { headers: { Authorization: `Bearer ${MSK}` } }
).then(r => r.json());