Ask Email AI across the current email view
POST
/emails/ai
Runs a Typesense-first list, count, search, or summary query over emails. Scope defaults to the current ECC project/mailbox/label view. Summary requests search the scoped project first, then retry across all projects when no scoped emails are found.
Authorizations
BearerAuth
JWT token from login
Type
HTTP (bearer)
or
AccessToken
Personal access token. Value: Token <your-token>
Type
API Key (header: Authorization)
Request Body
application/json
JSON "query": "show emails from sender@example.com", "scope": { "project": "string", "mailbox": "string", "label": "string", "triaged": true }
{
}
Responses
OK
application/json
JSON "answer": "string", "count": 0, "mode": "string", "context_scope": "string", "scope": { }, "emails": [ { "_id": "string", "message_id": "string", "references": [ "string" ], "in_reply_to": "string", "thread_identifiers": [ "string" ], "thread_source_ids": [ "string" ], "from": [ "string" ], "to": [ "string" ], "cc": [ "string" ], "bcc": [ "string" ], "subject": "string", "text_content": "string", "html_content": "string", "html_content_has_remote_images": true, "attachment_text_content": "string", "source": "string", "mailbox": "string", "labels": [ "string" ], "triaged": true, "triaged_at": "string", "triage_summary": "string", "triage_reason": "string", "triage_primary_action": "string", "triage_confidence": 0, "triage_action_points": [ { "text": "string", "type": "string", "due_at": "string" } ], "triage_related_context": [ { "item_id": "string", "item_type": "string", "title": "string", "reason": "string" } ], "triage_mailbox_action": "string", "triage_status": "string", "triage_error": "string", "triage_run_id": "string", "triage_draft_id": "string", "project": "string", "host_id": "string", "createdAt": "string", "updatedAt": "string" } ]
{
}