Give AI agents their own email inboxes using the AgentMail API. Use when building email agents, sending/receiving emails programmatically, managing inboxes, handling attachments, organizing with labels, creating drafts for human approval, or setting up real-time notifications via webhooks/websockets. Supports multi-tenant isolation with pods.
95
93%
Does it follow best practices?
Impact
100%
1.07xAverage score across 4 eval scenarios
Advisory
Suggest reviewing before use
You need the smallest truthful Node.js workflow for a read-only AgentMail inbox census.
The environment contract is slightly awkward:
AGENTMAIL_API_KEY is still the default supported credential variableAGENTMAIL_KEY may exist on the machineAGENTMAIL_KEYAGENTMAIL_KEY into the SDK apiKey field while saying that mapping out loudThe goal is to write a script that keeps this boundary honest while doing one bounded live-style read-only operation.
Write a single Node script named inbox_census.js that:
agentmailAGENTMAIL_API_KEY as the default credential sourceAGENTMAIL_KEY--allow-agentmail-key-aliasclient.inboxes.list()If neither a direct AGENTMAIL_API_KEY nor an explicitly allowed alias path is available, the script should fail clearly and non-optimistically.
Do not write tests or extra files.