---
title: "Search emails (v2)"
method: GET
path: "/v2/agenda/email/messages"
tags: ["agenda"]
---

# Search emails (v2)

`GET /v2/agenda/email/messages`

Free-text email search across ALL of the authenticated user's connected mail accounts, fetched live from the providers (Google / Microsoft) — Dex stores no message content. `searchQuery` matches subject, body, and participants as plain text (provider search operators are neutralized); optional `limit` (default 25) and `dateRange.{start,end}` scope the window, defaulting to roughly the last 6 months. Returns `{ data: { email_messages, pagination } }` with sender, participants, subject, snippet, and a provider deep link per message.

## Query parameters

- `limit` integer
- `searchQuery` string
- `dateRange` object
  - `start` string, date-time
  - `end` string, date-time

## Response `200`

Successful response

- object
  - `data` object, required
    - `email_messages` object[], required
      - `providerId` string, required
      - `threadId` string, nullable
      - `type` 'EMAIL' | 'CALENDAR', required
      - `subjectOrTitle` string, required
      - `snippet` string, nullable
      - `dateTime` union, required
        - string, date-time
        - unknown
      - `from` object, nullable
        - `email` string, required
        - `name` string, nullable
      - `participants` object[], required
        - `email` string, required
        - `name` string, nullable
      - `providerLink` string, nullable
      - `email` string, required
      - `provider` string, nullable
    - `pagination` object
      - `nextCursor` string, nullable
      - `count` integer

## Other responses

- `400` — Request body failed validation.
- `401` — Missing or invalid API key.
- `403` — Valid key, insufficient permission.
- `404` — Resource does not exist.
- `409` — Request body failed validation.
- `429` — Rate limit exceeded.
- `500` — Unexpected server error.

---

[API](https://skmtc.net/getdex/apis/dex-public-api.md) · [All operations](https://skmtc.net/getdex/apis/dex-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getdex/dex-public-api/revisions/9d0dd2de771c/schema)
