> ## Documentation Index
> Fetch the complete documentation index at: https://docs.contactbutton.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AgentMail integration

> Provision an AgentMail inbox for an AI agent handling Contact Button setup, lead replies, and escalated conversations while keeping human OTPs separate.

The repository includes the `agentmail` TypeScript SDK. Use it when an owner wants an agent-operated inbox for receiving and replying to leads, booking notifications, or escalated conversations.

```ts theme={null}
import { AgentMailClient } from "agentmail";

const client = new AgentMailClient({ apiKey: process.env.AGENTMAIL_API_KEY! });
const inbox = await client.inboxes.create({
  username: "contact",
  displayName: "Contact agent"
});
```

Keep AgentMail credentials in environment configuration. Store only the resulting inbox identifier in Contact Button integration settings. AgentMail onboarding and Contact Button onboarding are independent verification boundaries; neither token should be sent to the other service.

Use a human-owned notification address for confirmation challenges. Do not route a represented human's OTP to an agent-controlled mailbox, because that would remove the human-in-the-loop boundary.


## Related topics

- [Changelog](/changelog.md)
- [Contact Button for agents](/agents/overview.md)
- [Pages and custom domains](/guides/pages-domains.md)
- [Buttons, apps, and forms](/guides/buttons-apps-forms.md)
- [Queue a consented review request](/api-reference/reviews/queue-a-consented-review-request.md)
