agentmail 0.2.4 → 0.2.6

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.
Files changed (36) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/attachments/types/SendAttachment.d.ts +4 -1
  3. package/dist/cjs/api/resources/attachments/types/index.d.ts +0 -1
  4. package/dist/cjs/api/resources/attachments/types/index.js +0 -1
  5. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +15 -0
  6. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +87 -0
  7. package/dist/cjs/serialization/resources/attachments/types/SendAttachment.d.ts +2 -2
  8. package/dist/cjs/serialization/resources/attachments/types/SendAttachment.js +2 -2
  9. package/dist/cjs/serialization/resources/attachments/types/index.d.ts +0 -1
  10. package/dist/cjs/serialization/resources/attachments/types/index.js +0 -1
  11. package/dist/cjs/version.d.ts +1 -1
  12. package/dist/cjs/version.js +1 -1
  13. package/dist/esm/BaseClient.mjs +2 -2
  14. package/dist/esm/api/resources/attachments/types/SendAttachment.d.mts +4 -1
  15. package/dist/esm/api/resources/attachments/types/index.d.mts +0 -1
  16. package/dist/esm/api/resources/attachments/types/index.mjs +0 -1
  17. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +15 -0
  18. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +87 -0
  19. package/dist/esm/serialization/resources/attachments/types/SendAttachment.d.mts +2 -2
  20. package/dist/esm/serialization/resources/attachments/types/SendAttachment.mjs +2 -2
  21. package/dist/esm/serialization/resources/attachments/types/index.d.mts +0 -1
  22. package/dist/esm/serialization/resources/attachments/types/index.mjs +0 -1
  23. package/dist/esm/version.d.mts +1 -1
  24. package/dist/esm/version.mjs +1 -1
  25. package/dist/llms-full.txt +368 -39
  26. package/dist/llms.txt +3 -1
  27. package/package.json +1 -1
  28. package/reference.md +65 -0
  29. package/dist/cjs/api/resources/attachments/types/AttachmentContent.d.ts +0 -4
  30. package/dist/cjs/api/resources/attachments/types/AttachmentContent.js +0 -3
  31. package/dist/cjs/serialization/resources/attachments/types/AttachmentContent.d.ts +0 -7
  32. package/dist/cjs/serialization/resources/attachments/types/AttachmentContent.js +0 -39
  33. package/dist/esm/api/resources/attachments/types/AttachmentContent.d.mts +0 -4
  34. package/dist/esm/api/resources/attachments/types/AttachmentContent.mjs +0 -2
  35. package/dist/esm/serialization/resources/attachments/types/AttachmentContent.d.mts +0 -7
  36. package/dist/esm/serialization/resources/attachments/types/AttachmentContent.mjs +0 -3
@@ -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.4",
47
- "User-Agent": "agentmail/0.2.4",
46
+ "X-Fern-SDK-Version": "0.2.6",
47
+ "User-Agent": "agentmail/0.2.6",
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);
@@ -4,5 +4,8 @@ export interface SendAttachment {
4
4
  contentType?: AgentMail.AttachmentContentType;
5
5
  contentDisposition?: AgentMail.AttachmentContentDisposition;
6
6
  contentId?: AgentMail.AttachmentContentId;
7
- content: AgentMail.AttachmentContent;
7
+ /** Base64 encoded content of attachment. */
8
+ content?: string;
9
+ /** URL to the attachment. */
10
+ url?: string;
8
11
  }
@@ -1,5 +1,4 @@
1
1
  export * from "./Attachment.js";
2
- export * from "./AttachmentContent.js";
3
2
  export * from "./AttachmentContentDisposition.js";
4
3
  export * from "./AttachmentContentId.js";
5
4
  export * from "./AttachmentContentType.js";
@@ -15,7 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./Attachment.js"), exports);
18
- __exportStar(require("./AttachmentContent.js"), exports);
19
18
  __exportStar(require("./AttachmentContentDisposition.js"), exports);
20
19
  __exportStar(require("./AttachmentContentId.js"), exports);
21
20
  __exportStar(require("./AttachmentContentType.js"), exports);
