# Full-text email search for Agent Accounts

Source: https://developer.nylas.com/docs/changelogs/2026-08-06-agent-account-email-search/

Agent Account grants now support full-text search through the `search_query_native` query parameter on [Get all Messages](/docs/reference/api/messages/get-messages/) and [Get all Threads](/docs/reference/api/threads/get-threads/). One query searches subject lines, participant names and addresses, visible body text, and attachment filenames, so your agent doesn't need to download and index the mailbox itself.

This syntax applies to Agent Account grants with `provider: "nylas"`. Connected grants keep the native grammar of Google, Microsoft, EWS, or their IMAP provider.

## Added

- **Query grammar** with implicit and explicit `AND`, `OR`, quoted phrases, parentheses up to eight nested levels, and leading `-` negation. Queries can be up to 512 decoded `UTF-8` bytes and 64 syntax-tree nodes.

  ```bash
  curl --request GET \
    --url "https://api.us.nylas.com/v3/grants/<NYLAS_GRANT_ID>/messages" \
    --get \
    --data-urlencode 'search_query_native=(invoice OR receipt) overdue -paid' \
    --header 'Authorization: Bearer <NYLAS_API_KEY>'
  ```

- **Relevance-ranked results.** Adding `search_query_native` changes the result order from chronological to relevance order. Subject matches carry the strongest weight, followed by participants and attachment filenames, then body-only matches. A thread ranks by its strongest matching message.

- **Structured filters combine with search.** Nylas applies `search_query_native` and parameters such as `from`, `unread`, `in`, and `has_attachment` together using `AND`, so you can scope a full-text query to a sender, folder, or read state in one request.

- **Cursor pagination.** Follow `next_cursor` as `page_token` while keeping the query and filters unchanged. Nylas binds each search page token to the original request and returns a `400` response if the query or endpoint changes mid-traversal.

- **[Email search for Agent Accounts](/docs/v3/agent-accounts/email-search/)** is a new guide covering searchable content, the full grammar and operator precedence, negation patterns, relevance ordering, pagination, limits, and unsupported behavior. The [Messages](/docs/reference/api/messages/get-messages/) and [Threads](/docs/reference/api/threads/get-threads/) references now document Agent Account support for `search_query_native`.