Listing and Paginating an Agent's Messages Nylas details the read path for its Agent Account mailboxes, explaining how to list, filter, and paginate messages using the /v3/grants/{grant_id}/messages endpoint. The approach uses cursor-based pagination to avoid duplicate or skipped rows, and supports filters like inbox, unread, and received_after for efficient agent polling. 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 https://developer.nylas.com/docs/v3/agent-accounts/ — 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. One endpoint does the listing: GET /v3/grants/{grant id}/messages . Messages come back in reverse chronological order — newest first. curl --request GET \ --url "https://api.us.nylas.com/v3/grants/