Every email agent demo shows the send path. Then you ship one, and it turns out 80% of your code is the read path: pulling messages out of the mailbox, filtering down to the ones that matter, and walking pages of results without dropping anything. Get this wrong and your agent either reprocesses the same 50 messages forever or silently misses the one email it was built to catch.

Here's how the read path works for a Nylas Agent Account — a hosted mailbox your app owns outright (currently in beta). The nice part: an Agent Account is just a grant, so the messages endpoint is the exact same one you'd use for a connected Gmail or Outlook account.

The basic list call

One endpoint does the listing: GET /v3/grants/{grant_id}/messages. Messages come back in reverse chronological order — newest first.

curl --request GET \