Summary
Calling inboxes.messages.send() immediately after inboxes.create() returns a 404 "Inbox not found" error. The inbox exists (confirmed via inboxes.list()), but the send endpoint rejects it for the first ~1-2 seconds after creation.
Repro
import { AgentMailClient } from "agentmail";
const client = new AgentMailClient({ apiKey: "am_..." });
const inbox = await client.inboxes.create({
username: "test-inbox",
clientId: "test-v1",
});
console.log(inbox.inboxId); // "test-inbox@agentmail.to" ✅
// This 404s:
await client.inboxes.messages.send(inbox.inboxId, {
to: ["recipient@example.com"],
subject: "Hello",
text: "Hello!",
});
// NotFoundError: Inbox not found
Expected
send() should succeed immediately after create() returns — or create() should not resolve until the inbox is fully propagated.
Workaround
Adding a ~2 second delay between create() and send() resolves the issue.
Environment
agentmail npm v0.4.13
- Bun v1.3.11 / macOS arm64
- Also reproduced via raw
curl against the REST API
Notes
inboxes.list() shows the inbox immediately after creation — it is the /inboxes/{inbox_id}/messages/send endpoint specifically that returns 404.
- The
@ URL-encoding (%40) is not the issue — both encoded and raw @ succeed once the inbox has propagated.
Summary
Calling
inboxes.messages.send()immediately afterinboxes.create()returns a 404 "Inbox not found" error. The inbox exists (confirmed viainboxes.list()), but the send endpoint rejects it for the first ~1-2 seconds after creation.Repro
Expected
send()should succeed immediately aftercreate()returns — orcreate()should not resolve until the inbox is fully propagated.Workaround
Adding a ~2 second delay between
create()andsend()resolves the issue.Environment
agentmailnpm v0.4.13curlagainst the REST APINotes
inboxes.list()shows the inbox immediately after creation — it is the/inboxes/{inbox_id}/messages/sendendpoint specifically that returns 404.@URL-encoding (%40) is not the issue — both encoded and raw@succeed once the inbox has propagated.