Skip to main content

Search Messages

GET/api/v1/mail/search

Overview

Full-text search across email subjects and bodies using PostgreSQL tsvector indexing. Returns matching messages sorted by relevance.

Query Parameters

emailstringrequired

Email address of the mailbox to search

qstringrequired

Search query (supports PostgreSQL full-text search syntax)

limitintegerdefault: 20

Maximum results to return

Request

curl "https://spideriq.ai/api/v1/mail/search?email=alice@company.com&q=pricing" \
-H "Authorization: Bearer <client_id>:<api_key>:<api_secret>"

Response

{
"success": true,
"email": "alice@company.com",
"query": "pricing",
"total": 5,
"messages": [
{
"id": 1240,
"thread_id": "<xyz789@mail.zoho.com>",
"direction": "inbound",
"from_address": "sarah@example.com",
"to_addresses": ["alice@company.com"],
"subject": "Re: Pricing for enterprise plan",
"body_text_preview": "Could you send me the updated pricing...",
"date": "2026-02-01T16:30:00",
"is_read": true,
"is_starred": false,
"labels": []
}
]
}