受信トレイ
各エージェントは固有のメールアドレスを持つ独自の受信トレイを取得します。受信トレイはAgentSendの基本単位です。
概要
受信トレイは、単一のエージェント用の専用メールアドレスです。 Every email your agent sends or receives flows through an inbox. You can create as many inboxes as you need — one per agent, one per customer, one per workflow — there are no limits.
デフォルトでは、受信トレイは@agentsend.ioドメインでプロビジョニングされます。 If you want your agents to send from your own domain (e.g. agent@yourcompany.com), see Custom Domains.
Inboxes are isolated from each other. An agent can only send and receive email through its own inbox — it cannot access another inbox's messages.
受信トレイの作成
POST /inboxes
Create a new inbox by sending a POST request. Both body fields are optional — if you omit displayName, the inbox is created without one. If you omit domainId, the address is provisioned on @agentsend.io.
const res = await fetch("https://api.agentsend.io/inboxes", { method: "POST", headers: { "x-api-key": process.env.AGENTSEND_API_KEY, "Content-Type": "application/json", }, body: JSON.stringify({ displayName: "Support Agent", // optional domainId: "dom_abc123", // optional — omit for @agentsend.io }), }); const inbox = await res.json(); console.log(inbox.address); // e.g. a1b2c3@agentsend.io console.log(inbox.id); // e.g. inb_7x9kQm2Np...
The response includes the full inbox object, including the auto-generated address you can start using immediately.
受信トレイのプロパティ
Every inbox object has the following fields:
| プロパティ | 型 | 説明 |
|---|---|---|
id |
string (uuid) | 受信トレイの一意識別子。すべてのAPI呼び出しで使用します。 |
address |
string (email) | The full email address assigned to this inbox, e.g. a1b2c3@agentsend.io. |
displayName |
string | null | 受信トレイの人間が読めるラベル。送信メールヘッダーの送信者名として表示されます。 |
domainId |
string | null | The ID of a custom domain associated with this inbox. null for default @agentsend.io addresses. |
status |
string | Current inbox status: active, suspended, or deleted. Only active inboxes can send and receive. |
dailySendLimit |
number | Maximum number of emails this inbox can send in a 24-hour window. |
sendsToday |
number | Number of emails sent in the current 24-hour window. Resets at midnight UTC. |
totalSent |
number | Cumulative count of all emails sent from this inbox since creation. |
bounceCount |
number | Number of hard bounces recorded for this inbox. High bounce rates may trigger suspension. |
complaintCount |
number | Number of spam complaints recorded for this inbox. |
createdAt |
string (ISO 8601) | Timestamp of when the inbox was created. |
カスタムドメイン
By default, every inbox gets an address on @agentsend.io. If you want your agents to send from your own domain — for example agent@support.yourcompany.com — you can connect a custom domain and pass the domainId when creating an inbox.
Custom domains improve deliverability and brand trust. See the Domains guide to add and verify your domain, then come back here to create inboxes on it.
受信トレイの一覧表示
GET /inboxes
Retrieve a paginated list of all inboxes in your account. Use limit and offset to page through results.
const res = await fetch( "https://api.agentsend.io/inboxes?limit=20&offset=0", { headers: { "x-api-key": process.env.AGENTSEND_API_KEY }, } ); const { data, total } = await res.json(); // data — array of inbox objects // total — total count across all pages for (const inbox of data) { console.log(inbox.address, inbox.status, inbox.sendsToday); }
| クエリパラメータ | 型 | 説明 |
|---|---|---|
limit |
number | 返す結果の数。デフォルトは20、最大100。 |
offset |
number | スキップする結果の数。デフォルトは0。 |
受信トレイの削除
DELETE /inboxes/{id}
Permanently deletes an inbox and all associated messages, threads, and webhooks.
This action is permanent and cannot be undone. All messages, threads, and webhook subscriptions belonging to the inbox are deleted immediately. The inbox's email address is released and may be reassigned.
await fetch(`https://api.agentsend.io/inboxes/${inboxId}`, { method: "DELETE", headers: { "x-api-key": process.env.AGENTSEND_API_KEY }, }); // Returns 204 No Content on success
送信制限
Each inbox has a dailySendLimit that caps how many emails it can send in a rolling 24-hour window. The sendsToday field tells you how many sends have been used in the current window.
If an inbox reaches its limit, subsequent send requests return a 429 Too Many Requests error. The window resets at midnight UTC.
Monitor sendsToday before sending high-volume bursts. If your agent needs to send more than the default limit allows, contact support to request an increase for your account.
const inbox = await fetch( `https://api.agentsend.io/inboxes/${inboxId}`, { headers: { "x-api-key": process.env.AGENTSEND_API_KEY } } ).then(r => r.json()); const remaining = inbox.dailySendLimit - inbox.sendsToday; if (remaining <= 0) { console.log("Daily send limit reached. Try again after midnight UTC."); } else { console.log(`${remaining} sends remaining today`); }