@@ -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
@@ -1,7 +1,6 @@
1
1
  import type * as AgentMail from "../../../../api/index.js";
2
2
  import * as core from "../../../../core/index.js";
3
3
  import type * as serializers from "../../../index.js";
4
- import { AttachmentContent } from "./AttachmentContent.js";
5
4
  import { AttachmentContentDisposition } from "./AttachmentContentDisposition.js";
6
5
  import { AttachmentContentId } from "./AttachmentContentId.js";
7
6
  import { AttachmentContentType } from "./AttachmentContentType.js";
@@ -13,6 +12,7 @@ export declare namespace SendAttachment {
13
12
  content_type?: AttachmentContentType.Raw | null;
14
13
  content_disposition?: AttachmentContentDisposition.Raw | null;
15
14
  content_id?: AttachmentContentId.Raw | null;
16
- content: AttachmentContent.Raw;
15
+ content?: string | null;
16
+ url?: string | null;
17
17
  }
18
18
  }
@@ -36,7 +36,6 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.SendAttachment = void 0;
38
38
  const core = __importStar(require("../../../../core/index.js"));
39
- const AttachmentContent_js_1 = require("./AttachmentContent.js");
40
39
  const AttachmentContentDisposition_js_1 = require("./AttachmentContentDisposition.js");
41
40
  const AttachmentContentId_js_1 = require("./AttachmentContentId.js");
42
41
  const AttachmentContentType_js_1 = require("./AttachmentContentType.js");
@@ -46,5 +45,6 @@ exports.SendAttachment = core.serialization.object({
46
45
  contentType: core.serialization.property("content_type", AttachmentContentType_js_1.AttachmentContentType.optional()),
47
46
  contentDisposition: core.serialization.property("content_disposition", AttachmentContentDisposition_js_1.AttachmentContentDisposition.optional()),
48
47
  contentId: core.serialization.property("content_id", AttachmentContentId_js_1.AttachmentContentId.optional()),
49
- content: AttachmentContent_js_1.AttachmentContent,
48
+ content: core.serialization.string().optional(),
49
+ url: core.serialization.string().optional(),
50
50
  });
@@ -1,5 +1,4 @@
1
1
  export * from "./Attachment.js";
2
- export * from "./AttachmentContent.js";
3
2
  export * from "./AttachmentContentDisposition.js";
4
3
  export * from "./AttachmentContentId.js";
5
4
  export * from "./AttachmentContentType.js";
@@ -15,7 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./Attachment.js"), exports);
18
- __exportStar(require("./AttachmentContent.js"), exports);
19
18
  __exportStar(require("./AttachmentContentDisposition.js"), exports);
20
19
  __exportStar(require("./AttachmentContentId.js"), exports);
