agentmail 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +15 -0
- package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +87 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +15 -0
- package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +87 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/llms-full.txt +57 -39
- package/dist/llms.txt +2 -1
- package/package.json +1 -1
- package/reference.md +65 -0
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "agentmail",
|
|
46
|
-
"X-Fern-SDK-Version": "0.2.
|
|
47
|
-
"User-Agent": "agentmail/0.2.
|
|
46
|
+
"X-Fern-SDK-Version": "0.2.5",
|
|
47
|
+
"User-Agent": "agentmail/0.2.5",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -96,6 +96,21 @@ export declare class MessagesClient {
|
|
|
96
96
|
*/
|
|
97
97
|
replyAll(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.ReplyAllMessageRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.SendMessageResponse>;
|
|
98
98
|
private __replyAll;
|
|
99
|
+
/**
|
|
100
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
101
|
+
* @param {AgentMail.MessageId} message_id
|
|
102
|
+
* @param {AgentMail.SendMessageRequest} request
|
|
103
|
+
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
104
|
+
*
|
|
105
|
+
* @throws {@link AgentMail.ValidationError}
|
|
106
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
107
|
+
* @throws {@link AgentMail.MessageRejectedError}
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* await client.inboxes.messages.forward("inbox_id", "message_id", {})
|
|
111
|
+
*/
|
|
112
|
+
forward(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.SendMessageRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.SendMessageResponse>;
|
|
113
|
+
private __forward;
|
|
99
114
|
/**
|
|
100
115
|
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
101
116
|
* @param {AgentMail.MessageId} message_id
|
|
@@ -570,6 +570,93 @@ class MessagesClient {
|
|
|
570
570
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/{message_id}/reply-all");
|
|
571
571
|
});
|
|
572
572
|
}
|
|
573
|
+
/**
|
|
574
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
575
|
+
* @param {AgentMail.MessageId} message_id
|
|
576
|
+
* @param {AgentMail.SendMessageRequest} request
|
|
577
|
+
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
578
|
+
*
|
|
579
|
+
* @throws {@link AgentMail.ValidationError}
|
|
580
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
581
|
+
* @throws {@link AgentMail.MessageRejectedError}
|
|
582
|
+
*
|
|
583
|
+
* @example
|
|
584
|
+
* await client.inboxes.messages.forward("inbox_id", "message_id", {})
|
|
585
|
+
*/
|
|
586
|
+
forward(inbox_id, message_id, request, requestOptions) {
|
|
587
|
+
return core.HttpResponsePromise.fromPromise(this.__forward(inbox_id, message_id, request, requestOptions));
|
|
588
|
+
}
|
|
589
|
+
__forward(inbox_id, message_id, request, requestOptions) {
|
|
590
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
591
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
592
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
593
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
594
|
+
const _response = yield core.fetcher({
|
|
595
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}/forward`),
|
|
596
|
+
method: "POST",
|
|
597
|
+
headers: _headers,
|
|
598
|
+
contentType: "application/json",
|
|
599
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
600
|
+
requestType: "json",
|
|
601
|
+
body: serializers.SendMessageRequest.jsonOrThrow(request, {
|
|
602
|
+
unrecognizedObjectKeys: "strip",
|
|
603
|
+
omitUndefined: true,
|
|
604
|
+
}),
|
|
605
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
606
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
607
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
608
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
609
|
+
logging: this._options.logging,
|
|
610
|
+
});
|
|
611
|
+
if (_response.ok) {
|
|
612
|
+
return {
|
|
613
|
+
data: serializers.SendMessageResponse.parseOrThrow(_response.body, {
|
|
614
|
+
unrecognizedObjectKeys: "passthrough",
|
|
615
|
+
allowUnrecognizedUnionMembers: true,
|
|
616
|
+
allowUnrecognizedEnumValues: true,
|
|
617
|
+
skipValidation: true,
|
|
618
|
+
breadcrumbsPrefix: ["response"],
|
|
619
|
+
}),
|
|
620
|
+
rawResponse: _response.rawResponse,
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
if (_response.error.reason === "status-code") {
|
|
624
|
+
switch (_response.error.statusCode) {
|
|
625
|
+
case 400:
|
|
626
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
627
|
+
unrecognizedObjectKeys: "passthrough",
|
|
628
|
+
allowUnrecognizedUnionMembers: true,
|
|
629
|
+
allowUnrecognizedEnumValues: true,
|
|
630
|
+
skipValidation: true,
|
|
631
|
+
breadcrumbsPrefix: ["response"],
|
|
632
|
+
}), _response.rawResponse);
|
|
633
|
+
case 404:
|
|
634
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
635
|
+
unrecognizedObjectKeys: "passthrough",
|
|
636
|
+
allowUnrecognizedUnionMembers: true,
|
|
637
|
+
allowUnrecognizedEnumValues: true,
|
|
638
|
+
skipValidation: true,
|
|
639
|
+
breadcrumbsPrefix: ["response"],
|
|
640
|
+
}), _response.rawResponse);
|
|
641
|
+
case 403:
|
|
642
|
+
throw new AgentMail.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
643
|
+
unrecognizedObjectKeys: "passthrough",
|
|
644
|
+
allowUnrecognizedUnionMembers: true,
|
|
645
|
+
allowUnrecognizedEnumValues: true,
|
|
646
|
+
skipValidation: true,
|
|
647
|
+
breadcrumbsPrefix: ["response"],
|
|
648
|
+
}), _response.rawResponse);
|
|
649
|
+
default:
|
|
650
|
+
throw new errors.AgentMailError({
|
|
651
|
+
statusCode: _response.error.statusCode,
|
|
652
|
+
body: _response.error.body,
|
|
653
|
+
rawResponse: _response.rawResponse,
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/{message_id}/forward");
|
|
658
|
+
});
|
|
659
|
+
}
|
|
573
660
|
/**
|
|
574
661
|
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
575
662
|
* @param {AgentMail.MessageId} message_id
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.2.
|
|
1
|
+
export declare const SDK_VERSION = "0.2.5";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "agentmail",
|
|
9
|
-
"X-Fern-SDK-Version": "0.2.
|
|
10
|
-
"User-Agent": "agentmail/0.2.
|
|
9
|
+
"X-Fern-SDK-Version": "0.2.5",
|
|
10
|
+
"User-Agent": "agentmail/0.2.5",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -96,6 +96,21 @@ export declare class MessagesClient {
|
|
|
96
96
|
*/
|
|
97
97
|
replyAll(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.ReplyAllMessageRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.SendMessageResponse>;
|
|
98
98
|
private __replyAll;
|
|
99
|
+
/**
|
|
100
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
101
|
+
* @param {AgentMail.MessageId} message_id
|
|
102
|
+
* @param {AgentMail.SendMessageRequest} request
|
|
103
|
+
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
104
|
+
*
|
|
105
|
+
* @throws {@link AgentMail.ValidationError}
|
|
106
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
107
|
+
* @throws {@link AgentMail.MessageRejectedError}
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* await client.inboxes.messages.forward("inbox_id", "message_id", {})
|
|
111
|
+
*/
|
|
112
|
+
forward(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.SendMessageRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.SendMessageResponse>;
|
|
113
|
+
private __forward;
|
|
99
114
|
/**
|
|
100
115
|
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
101
116
|
* @param {AgentMail.MessageId} message_id
|
|
@@ -534,6 +534,93 @@ export class MessagesClient {
|
|
|
534
534
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/{message_id}/reply-all");
|
|
535
535
|
});
|
|
536
536
|
}
|
|
537
|
+
/**
|
|
538
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
539
|
+
* @param {AgentMail.MessageId} message_id
|
|
540
|
+
* @param {AgentMail.SendMessageRequest} request
|
|
541
|
+
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
542
|
+
*
|
|
543
|
+
* @throws {@link AgentMail.ValidationError}
|
|
544
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
545
|
+
* @throws {@link AgentMail.MessageRejectedError}
|
|
546
|
+
*
|
|
547
|
+
* @example
|
|
548
|
+
* await client.inboxes.messages.forward("inbox_id", "message_id", {})
|
|
549
|
+
*/
|
|
550
|
+
forward(inbox_id, message_id, request, requestOptions) {
|
|
551
|
+
return core.HttpResponsePromise.fromPromise(this.__forward(inbox_id, message_id, request, requestOptions));
|
|
552
|
+
}
|
|
553
|
+
__forward(inbox_id, message_id, request, requestOptions) {
|
|
554
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
555
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
556
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
557
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
558
|
+
const _response = yield core.fetcher({
|
|
559
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}/forward`),
|
|
560
|
+
method: "POST",
|
|
561
|
+
headers: _headers,
|
|
562
|
+
contentType: "application/json",
|
|
563
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
564
|
+
requestType: "json",
|
|
565
|
+
body: serializers.SendMessageRequest.jsonOrThrow(request, {
|
|
566
|
+
unrecognizedObjectKeys: "strip",
|
|
567
|
+
omitUndefined: true,
|
|
568
|
+
}),
|
|
569
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
570
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
571
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
572
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
573
|
+
logging: this._options.logging,
|
|
574
|
+
});
|
|
575
|
+
if (_response.ok) {
|
|
576
|
+
return {
|
|
577
|
+
data: serializers.SendMessageResponse.parseOrThrow(_response.body, {
|
|
578
|
+
unrecognizedObjectKeys: "passthrough",
|
|
579
|
+
allowUnrecognizedUnionMembers: true,
|
|
580
|
+
allowUnrecognizedEnumValues: true,
|
|
581
|
+
skipValidation: true,
|
|
582
|
+
breadcrumbsPrefix: ["response"],
|
|
583
|
+
}),
|
|
584
|
+
rawResponse: _response.rawResponse,
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
if (_response.error.reason === "status-code") {
|
|
588
|
+
switch (_response.error.statusCode) {
|
|
589
|
+
case 400:
|
|
590
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
591
|
+
unrecognizedObjectKeys: "passthrough",
|
|
592
|
+
allowUnrecognizedUnionMembers: true,
|
|
593
|
+
allowUnrecognizedEnumValues: true,
|
|
594
|
+
skipValidation: true,
|
|
595
|
+
breadcrumbsPrefix: ["response"],
|
|
596
|
+
}), _response.rawResponse);
|
|
597
|
+
case 404:
|
|
598
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
599
|
+
unrecognizedObjectKeys: "passthrough",
|
|
600
|
+
allowUnrecognizedUnionMembers: true,
|
|
601
|
+
allowUnrecognizedEnumValues: true,
|
|
602
|
+
skipValidation: true,
|
|
603
|
+
breadcrumbsPrefix: ["response"],
|
|
604
|
+
}), _response.rawResponse);
|
|
605
|
+
case 403:
|
|
606
|
+
throw new AgentMail.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
607
|
+
unrecognizedObjectKeys: "passthrough",
|
|
608
|
+
allowUnrecognizedUnionMembers: true,
|
|
609
|
+
allowUnrecognizedEnumValues: true,
|
|
610
|
+
skipValidation: true,
|
|
611
|
+
breadcrumbsPrefix: ["response"],
|
|
612
|
+
}), _response.rawResponse);
|
|
613
|
+
default:
|
|
614
|
+
throw new errors.AgentMailError({
|
|
615
|
+
statusCode: _response.error.statusCode,
|
|
616
|
+
body: _response.error.body,
|
|
617
|
+
rawResponse: _response.rawResponse,
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/{message_id}/forward");
|
|
622
|
+
});
|
|
623
|
+
}
|
|
537
624
|
/**
|
|
538
625
|
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
539
626
|
* @param {AgentMail.MessageId} message_id
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.2.
|
|
1
|
+
export declare const SDK_VERSION = "0.2.5";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.2.
|
|
1
|
+
export const SDK_VERSION = "0.2.5";
|
package/dist/llms-full.txt
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
> Your starting point for building with the AgentMail API.
|
|
4
4
|
|
|
5
|
-
<Tip title="Welcome to AgentMail!" icon="fa-solid fa-star"
|
|
5
|
+
<Tip title="Welcome to AgentMail!" icon="fa-solid fa-star">
|
|
6
|
+
We're thrilled to have you here! Dive in to learn how to give your AI agents their own email inboxes.
|
|
7
|
+
</Tip>
|
|
6
8
|
|
|
7
9
|
<Frame caption="We're excited to have you onboard!">
|
|
8
10
|
<img src="https://files.buildwithfern.com/https://agentmail-production.docs.buildwithfern.com/9594f1f7c411d8f6e6a3d1e6de0661b1c8b82a57d29de765f0f90dc9da66149b/assets/doc-intro.png" alt="We're excited to have you onboard!" />
|
|
@@ -45,7 +47,7 @@ AgentMail is an API platform for giving AI agents their own inboxes to send, rec
|
|
|
45
47
|
|
|
46
48
|
## What is AgentMail?
|
|
47
49
|
|
|
48
|
-
AgentMail is an API platform for giving AI agents their own inboxes to send, receive, and act upon emails. We handle the infrastructure so can focus on building email agents.
|
|
50
|
+
AgentMail is an API platform for giving AI agents their own inboxes to send, receive, and act upon emails. We handle the infrastructure so you can focus on building email agents.
|
|
49
51
|
|
|
50
52
|
**Email agents** can:
|
|
51
53
|
|
|
@@ -56,7 +58,7 @@ AgentMail is an API platform for giving AI agents their own inboxes to send, rec
|
|
|
56
58
|
|
|
57
59
|
## The Problem with Traditional Email
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
Existing email infrastructure was built for humans. Legacy providers such as Gmail and Outlook have several limitations for agentic use cases:
|
|
60
62
|
|
|
61
63
|
<CardGroup>
|
|
62
64
|
<Card title="No API for Inboxes" icon="fa-solid fa-link-slash">
|
|
@@ -287,16 +289,13 @@ This guide will walk you through installing the AgentMail SDK, authenticating wi
|
|
|
287
289
|
|
|
288
290
|
## Next Steps
|
|
289
291
|
|
|
290
|
-
Congrats, you sent your first email via AgentMail. But this isn't our strength. Explore the full power of creating agents that can autonomously reply, take action, parse
|
|
292
|
+
Congrats, you sent your first email via AgentMail. But this isn't our strength. Explore the full power of creating agents that can autonomously reply, take action, parse attachments, semantically search your inbox, by exploring our docs and tutorials below.
|
|
291
293
|
|
|
292
294
|
<Note>
|
|
293
295
|
Looking for a different language? Email us at
|
|
294
296
|
[support@agentmail.cc](mailto:support@agentmail.cc) and we'll get you set up.
|
|
295
297
|
</Note>
|
|
296
298
|
|
|
297
|
-
```
|
|
298
|
-
```
|
|
299
|
-
|
|
300
299
|
|
|
301
300
|
# Inboxes
|
|
302
301
|
|
|
@@ -304,7 +303,7 @@ Congrats, you sent your first email via AgentMail. But this isn't our strength.
|
|
|
304
303
|
|
|
305
304
|
## What is an Inbox?
|
|
306
305
|
|
|
307
|
-
People are used to the traditional Gmail limitations -- only having one inbox.
|
|
306
|
+
People are used to the traditional Gmail limitations -- only having one inbox. That's of the past.
|
|
308
307
|
|
|
309
308
|
An `Inbox` is now a fully loaded, programmatically accessible API resource re-designed for the scale of AI Agents.
|
|
310
309
|
|
|
@@ -313,7 +312,7 @@ Think of it as being similar to a Gmail or Outlook account, but built API-first.
|
|
|
313
312
|
Unlike traditional email providers that are designed for human scale, AgentMail `Inboxes` are built to scale horizontally. You can create tens, hundreds, or even thousands of `Inboxes` for your agents on demand.
|
|
314
313
|
|
|
315
314
|
<Tip>
|
|
316
|
-
|
|
315
|
+
Psst! Rather than sending 1000 emails from 1 `Inbox`, sending 10 emails
|
|
317
316
|
across 100 `Inboxes` actually improves deliverability! Read more about
|
|
318
317
|
optimizing for deliverability [here](/best-practices/email-deliverability)
|
|
319
318
|
</Tip>
|
|
@@ -392,10 +391,10 @@ Here at AgentMail we've now made an `Inbox` an API resource, meaning you can per
|
|
|
392
391
|
|
|
393
392
|
// --- Create an Inbox ---
|
|
394
393
|
// Creates a new inbox with a default agentmail.to domain
|
|
395
|
-
await client.inboxes.create({
|
|
396
|
-
username:
|
|
397
|
-
domain:
|
|
398
|
-
displayName:
|
|
394
|
+
const newInbox = await client.inboxes.create({
|
|
395
|
+
username: "docs-testing",
|
|
396
|
+
domain: "domain.com",
|
|
397
|
+
displayName: "Docs Tester",
|
|
399
398
|
});
|
|
400
399
|
console.log(`Created Inbox: ${newInbox.id}`);
|
|
401
400
|
|
|
@@ -488,7 +487,7 @@ To start a new conversation, you can send a `Message` from one of your inboxes.
|
|
|
488
487
|
const sentMessage = await client.inboxes.messages.send(
|
|
489
488
|
"outreach@agentmail.to", // this is your inbox you are trying to send from
|
|
490
489
|
{
|
|
491
|
-
to:
|
|
490
|
+
to: "recipient@domain.com",
|
|
492
491
|
labels: [
|
|
493
492
|
"outreach",
|
|
494
493
|
"startup"
|
|
@@ -793,7 +792,7 @@ This is the standard way to retrieve all the conversations associated with a sin
|
|
|
793
792
|
const inboxId = "inbound-agent@agentmail.to";
|
|
794
793
|
|
|
795
794
|
// This retrieves all threads within the specified Inbox
|
|
796
|
-
const inboxThreads = await client.inboxes.threads.list(inbound-agent@agentmail.to);
|
|
795
|
+
const inboxThreads = await client.inboxes.threads.list("inbound-agent@agentmail.to");
|
|
797
796
|
|
|
798
797
|
console.log(`Found ${inboxThreads.count} threads in Inbox ${inboxId}.`);
|
|
799
798
|
```
|
|
@@ -1110,7 +1109,7 @@ This is where `Labels` become truly powerful. You can list `Threads`, `Messages`
|
|
|
1110
1109
|
|
|
1111
1110
|
```typescript title="TypeScript"
|
|
1112
1111
|
// Find all threads from a specific campaign that need a follow-up
|
|
1113
|
-
|
|
1112
|
+
const filteredThreads = await client.inboxes.threads.list(
|
|
1114
1113
|
"leads@agentmail.to",
|
|
1115
1114
|
{
|
|
1116
1115
|
labels: [
|
|
@@ -1517,6 +1516,39 @@ Pod: "Marketing-Agent"
|
|
|
1517
1516
|
* Explore [Domains](/custom-domains) to set up custom email domains for your pods
|
|
1518
1517
|
|
|
1519
1518
|
|
|
1519
|
+
# MCP
|
|
1520
|
+
|
|
1521
|
+
> AgentMail's Model Context Protocol (MCP) integration
|
|
1522
|
+
|
|
1523
|
+
## Getting started
|
|
1524
|
+
|
|
1525
|
+
The Model Context Protocol (MCP) is an open standard that enables AI applications to connect with external tools and data sources. AgentMail provides an MCP server that allows any MCP-compatible client to interact with the AgentMail API.
|
|
1526
|
+
|
|
1527
|
+
### Setup
|
|
1528
|
+
|
|
1529
|
+
To get started with the AgentMail MCP server, visit [mcp.agentmail.to](https://mcp.agentmail.to) for installation instructions and configuration details.
|
|
1530
|
+
|
|
1531
|
+
## Features
|
|
1532
|
+
|
|
1533
|
+
The AgentMail MCP server provides tools for:
|
|
1534
|
+
|
|
1535
|
+
* **Inbox management:** Create, list, and delete inboxes
|
|
1536
|
+
* **Message operations:** Send, receive, and reply to emails
|
|
1537
|
+
* **Thread management:** Access and manage email threads
|
|
1538
|
+
* **Attachments:** Handle email attachments
|
|
1539
|
+
|
|
1540
|
+
## Compatible clients
|
|
1541
|
+
|
|
1542
|
+
The AgentMail MCP server works with any MCP-compatible client, including:
|
|
1543
|
+
|
|
1544
|
+
* Claude Desktop
|
|
1545
|
+
* Cursor
|
|
1546
|
+
* Windsurf
|
|
1547
|
+
* Other MCP-enabled AI applications
|
|
1548
|
+
|
|
1549
|
+
For detailed setup instructions and available tools, visit [mcp.agentmail.to](https://mcp.agentmail.to).
|
|
1550
|
+
|
|
1551
|
+
|
|
1520
1552
|
# Replit
|
|
1521
1553
|
|
|
1522
1554
|
> AgentMail's Replit integration
|
|
@@ -2941,9 +2973,9 @@ All webhook payloads follow the same basic structure:
|
|
|
2941
2973
|
|
|
2942
2974
|
<AccordionGroup>
|
|
2943
2975
|
<Accordion title="What is the difference between `message.sent` and `message.delivered?`" defaultOpen={true}>
|
|
2944
|
-
`message.sent` means the message has
|
|
2945
|
-
to travel the network. This
|
|
2946
|
-
where `message.delivered` means the
|
|
2976
|
+
`message.sent` means the message has successfully left our servers and is out
|
|
2977
|
+
to travel the network. This typically happens before `message.delivered`
|
|
2978
|
+
where `message.delivered` means the receiving email server (whether it's Gmail
|
|
2947
2979
|
or Outlook) gives us the `200 OK` saying the email has been received. What
|
|
2948
2980
|
they do with the email after is unknown.
|
|
2949
2981
|
</Accordion>
|
|
@@ -2951,7 +2983,7 @@ All webhook payloads follow the same basic structure:
|
|
|
2951
2983
|
<Accordion title="Does `message.delivered` mean I landed in their inbox?">
|
|
2952
2984
|
Nope. As mentioned `message.delivered` means the receiving email server,
|
|
2953
2985
|
whether it's Gmail or Outlook tells us "Hey AgentMail, we got your email,
|
|
2954
|
-
we'll take it from here!". They typically have their own
|
|
2986
|
+
we'll take it from here!". They typically have their own proprietary
|
|
2955
2987
|
algorithms to determine whether the email is going to end up in the inbox or
|
|
2956
2988
|
spam, but rest assured we handle everything needed for providers like Gmail
|
|
2957
2989
|
to deem the emails primary inbox worthy
|
|
@@ -4152,9 +4184,9 @@ The content of your email plays a huge role in whether it's seen as a valuable m
|
|
|
4152
4184
|
|
|
4153
4185
|
<Step title="Be Strategic with images">
|
|
4154
4186
|
Any type of image that isn't an attachment but included in the message body
|
|
4155
|
-
actually sets
|
|
4156
|
-
open-tracker while
|
|
4157
|
-
|
|
4187
|
+
actually sets off the spam alarms. Don't do it. Also get rid of your
|
|
4188
|
+
open-tracker while you're at it because how EVERY service checks if the
|
|
4189
|
+
recipient of your email opened your message is by encoding a small image
|
|
4158
4190
|
into the body. Hurts deliverability!!
|
|
4159
4191
|
</Step>
|
|
4160
4192
|
|
|
@@ -7593,6 +7625,8 @@ TalonJS provides 90.6% accuracy with slightly faster performance (1.88ms), makin
|
|
|
7593
7625
|
|
|
7594
7626
|
# Support
|
|
7595
7627
|
|
|
7628
|
+
> Get help with AgentMail through our support channels.
|
|
7629
|
+
|
|
7596
7630
|
## Need Help?
|
|
7597
7631
|
|
|
7598
7632
|
<Cards>
|
|
@@ -9211,8 +9245,6 @@ components:
|
|
|
9211
9245
|
- thread_id
|
|
9212
9246
|
- labels
|
|
9213
9247
|
- timestamp
|
|
9214
|
-
- received_timestamp
|
|
9215
|
-
- sent_timestamp
|
|
9216
9248
|
- senders
|
|
9217
9249
|
- recipients
|
|
9218
9250
|
- last_message_id
|
|
@@ -9679,8 +9711,6 @@ components:
|
|
|
9679
9711
|
- thread_id
|
|
9680
9712
|
- labels
|
|
9681
9713
|
- timestamp
|
|
9682
|
-
- received_timestamp
|
|
9683
|
-
- sent_timestamp
|
|
9684
9714
|
- senders
|
|
9685
9715
|
- recipients
|
|
9686
9716
|
- last_message_id
|
|
@@ -14994,8 +15024,6 @@ components:
|
|
|
14994
15024
|
- thread_id
|
|
14995
15025
|
- labels
|
|
14996
15026
|
- timestamp
|
|
14997
|
-
- received_timestamp
|
|
14998
|
-
- sent_timestamp
|
|
14999
15027
|
- senders
|
|
15000
15028
|
- recipients
|
|
15001
15029
|
- last_message_id
|
|
@@ -15454,8 +15482,6 @@ components:
|
|
|
15454
15482
|
- thread_id
|
|
15455
15483
|
- labels
|
|
15456
15484
|
- timestamp
|
|
15457
|
-
- received_timestamp
|
|
15458
|
-
- sent_timestamp
|
|
15459
15485
|
- senders
|
|
15460
15486
|
- recipients
|
|
15461
15487
|
- last_message_id
|
|
@@ -19062,8 +19088,6 @@ components:
|
|
|
19062
19088
|
- thread_id
|
|
19063
19089
|
- labels
|
|
19064
19090
|
- timestamp
|
|
19065
|
-
- received_timestamp
|
|
19066
|
-
- sent_timestamp
|
|
19067
19091
|
- senders
|
|
19068
19092
|
- recipients
|
|
19069
19093
|
- last_message_id
|
|
@@ -20217,8 +20241,6 @@ components:
|
|
|
20217
20241
|
- thread_id
|
|
20218
20242
|
- labels
|
|
20219
20243
|
- timestamp
|
|
20220
|
-
- received_timestamp
|
|
20221
|
-
- sent_timestamp
|
|
20222
20244
|
- senders
|
|
20223
20245
|
- recipients
|
|
20224
20246
|
- last_message_id
|
|
@@ -23556,8 +23578,6 @@ components:
|
|
|
23556
23578
|
- thread_id
|
|
23557
23579
|
- labels
|
|
23558
23580
|
- timestamp
|
|
23559
|
-
- received_timestamp
|
|
23560
|
-
- sent_timestamp
|
|
23561
23581
|
- senders
|
|
23562
23582
|
- recipients
|
|
23563
23583
|
- last_message_id
|
|
@@ -24026,8 +24046,6 @@ components:
|
|
|
24026
24046
|
- thread_id
|
|
24027
24047
|
- labels
|
|
24028
24048
|
- timestamp
|
|
24029
|
-
- received_timestamp
|
|
24030
|
-
- sent_timestamp
|
|
24031
24049
|
- senders
|
|
24032
24050
|
- recipients
|
|
24033
24051
|
- last_message_id
|
package/dist/llms.txt
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
- [Labels](https://docs.agentmail.to/labels.mdx): Learn how to use Labels to manage state, track campaigns, and filter messages for powerful agentic workflows.
|
|
13
13
|
- [Attachments](https://docs.agentmail.to/attachments.mdx): Learn how to send files as attachments, and download incoming attachments from both messages and threads.
|
|
14
14
|
- [Pods](https://docs.agentmail.to/documentation/core-concepts/pods.mdx): Learn how to use pods for multi-tenant email management
|
|
15
|
+
- [MCP](https://docs.agentmail.to/integrations/mcp.mdx): AgentMail's Model Context Protocol (MCP) integration
|
|
15
16
|
- [Replit](https://docs.agentmail.to/integrations/replit.mdx): AgentMail's Replit integration
|
|
16
17
|
- [Guide: Sending & Receiving Email](https://docs.agentmail.to/sending-receiving-email.mdx): A step-by-step guide to the practical workflow of sending initial emails and handling replies to have a full conversation.
|
|
17
18
|
- [IMAP & SMTP](https://docs.agentmail.to/imap-smtp.mdx): Configure IMAP and SMTP to access your AgentMail inboxes using email clients or programmatic access.
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
- [Frequently Asked Questions (FAQ)](https://docs.agentmail.to/faq.mdx): Find answers to common questions about AgentMail, from core concepts to best practices and security.
|
|
34
35
|
- [Email Reply Extraction with Talon](https://docs.agentmail.to/talon-reply-extraction.mdx): Learn how to use Talon to extract new content from email replies, removing quoted text with 93.8% accuracy.
|
|
35
36
|
- [Join the AgentMail Community](https://docs.agentmail.to/community.mdx): Connect with the AgentMail team and developers, share what you're building, and get support.
|
|
36
|
-
- [Support](https://docs.agentmail.to/
|
|
37
|
+
- [Support](https://docs.agentmail.to/support.mdx): Get help with AgentMail through our support channels.
|
|
37
38
|
- [Understanding Email Authentication (SPF, DKIM, DMARC)](https://docs.agentmail.to/email-protocols.mdx): Learn why we ask for DNS records and what SPF, DKIM, and DMARC are.
|
|
38
39
|
- [SOC 2 Compliance](https://docs.agentmail.to/documentation/resources/security-privacy/soc-2-compliance.mdx): AgentMail's SOC 2 Type I achievement and Type II certification progress.
|
|
39
40
|
- [API Welcome](https://docs.agentmail.to/api-reference.mdx): Quick overview of the AgentMail SDK
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -1978,6 +1978,71 @@ await client.inboxes.messages.replyAll("inbox_id", "message_id", {});
|
|
|
1978
1978
|
</dl>
|
|
1979
1979
|
|
|
1980
1980
|
|
|
1981
|
+
</dd>
|
|
1982
|
+
</dl>
|
|
1983
|
+
</details>
|
|
1984
|
+
|
|
1985
|
+
<details><summary><code>client.inboxes.messages.<a href="/src/api/resources/inboxes/resources/messages/client/Client.ts">forward</a>(inbox_id, message_id, { ...params }) -> AgentMail.SendMessageResponse</code></summary>
|
|
1986
|
+
<dl>
|
|
1987
|
+
<dd>
|
|
1988
|
+
|
|
1989
|
+
#### 🔌 Usage
|
|
1990
|
+
|
|
1991
|
+
<dl>
|
|
1992
|
+
<dd>
|
|
1993
|
+
|
|
1994
|
+
<dl>
|
|
1995
|
+
<dd>
|
|
1996
|
+
|
|
1997
|
+
```typescript
|
|
1998
|
+
await client.inboxes.messages.forward("inbox_id", "message_id", {});
|
|
1999
|
+
|
|
2000
|
+
```
|
|
2001
|
+
</dd>
|
|
2002
|
+
</dl>
|
|
2003
|
+
</dd>
|
|
2004
|
+
</dl>
|
|
2005
|
+
|
|
2006
|
+
#### ⚙️ Parameters
|
|
2007
|
+
|
|
2008
|
+
<dl>
|
|
2009
|
+
<dd>
|
|
2010
|
+
|
|
2011
|
+
<dl>
|
|
2012
|
+
<dd>
|
|
2013
|
+
|
|
2014
|
+
**inbox_id:** `AgentMail.InboxId`
|
|
2015
|
+
|
|
2016
|
+
</dd>
|
|
2017
|
+
</dl>
|
|
2018
|
+
|
|
2019
|
+
<dl>
|
|
2020
|
+
<dd>
|
|
2021
|
+
|
|
2022
|
+
**message_id:** `AgentMail.MessageId`
|
|
2023
|
+
|
|
2024
|
+
</dd>
|
|
2025
|
+
</dl>
|
|
2026
|
+
|
|
2027
|
+
<dl>
|
|
2028
|
+
<dd>
|
|
2029
|
+
|
|
2030
|
+
**request:** `AgentMail.SendMessageRequest`
|
|
2031
|
+
|
|
2032
|
+
</dd>
|
|
2033
|
+
</dl>
|
|
2034
|
+
|
|
2035
|
+
<dl>
|
|
2036
|
+
<dd>
|
|
2037
|
+
|
|
2038
|
+
**requestOptions:** `MessagesClient.RequestOptions`
|
|
2039
|
+
|
|
2040
|
+
</dd>
|
|
2041
|
+
</dl>
|
|
2042
|
+
</dd>
|
|
2043
|
+
</dl>
|
|
2044
|
+
|
|
2045
|
+
|
|
1981
2046
|
</dd>
|
|
1982
2047
|
</dl>
|
|
1983
2048
|
</details>
|