What actually happens in the first ten seconds after someone emails your AI agent? If you've built the agent on a Nylas Agent Account — a hosted mailbox your app owns, currently in beta — the answer is: a message.created webhook hits your server, and you have exactly 10 seconds to acknowledge it. In a Next.js app, that handler is one route file. Let's build it properly.
Subscribing the endpoint
First, point a webhook at your deployment. The subscription is a single API call with the trigger you care about:
curl --request POST \
--url "https://api.us.nylas.com/v3/webhooks" \