21
20
  __exportStar(require("./AttachmentContentType.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.2.4";
1
+ export declare const SDK_VERSION = "0.2.6";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.2.4";
4
+ exports.SDK_VERSION = "0.2.6";
@@ -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.4",
10
- "User-Agent": "agentmail/0.2.4",
9
+ "X-Fern-SDK-Version": "0.2.6",
10
+ "User-Agent": "agentmail/0.2.6",
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);
@@ -4,5 +4,8 @@ export interface SendAttachment {
4
4
  contentType?: AgentMail.AttachmentContentType;
5
5
  contentDisposition?: AgentMail.AttachmentContentDisposition;
6
6
  contentId?: AgentMail.AttachmentContentId;
7
- content: AgentMail.AttachmentContent;
7
+ /** Base64 encoded content of attachment. */
8
+ content?: string;
9
+ /** URL to the attachment. */
10
+ url?: string;
8
11
  }
@@ -1,5 +1,4 @@
1
1
  export * from "./Attachment.mjs";
2
- export * from "./AttachmentContent.mjs";
3
2
  export * from "./AttachmentContentDisposition.mjs";
4
3
  export * from "./AttachmentContentId.mjs";
5
4
  export * from "./AttachmentContentType.mjs";
@@ -1,5 +1,4 @@
1
1
  export * from "./Attachment.mjs";
2
- export * from "./AttachmentContent.mjs";
3
2
  export * from "./AttachmentContentDisposition.mjs";
4
3
  export * from "./AttachmentContentId.mjs";
5
4
  export * from "./AttachmentContentType.mjs";
@@ -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
@@ -1,7 +1,6 @@
1
1
  import type * as AgentMail from "../../../../api/index.mjs";
2
2
  import * as core from "../../../../core/index.mjs";
3
3
  import type * as serializers from "../../../index.mjs";
4
- import { AttachmentContent } from "./AttachmentContent.mjs";
5
4
  import { AttachmentContentDisposition } from "./AttachmentContentDisposition.mjs";
6
5
  import { AttachmentContentId } from "./AttachmentContentId.mjs";
7
6
  import { AttachmentContentType } from "./AttachmentContentType.mjs";
@@ -13,6 +12,7 @@ export declare namespace SendAttachment {
13
12
  content_type?: AttachmentContentType.Raw | null;
14
13
  content_disposition?: AttachmentContentDisposition.Raw | null;
15
14
  content_id?: AttachmentContentId.Raw | null;
16
- content: AttachmentContent.Raw;
15
+ content?: string | null;
16
+ url?: string | null;
17
17
  }
18
18
  }
@@ -1,6 +1,5 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
  import * as core from "../../../../core/index.mjs";
3
- import { AttachmentContent } from "./AttachmentContent.mjs";
4
3
  import { AttachmentContentDisposition } from "./AttachmentContentDisposition.mjs";
5
4
  import { AttachmentContentId } from "./AttachmentContentId.mjs";
6
5
  import { AttachmentContentType } from "./AttachmentContentType.mjs";
@@ -10,5 +9,6 @@ export const SendAttachment = core.serialization.object({
10
9
  contentType: core.serialization.property("content_type", AttachmentContentType.optional()),
11
10
  contentDisposition: core.serialization.property("content_disposition", AttachmentContentDisposition.optional()),
12
11
  contentId: core.serialization.property("content_id", AttachmentContentId.optional()),
13
- content: AttachmentContent,
12
+ content: core.serialization.string().optional(),
13
+ url: core.serialization.string().optional(),
14
14
  });
@@ -1,5 +1,4 @@
1
1
  export * from "./Attachment.mjs";
2
- export * from "./AttachmentContent.mjs";
3
2
  export * from "./AttachmentContentDisposition.mjs";
4
3
  export * from "./AttachmentContentId.mjs";
5
4
  export * from "./AttachmentContentType.mjs";
@@ -1,5 +1,4 @@
1
1
  export * from "./Attachment.mjs";
2
- export * from "./AttachmentContent.mjs";
3
2
  export * from "./AttachmentContentDisposition.mjs";
4
3
  export * from "./AttachmentContentId.mjs";
5
4
  export * from "./AttachmentContentType.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.2.4";
