Chase overdue invoices with a collections agent Nylas developer advocates building a collections agent that can both send and receive email, using an Agent Account with a full mailbox. The agent stops escalation on inbound replies like 'I already paid' or 'I'm disputing this charge', avoiding the common failure of one-way email services. The implementation uses Nylas API and CLI commands to create the account and handle inbound mail via webhooks. Most "AI for collections" demos are a glorified mail merge: a model writes three increasingly stern paragraphs, a cron job fires them on days 7, 14, and 30, and everyone claps. That's fine right up until a customer replies "we paid this last Tuesday, check your records" — and your one-way email service can't read the reply, so the agent sends the day-30 nastygram anyway. Now you've insulted a paying customer and your AR team is on the phone apologizing. Collections isn't a send-only problem. It's a polite-but-firm sequence that has to read the replies — because the two messages that matter most "I already paid" and "I'm disputing this charge" arrive as inbound email, and they're the two signals that should immediately stop the ladder. A dunning agent that can't receive mail is the wrong tool for the job by design. That's the whole reason to put this on an Agent Account . An Agent Account is a real, full mailbox the agent owns — it sends and receives, threads replies, and fires webhooks on inbound mail. The escalation logic and the "stop on payment or dispute" rule are your code, but the read/write/reply plumbing is handled. I work on the Nylas CLI, so the terminal commands below are the exact ones I reach for when I'm building and debugging one of these loops. Every step has both forms: the curl HTTP call and the nylas ... equivalent. An Agent Account is just a grant — the same grant id abstraction behind every Nylas mailbox. There's nothing new to learn on the data plane. If you've ever listed messages or sent an email through Nylas, you already know the API surface. The agent-specific part is that ar@yourcompany.com is a mailbox the agent controls end to end: POST /v3/grants/{grant id}/messages/send . message.created webhooks, app-scoped.The dunning ladder, the tone, and the stop conditions live in your app and your billing system. Nylas never knows whether an invoice is paid — that's your source of truth. Keep that boundary clear and the rest is mechanical. A one-way provider SendGrid, Resend, Postmark sends beautifully and hears nothing back. For a marketing blast that's a feature. For collections it's the failure mode: An Agent Account closes that loop. The reply is just inbound mail, and inbound mail is something the agent can fetch, classify, and act on. You need: .nylas.email trial subdomain . New domains warm over roughly four weeks, so don't start your first real campaign on a domain that's a day old. message.created webhook subscription so inbound replies reach you.New to Agent Accounts? Start with the Agent Accounts overview https://developer.nylas.com/docs/v3/agent-accounts/ and Give your agent its own email https://developer.nylas.com/docs/v3/getting-started/agent-own-email/ . Create the account from the CLI: nylas agent account create ar@yourcompany.com --name "Acme Billing" Or over the API — an Agent Account is created with POST /v3/connect/custom , passing "provider": "nylas" , a top-level name for the display name, and the mailbox address under settings.email : curl --request POST \ --url "https://api.us.nylas.com/v3/connect/custom" \ --header "Authorization: Bearer