1
+ export declare const SDK_VERSION = "0.2.6";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.2.4";
1
+ export const SDK_VERSION = "0.2.6";
@@ -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
- Exisiting email infrastructure was built for humans. Legacy providers such as Gmail and Outlook have several limitations for agentic use cases:
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 attachements, semantically search your inbox, by exploring our docs and tutorials below.
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. Thats of the past.
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
- Pssstt! Rather then sending 1000 emails from 1 `Inbox` sending 10 emails
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: docs-testing”,
397
- domain: domain.com”,
398
- displayName: Docs Tester”,
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: recipent@domain.com
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
- cosnt filteredThreads = await client.inboxes.threads.list(
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 succesfully left our servers and is out
2945
- to travel the network. This is typically happens before `message.delivered`
2946
- where `message.delivered` means the recieving email server(whether its Gmail
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 properitary
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 of the spam alarms. Don't do it. Also get rid of your
4156
- open-tracker while your at it because how EVERY service checks if the
4157
- reciepeint of your email opened your message is by encoding a small image
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
@@ -12283,6 +12313,317 @@ let dataTask = session.dataTask(with: request as URLRequest, completionHandler:
12283
12313
  dataTask.resume()
12284
12314
  ```
12285
12315
 
12316
+ # Forward Message
12317
+
12318
+ POST https://api.agentmail.to/v0/inboxes/{inbox_id}/messages/{message_id}/forward
12319
+ Content-Type: application/json
12320
+
12321
+ Reference: https://docs.agentmail.to/api-reference/inboxes/messages/forward
12322
+
12323
+ ## OpenAPI Specification
12324
+
12325
+ ```yaml
12326
+ openapi: 3.1.1
12327
+ info:
12328
+ title: Forward Message
12329
+ version: endpoint_inboxes/messages.forward
12330
+ paths:
12331
+ /v0/inboxes/{inbox_id}/messages/{message_id}/forward:
12332
+ post:
12333
+ operationId: forward
12334
+ summary: Forward Message
12335
+ tags:
12336
+ - - subpackage_inboxes
12337
+ - subpackage_inboxes/messages
12338
+ parameters:
12339
+ - name: inbox_id
12340
+ in: path
12341
+ required: true
12342
+ schema:
12343
+ $ref: '#/components/schemas/type_inboxes:InboxId'
12344
+ - name: message_id
12345
+ in: path
12346
+ required: true
12347
+ schema:
12348
+ $ref: '#/components/schemas/type_messages:MessageId'
12349
+ - name: Authorization
12350
+ in: header
12351
+ description: >-
12352
+ Bearer authentication of the form `Bearer <token>`, where token is
12353
+ your auth token.
12354
+ required: true
12355
+ schema:
12356
+ type: string
12357
+ responses:
12358
+ '200':
12359
+ description: Response with status 200
12360
+ content:
12361
+ application/json:
12362
+ schema:
12363
+ $ref: '#/components/schemas/type_messages:SendMessageResponse'
12364
+ '400':
12365
+ description: Error response with status 400
12366
+ content: {}
12367
+ '403':
12368
+ description: Error response with status 403
12369
+ content: {}
12370
+ '404':
12371
+ description: Error response with status 404
12372
+ content: {}
12373
+ requestBody:
12374
+ content:
12375
+ application/json:
12376
+ schema:
12377
+ $ref: '#/components/schemas/type_messages:SendMessageRequest'
12378
+ components:
12379
+ schemas:
12380
+ type_inboxes:InboxId:
12381
+ type: string
12382
+ type_messages:MessageId:
12383
+ type: string
12384
+ type_messages:MessageLabels:
12385
+ type: array
12386
+ items:
12387
+ type: string
12388
+ type_messages:Addresses:
12389
+ oneOf:
12390
+ - type: string
12391
+ - type: array
12392
+ items:
12393
+ type: string
12394
+ type_messages:SendMessageReplyTo:
12395
+ $ref: '#/components/schemas/type_messages:Addresses'
12396
+ type_messages:SendMessageTo:
12397
+ $ref: '#/components/schemas/type_messages:Addresses'
12398
+ type_messages:SendMessageCc:
12399
+ $ref: '#/components/schemas/type_messages:Addresses'
12400
+ type_messages:SendMessageBcc:
12401
+ $ref: '#/components/schemas/type_messages:Addresses'
12402
+ type_messages:MessageSubject:
12403
+ type: string
12404
+ type_messages:MessageText:
12405
+ type: string
12406
+ type_messages:MessageHtml:
12407
+ type: string
12408
+ type_attachments:AttachmentFilename:
12409
+ type: string
12410
+ type_attachments:AttachmentContentType:
12411
+ type: string
12412
+ type_attachments:AttachmentContentDisposition:
12413
+ type: string
12414
+ enum:
12415
+ - value: inline
12416
+ - value: attachment
12417
+ type_attachments:AttachmentContentId:
12418
+ type: string
12419
+ type_attachments:AttachmentContent:
12420
+ type: string
12421
+ type_attachments:SendAttachment:
12422
+ type: object
12423
+ properties:
12424
+ filename:
12425
+ $ref: '#/components/schemas/type_attachments:AttachmentFilename'
12426
+ content_type:
12427
+ $ref: '#/components/schemas/type_attachments:AttachmentContentType'
12428
+ content_disposition:
12429
+ $ref: '#/components/schemas/type_attachments:AttachmentContentDisposition'
12430
+ content_id:
12431
+ $ref: '#/components/schemas/type_attachments:AttachmentContentId'
12432
+ content:
12433
+ $ref: '#/components/schemas/type_attachments:AttachmentContent'
12434
+ required:
12435
+ - content
12436
+ type_messages:SendMessageAttachments:
12437
+ type: array
12438
+ items:
12439
+ $ref: '#/components/schemas/type_attachments:SendAttachment'
12440
+ type_messages:SendMessageHeaders:
12441
+ type: object
12442
+ additionalProperties:
12443
+ type: string
12444
+ type_messages:SendMessageRequest:
12445
+ type: object
12446
+ properties:
12447
+ labels:
12448
+ $ref: '#/components/schemas/type_messages:MessageLabels'
12449
+ reply_to:
12450
+ $ref: '#/components/schemas/type_messages:SendMessageReplyTo'
12451
+ to:
12452
+ $ref: '#/components/schemas/type_messages:SendMessageTo'
12453
+ cc:
12454
+ $ref: '#/components/schemas/type_messages:SendMessageCc'
12455
+ bcc:
12456
+ $ref: '#/components/schemas/type_messages:SendMessageBcc'
12457
+ subject:
12458
+ $ref: '#/components/schemas/type_messages:MessageSubject'
12459
+ text:
12460
+ $ref: '#/components/schemas/type_messages:MessageText'
12461
+ html:
12462
+ $ref: '#/components/schemas/type_messages:MessageHtml'
12463
+ attachments:
12464
+ $ref: '#/components/schemas/type_messages:SendMessageAttachments'
12465
+ headers:
12466
+ $ref: '#/components/schemas/type_messages:SendMessageHeaders'
12467
+ type_threads:ThreadId:
12468
+ type: string
12469
+ type_messages:SendMessageResponse:
12470
+ type: object
12471
+ properties:
12472
+ message_id:
12473
+ $ref: '#/components/schemas/type_messages:MessageId'
12474
+ thread_id:
12475
+ $ref: '#/components/schemas/type_threads:ThreadId'
12476
+ required:
12477
+ - message_id
12478
+ - thread_id
12479
+
12480
+ ```
12481
+
12482
+ ## SDK Code Examples
12483
+
12484
+ ```typescript
12485
+ import { AgentMailClient } from "agentmail";
12486
+
12487
+ async function main() {
12488
+ const client = new AgentMailClient({
12489
+ environment: "https://api.agentmail.to",
12490
+ apiKey: "YOUR_TOKEN_HERE",
12491
+ });
12492
+ await client.inboxes.messages.forward("inbox_id", "message_id", {});
12493
+ }
12494
+ main();
12495
+
12496
+ ```
12497
+
12498
+ ```python
12499
+ from agentmail import AgentMail
12500
+
12501
+ client = AgentMail(
12502
+ base_url="https://api.agentmail.to",
12503
+ api_key="YOUR_TOKEN_HERE"
12504
+ )
12505
+
12506
+ client.inboxes.messages.forward(
12507
+ inbox_id="inbox_id",
12508
+ message_id="message_id"
12509
+ )
12510
+
12511
+ ```
12512
+
12513
+ ```go
12514
+ package main
12515
+
12516
+ import (
12517
+ "fmt"
12518
+ "strings"
12519
+ "net/http"
12520
+ "io"
12521
+ )
12522
+
12523
+ func main() {
12524
+
12525
+ url := "https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/forward"
12526
+
12527
+ payload := strings.NewReader("{}")
12528
+
12529
+ req, _ := http.NewRequest("POST", url, payload)
12530
+
12531
+ req.Header.Add("Authorization", "Bearer <api_key>")
12532
+ req.Header.Add("Content-Type", "application/json")
12533
+
12534
+ res, _ := http.DefaultClient.Do(req)
12535
+
12536
+ defer res.Body.Close()
12537
+ body, _ := io.ReadAll(res.Body)
12538
+
12539
+ fmt.Println(res)
12540
+ fmt.Println(string(body))
12541
+
12542
+ }
12543
+ ```
12544
+
12545
+ ```ruby
12546
+ require 'uri'
12547
+ require 'net/http'
12548
+
12549
+ url = URI("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/forward")
12550
+
12551
+ http = Net::HTTP.new(url.host, url.port)
12552
+ http.use_ssl = true
12553
+
12554
+ request = Net::HTTP::Post.new(url)
12555
+ request["Authorization"] = 'Bearer <api_key>'
12556
+ request["Content-Type"] = 'application/json'
12557
+ request.body = "{}"
12558
+
12559
+ response = http.request(request)
12560
+ puts response.read_body
12561
+ ```
12562
+
12563
+ ```java
12564
+ HttpResponse<String> response = Unirest.post("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/forward")
12565
+ .header("Authorization", "Bearer <api_key>")
12566
+ .header("Content-Type", "application/json")
12567
+ .body("{}")
12568
+ .asString();
12569
+ ```
12570
+
12571
+ ```php
12572
+ <?php
12573
+
12574
+ $client = new \GuzzleHttp\Client();
12575
+
12576
+ $response = $client->request('POST', 'https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/forward', [
12577
+ 'body' => '{}',
12578
+ 'headers' => [
12579
+ 'Authorization' => 'Bearer <api_key>',
12580
+ 'Content-Type' => 'application/json',
12581
+ ],
12582
+ ]);
12583
+
12584
+ echo $response->getBody();
12585
+ ```
12586
+
12587
+ ```csharp
12588
+ var client = new RestClient("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/forward");
12589
+ var request = new RestRequest(Method.POST);
12590
+ request.AddHeader("Authorization", "Bearer <api_key>");
12591
+ request.AddHeader("Content-Type", "application/json");
12592
+ request.AddParameter("application/json", "{}", ParameterType.RequestBody);
12593
+ IRestResponse response = client.Execute(request);
12594
+ ```
12595
+
12596
+ ```swift
12597
+ import Foundation
12598
+
12599
+ let headers = [
12600
+ "Authorization": "Bearer <api_key>",
12601
+ "Content-Type": "application/json"
12602
+ ]
12603
+ let parameters = [] as [String : Any]
12604
+
12605
+ let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
12606
+
12607
+ let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/forward")! as URL,
12608
+ cachePolicy: .useProtocolCachePolicy,
12609
+ timeoutInterval: 10.0)
12610
+ request.httpMethod = "POST"
12611
+ request.allHTTPHeaderFields = headers
12612
+ request.httpBody = postData as Data
12613
+
12614
+ let session = URLSession.shared
12615
+ let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
12616
+ if (error != nil) {
12617
+ print(error as Any)
12618
+ } else {
12619
+ let httpResponse = response as? HTTPURLResponse
12620
+ print(httpResponse)
12621
+ }
12622
+ })
12623
+
12624
+ dataTask.resume()
12625
+ ```
12626
+
12286
12627
  # Update Message
12287
12628
 
12288
12629
  PATCH https://api.agentmail.to/v0/inboxes/{inbox_id}/messages/{message_id}
@@ -14994,8 +15335,6 @@ components:
14994
15335
  - thread_id
14995
15336
  - labels
14996
15337
  - timestamp
14997
- - received_timestamp
14998
- - sent_timestamp
14999
15338
  - senders
15000
15339
  - recipients
15001
15340
  - last_message_id
@@ -15454,8 +15793,6 @@ components:
15454
15793
  - thread_id
15455
15794
  - labels
15456
15795
  - timestamp
15457
- - received_timestamp
15458
- - sent_timestamp
15459
15796
  - senders
15460
15797
  - recipients
15461
15798
  - last_message_id
@@ -19062,8 +19399,6 @@ components:
19062
19399
  - thread_id
19063
19400
  - labels
19064
19401
  - timestamp
19065
- - received_timestamp
19066
- - sent_timestamp
19067
19402
  - senders
19068
19403
  - recipients
19069
19404
  - last_message_id
@@ -20217,8 +20552,6 @@ components:
20217
20552
  - thread_id
20218
20553
  - labels
20219
20554
  - timestamp
20220
- - received_timestamp
20221
- - sent_timestamp
20222
20555
  - senders
20223
20556
  - recipients
20224
20557
  - last_message_id
@@ -23556,8 +23889,6 @@ components:
23556
23889
  - thread_id
23557
23890
  - labels
23558
23891
  - timestamp
23559
- - received_timestamp
23560
- - sent_timestamp
23561
23892
  - senders
23562
23893
  - recipients
23563
23894
  - last_message_id
@@ -24026,8 +24357,6 @@ components:
24026
24357
  - thread_id
24027
24358
  - labels
24028
24359
  - timestamp
24029
- - received_timestamp
24030
- - sent_timestamp
24031
24360
  - senders
24032
24361
  - recipients
24033
24362
  - 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/documentation/resources/support.mdx)
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
@@ -56,6 +57,7 @@
56
57
  - API Reference > Inboxes > Messages [Send Message](https://docs.agentmail.to/api-reference/inboxes/messages/send.mdx)
57
58
  - API Reference > Inboxes > Messages [Reply To Message](https://docs.agentmail.to/api-reference/inboxes/messages/reply.mdx)
58
59
  - API Reference > Inboxes > Messages [Reply All Message](https://docs.agentmail.to/api-reference/inboxes/messages/reply-all.mdx)
60
+ - API Reference > Inboxes > Messages [Forward Message](https://docs.agentmail.to/api-reference/inboxes/messages/forward.mdx)
59
61
  - API Reference > Inboxes > Messages [Update Message](https://docs.agentmail.to/api-reference/inboxes/messages/update.mdx)
60
62
  - API Reference > Inboxes > Drafts [List Drafts](https://docs.agentmail.to/api-reference/inboxes/drafts/list.mdx)
61
63
  - API Reference > Inboxes > Drafts [Get Draft](https://docs.agentmail.to/api-reference/inboxes/drafts/get.mdx)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentmail",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
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>
@@ -1,4 +0,0 @@
1
- /**
2
- * Base64 encoded content of attachment.
3
- */
4
- export type AttachmentContent = string;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was auto-generated by Fern from our API Definition.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +0,0 @@
1
- import type * as AgentMail from "../../../../api/index.js";
2
- import * as core from "../../../../core/index.js";
3
- import type * as serializers from "../../../index.js";
4
- export declare const AttachmentContent: core.serialization.Schema<serializers.AttachmentContent.Raw, AgentMail.AttachmentContent>;
5
- export declare namespace AttachmentContent {
6
- type Raw = string;
7
- }
@@ -1,39 +0,0 @@
1
- "use strict";
2
- // This file was auto-generated by Fern from our API Definition.
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
36
- Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.AttachmentContent = void 0;
38
- const core = __importStar(require("../../../../core/index.js"));
39
- exports.AttachmentContent = core.serialization.string();
@@ -1,4 +0,0 @@
1
- /**
2
- * Base64 encoded content of attachment.
3
- */
4
- export type AttachmentContent = string;
@@ -1,2 +0,0 @@
1
- // This file was auto-generated by Fern from our API Definition.
2
- export {};
@@ -1,7 +0,0 @@
1
- import type * as AgentMail from "../../../../api/index.mjs";
2
- import * as core from "../../../../core/index.mjs";
3
- import type * as serializers from "../../../index.mjs";
4
- export declare const AttachmentContent: core.serialization.Schema<serializers.AttachmentContent.Raw, AgentMail.AttachmentContent>;
5
- export declare namespace AttachmentContent {
6
- type Raw = string;
7
- }
@@ -1,3 +0,0 @@
1
- // This file was auto-generated by Fern from our API Definition.
2
- import * as core from "../../../../core/index.mjs";
3
- export const AttachmentContent = core.serialization.string();