From dc44f14ff70ef742492d1e4da96eae7ee3401a34 Mon Sep 17 00:00:00 2001 From: fern-support <126544928+fern-support@users.noreply.github.com> Date: Thu, 4 Jun 2026 11:42:08 -0400 Subject: [PATCH 01/18] move fern definition files --- .../{ => apis/api}/definition/__package__.yml | 0 fern/{ => apis/api}/definition/agent.yml | 0 fern/{ => apis/api}/definition/api-keys.yml | 0 fern/{ => apis/api}/definition/api.yml | 0 .../{ => apis/api}/definition/attachments.yml | 0 fern/{ => apis/api}/definition/auth.yml | 0 fern/{ => apis/api}/definition/domains.yml | 0 fern/{ => apis/api}/definition/drafts.yml | 0 fern/{ => apis/api}/definition/events.yml | 0 .../api}/definition/inbox-events.yml | 0 .../api}/definition/inboxes/__package__.yml | 0 .../api}/definition/inboxes/api-keys.yml | 0 .../api}/definition/inboxes/drafts.yml | 0 .../api}/definition/inboxes/events.yml | 0 .../api}/definition/inboxes/lists.yml | 0 .../api}/definition/inboxes/messages.yml | 0 .../api}/definition/inboxes/metrics.yml | 0 .../api}/definition/inboxes/threads.yml | 0 fern/{ => apis/api}/definition/lists.yml | 0 fern/{ => apis/api}/definition/messages.yml | 0 fern/{ => apis/api}/definition/metrics.yml | 0 .../api}/definition/organizations.yml | 0 .../api}/definition/pods/__package__.yml | 0 .../api}/definition/pods/api-keys.yml | 0 .../api}/definition/pods/domains.yml | 0 .../{ => apis/api}/definition/pods/drafts.yml | 0 .../api}/definition/pods/inboxes.yml | 0 fern/{ => apis/api}/definition/pods/lists.yml | 0 .../api}/definition/pods/metrics.yml | 0 .../api}/definition/pods/threads.yml | 0 fern/{ => apis/api}/definition/threads.yml | 0 .../api}/definition/webhooks/__package__.yml | 0 .../api}/definition/webhooks/events.yml | 0 fern/{ => apis/api}/definition/websockets.yml | 0 fern/{ => apis/api}/generators.yml | 0 fern/apis/cli/generators.yml | 13 ++ fern/apis/cli/openapi.yml | 129 ++++++++++++++++++ fern/fern.config.json | 2 +- 38 files changed, 143 insertions(+), 1 deletion(-) rename fern/{ => apis/api}/definition/__package__.yml (100%) rename fern/{ => apis/api}/definition/agent.yml (100%) rename fern/{ => apis/api}/definition/api-keys.yml (100%) rename fern/{ => apis/api}/definition/api.yml (100%) rename fern/{ => apis/api}/definition/attachments.yml (100%) rename fern/{ => apis/api}/definition/auth.yml (100%) rename fern/{ => apis/api}/definition/domains.yml (100%) rename fern/{ => apis/api}/definition/drafts.yml (100%) rename fern/{ => apis/api}/definition/events.yml (100%) rename fern/{ => apis/api}/definition/inbox-events.yml (100%) rename fern/{ => apis/api}/definition/inboxes/__package__.yml (100%) rename fern/{ => apis/api}/definition/inboxes/api-keys.yml (100%) rename fern/{ => apis/api}/definition/inboxes/drafts.yml (100%) rename fern/{ => apis/api}/definition/inboxes/events.yml (100%) rename fern/{ => apis/api}/definition/inboxes/lists.yml (100%) rename fern/{ => apis/api}/definition/inboxes/messages.yml (100%) rename fern/{ => apis/api}/definition/inboxes/metrics.yml (100%) rename fern/{ => apis/api}/definition/inboxes/threads.yml (100%) rename fern/{ => apis/api}/definition/lists.yml (100%) rename fern/{ => apis/api}/definition/messages.yml (100%) rename fern/{ => apis/api}/definition/metrics.yml (100%) rename fern/{ => apis/api}/definition/organizations.yml (100%) rename fern/{ => apis/api}/definition/pods/__package__.yml (100%) rename fern/{ => apis/api}/definition/pods/api-keys.yml (100%) rename fern/{ => apis/api}/definition/pods/domains.yml (100%) rename fern/{ => apis/api}/definition/pods/drafts.yml (100%) rename fern/{ => apis/api}/definition/pods/inboxes.yml (100%) rename fern/{ => apis/api}/definition/pods/lists.yml (100%) rename fern/{ => apis/api}/definition/pods/metrics.yml (100%) rename fern/{ => apis/api}/definition/pods/threads.yml (100%) rename fern/{ => apis/api}/definition/threads.yml (100%) rename fern/{ => apis/api}/definition/webhooks/__package__.yml (100%) rename fern/{ => apis/api}/definition/webhooks/events.yml (100%) rename fern/{ => apis/api}/definition/websockets.yml (100%) rename fern/{ => apis/api}/generators.yml (100%) create mode 100644 fern/apis/cli/generators.yml create mode 100644 fern/apis/cli/openapi.yml diff --git a/fern/definition/__package__.yml b/fern/apis/api/definition/__package__.yml similarity index 100% rename from fern/definition/__package__.yml rename to fern/apis/api/definition/__package__.yml diff --git a/fern/definition/agent.yml b/fern/apis/api/definition/agent.yml similarity index 100% rename from fern/definition/agent.yml rename to fern/apis/api/definition/agent.yml diff --git a/fern/definition/api-keys.yml b/fern/apis/api/definition/api-keys.yml similarity index 100% rename from fern/definition/api-keys.yml rename to fern/apis/api/definition/api-keys.yml diff --git a/fern/definition/api.yml b/fern/apis/api/definition/api.yml similarity index 100% rename from fern/definition/api.yml rename to fern/apis/api/definition/api.yml diff --git a/fern/definition/attachments.yml b/fern/apis/api/definition/attachments.yml similarity index 100% rename from fern/definition/attachments.yml rename to fern/apis/api/definition/attachments.yml diff --git a/fern/definition/auth.yml b/fern/apis/api/definition/auth.yml similarity index 100% rename from fern/definition/auth.yml rename to fern/apis/api/definition/auth.yml diff --git a/fern/definition/domains.yml b/fern/apis/api/definition/domains.yml similarity index 100% rename from fern/definition/domains.yml rename to fern/apis/api/definition/domains.yml diff --git a/fern/definition/drafts.yml b/fern/apis/api/definition/drafts.yml similarity index 100% rename from fern/definition/drafts.yml rename to fern/apis/api/definition/drafts.yml diff --git a/fern/definition/events.yml b/fern/apis/api/definition/events.yml similarity index 100% rename from fern/definition/events.yml rename to fern/apis/api/definition/events.yml diff --git a/fern/definition/inbox-events.yml b/fern/apis/api/definition/inbox-events.yml similarity index 100% rename from fern/definition/inbox-events.yml rename to fern/apis/api/definition/inbox-events.yml diff --git a/fern/definition/inboxes/__package__.yml b/fern/apis/api/definition/inboxes/__package__.yml similarity index 100% rename from fern/definition/inboxes/__package__.yml rename to fern/apis/api/definition/inboxes/__package__.yml diff --git a/fern/definition/inboxes/api-keys.yml b/fern/apis/api/definition/inboxes/api-keys.yml similarity index 100% rename from fern/definition/inboxes/api-keys.yml rename to fern/apis/api/definition/inboxes/api-keys.yml diff --git a/fern/definition/inboxes/drafts.yml b/fern/apis/api/definition/inboxes/drafts.yml similarity index 100% rename from fern/definition/inboxes/drafts.yml rename to fern/apis/api/definition/inboxes/drafts.yml diff --git a/fern/definition/inboxes/events.yml b/fern/apis/api/definition/inboxes/events.yml similarity index 100% rename from fern/definition/inboxes/events.yml rename to fern/apis/api/definition/inboxes/events.yml diff --git a/fern/definition/inboxes/lists.yml b/fern/apis/api/definition/inboxes/lists.yml similarity index 100% rename from fern/definition/inboxes/lists.yml rename to fern/apis/api/definition/inboxes/lists.yml diff --git a/fern/definition/inboxes/messages.yml b/fern/apis/api/definition/inboxes/messages.yml similarity index 100% rename from fern/definition/inboxes/messages.yml rename to fern/apis/api/definition/inboxes/messages.yml diff --git a/fern/definition/inboxes/metrics.yml b/fern/apis/api/definition/inboxes/metrics.yml similarity index 100% rename from fern/definition/inboxes/metrics.yml rename to fern/apis/api/definition/inboxes/metrics.yml diff --git a/fern/definition/inboxes/threads.yml b/fern/apis/api/definition/inboxes/threads.yml similarity index 100% rename from fern/definition/inboxes/threads.yml rename to fern/apis/api/definition/inboxes/threads.yml diff --git a/fern/definition/lists.yml b/fern/apis/api/definition/lists.yml similarity index 100% rename from fern/definition/lists.yml rename to fern/apis/api/definition/lists.yml diff --git a/fern/definition/messages.yml b/fern/apis/api/definition/messages.yml similarity index 100% rename from fern/definition/messages.yml rename to fern/apis/api/definition/messages.yml diff --git a/fern/definition/metrics.yml b/fern/apis/api/definition/metrics.yml similarity index 100% rename from fern/definition/metrics.yml rename to fern/apis/api/definition/metrics.yml diff --git a/fern/definition/organizations.yml b/fern/apis/api/definition/organizations.yml similarity index 100% rename from fern/definition/organizations.yml rename to fern/apis/api/definition/organizations.yml diff --git a/fern/definition/pods/__package__.yml b/fern/apis/api/definition/pods/__package__.yml similarity index 100% rename from fern/definition/pods/__package__.yml rename to fern/apis/api/definition/pods/__package__.yml diff --git a/fern/definition/pods/api-keys.yml b/fern/apis/api/definition/pods/api-keys.yml similarity index 100% rename from fern/definition/pods/api-keys.yml rename to fern/apis/api/definition/pods/api-keys.yml diff --git a/fern/definition/pods/domains.yml b/fern/apis/api/definition/pods/domains.yml similarity index 100% rename from fern/definition/pods/domains.yml rename to fern/apis/api/definition/pods/domains.yml diff --git a/fern/definition/pods/drafts.yml b/fern/apis/api/definition/pods/drafts.yml similarity index 100% rename from fern/definition/pods/drafts.yml rename to fern/apis/api/definition/pods/drafts.yml diff --git a/fern/definition/pods/inboxes.yml b/fern/apis/api/definition/pods/inboxes.yml similarity index 100% rename from fern/definition/pods/inboxes.yml rename to fern/apis/api/definition/pods/inboxes.yml diff --git a/fern/definition/pods/lists.yml b/fern/apis/api/definition/pods/lists.yml similarity index 100% rename from fern/definition/pods/lists.yml rename to fern/apis/api/definition/pods/lists.yml diff --git a/fern/definition/pods/metrics.yml b/fern/apis/api/definition/pods/metrics.yml similarity index 100% rename from fern/definition/pods/metrics.yml rename to fern/apis/api/definition/pods/metrics.yml diff --git a/fern/definition/pods/threads.yml b/fern/apis/api/definition/pods/threads.yml similarity index 100% rename from fern/definition/pods/threads.yml rename to fern/apis/api/definition/pods/threads.yml diff --git a/fern/definition/threads.yml b/fern/apis/api/definition/threads.yml similarity index 100% rename from fern/definition/threads.yml rename to fern/apis/api/definition/threads.yml diff --git a/fern/definition/webhooks/__package__.yml b/fern/apis/api/definition/webhooks/__package__.yml similarity index 100% rename from fern/definition/webhooks/__package__.yml rename to fern/apis/api/definition/webhooks/__package__.yml diff --git a/fern/definition/webhooks/events.yml b/fern/apis/api/definition/webhooks/events.yml similarity index 100% rename from fern/definition/webhooks/events.yml rename to fern/apis/api/definition/webhooks/events.yml diff --git a/fern/definition/websockets.yml b/fern/apis/api/definition/websockets.yml similarity index 100% rename from fern/definition/websockets.yml rename to fern/apis/api/definition/websockets.yml diff --git a/fern/generators.yml b/fern/apis/api/generators.yml similarity index 100% rename from fern/generators.yml rename to fern/apis/api/generators.yml diff --git a/fern/apis/cli/generators.yml b/fern/apis/cli/generators.yml new file mode 100644 index 00000000..bc31346f --- /dev/null +++ b/fern/apis/cli/generators.yml @@ -0,0 +1,13 @@ +# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json +api: + specs: + - openapi: openapi.yml +default-group: local +groups: + local: + generators: + - name: fern-typescript-sdk + output: + location: local-file-system + path: ../sdks/typescript + version: 3.71.3 diff --git a/fern/apis/cli/openapi.yml b/fern/apis/cli/openapi.yml new file mode 100644 index 00000000..193397f1 --- /dev/null +++ b/fern/apis/cli/openapi.yml @@ -0,0 +1,129 @@ +openapi: 3.0.3 +info: + title: Petstore API + version: 1.0.0 + description: A sample API for managing pets. + +paths: + /pets: + get: + summary: List all pets + operationId: listPets + tags: + - pets + parameters: + - name: limit + in: query + required: false + schema: + type: integer + format: int32 + maximum: 100 + description: Maximum number of pets to return. + responses: + "200": + description: A list of pets. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Pet" + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + summary: Create a pet + operationId: createPet + tags: + - pets + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreatePetRequest" + responses: + "201": + description: The created pet. + content: + application/json: + schema: + $ref: "#/components/schemas/Pet" + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /pets/{petId}: + get: + summary: Get a pet by ID + operationId: getPet + tags: + - pets + parameters: + - name: petId + in: path + required: true + schema: + type: string + description: The ID of the pet to retrieve. + responses: + "200": + description: The requested pet. + content: + application/json: + schema: + $ref: "#/components/schemas/Pet" + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + +components: + schemas: + Pet: + type: object + required: + - id + - name + properties: + id: + type: string + description: Unique identifier for the pet. + name: + type: string + description: Name of the pet. + tag: + type: string + description: Optional tag for the pet. + CreatePetRequest: + type: object + required: + - name + properties: + name: + type: string + description: Name of the pet. + tag: + type: string + description: Optional tag for the pet. + Error: + type: object + required: + - code + - message + properties: + code: + type: integer + format: int32 + description: Error code. + message: + type: string + description: Error message. diff --git a/fern/fern.config.json b/fern/fern.config.json index 37a78f6e..9d4ae7a5 100644 --- a/fern/fern.config.json +++ b/fern/fern.config.json @@ -1,4 +1,4 @@ { "organization": "agentmail", - "version": "4.63.0" + "version": "5.44.8" } From 3c29ed8a66438789d41cd2979ff880178f72fe6b Mon Sep 17 00:00:00 2001 From: fern-support <126544928+fern-support@users.noreply.github.com> Date: Thu, 4 Jun 2026 11:45:49 -0400 Subject: [PATCH 02/18] rename api folders --- fern/apis/{api => fern-def}/definition/__package__.yml | 0 fern/apis/{api => fern-def}/definition/agent.yml | 0 fern/apis/{api => fern-def}/definition/api-keys.yml | 0 fern/apis/{api => fern-def}/definition/api.yml | 0 fern/apis/{api => fern-def}/definition/attachments.yml | 0 fern/apis/{api => fern-def}/definition/auth.yml | 0 fern/apis/{api => fern-def}/definition/domains.yml | 0 fern/apis/{api => fern-def}/definition/drafts.yml | 0 fern/apis/{api => fern-def}/definition/events.yml | 0 fern/apis/{api => fern-def}/definition/inbox-events.yml | 0 fern/apis/{api => fern-def}/definition/inboxes/__package__.yml | 0 fern/apis/{api => fern-def}/definition/inboxes/api-keys.yml | 0 fern/apis/{api => fern-def}/definition/inboxes/drafts.yml | 0 fern/apis/{api => fern-def}/definition/inboxes/events.yml | 0 fern/apis/{api => fern-def}/definition/inboxes/lists.yml | 0 fern/apis/{api => fern-def}/definition/inboxes/messages.yml | 0 fern/apis/{api => fern-def}/definition/inboxes/metrics.yml | 0 fern/apis/{api => fern-def}/definition/inboxes/threads.yml | 0 fern/apis/{api => fern-def}/definition/lists.yml | 0 fern/apis/{api => fern-def}/definition/messages.yml | 0 fern/apis/{api => fern-def}/definition/metrics.yml | 0 fern/apis/{api => fern-def}/definition/organizations.yml | 0 fern/apis/{api => fern-def}/definition/pods/__package__.yml | 0 fern/apis/{api => fern-def}/definition/pods/api-keys.yml | 0 fern/apis/{api => fern-def}/definition/pods/domains.yml | 0 fern/apis/{api => fern-def}/definition/pods/drafts.yml | 0 fern/apis/{api => fern-def}/definition/pods/inboxes.yml | 0 fern/apis/{api => fern-def}/definition/pods/lists.yml | 0 fern/apis/{api => fern-def}/definition/pods/metrics.yml | 0 fern/apis/{api => fern-def}/definition/pods/threads.yml | 0 fern/apis/{api => fern-def}/definition/threads.yml | 0 fern/apis/{api => fern-def}/definition/webhooks/__package__.yml | 0 fern/apis/{api => fern-def}/definition/webhooks/events.yml | 0 fern/apis/{api => fern-def}/definition/websockets.yml | 0 fern/apis/{api => fern-def}/generators.yml | 0 fern/apis/{cli => openapi-spec}/generators.yml | 0 fern/apis/{cli => openapi-spec}/openapi.yml | 0 37 files changed, 0 insertions(+), 0 deletions(-) rename fern/apis/{api => fern-def}/definition/__package__.yml (100%) rename fern/apis/{api => fern-def}/definition/agent.yml (100%) rename fern/apis/{api => fern-def}/definition/api-keys.yml (100%) rename fern/apis/{api => fern-def}/definition/api.yml (100%) rename fern/apis/{api => fern-def}/definition/attachments.yml (100%) rename fern/apis/{api => fern-def}/definition/auth.yml (100%) rename fern/apis/{api => fern-def}/definition/domains.yml (100%) rename fern/apis/{api => fern-def}/definition/drafts.yml (100%) rename fern/apis/{api => fern-def}/definition/events.yml (100%) rename fern/apis/{api => fern-def}/definition/inbox-events.yml (100%) rename fern/apis/{api => fern-def}/definition/inboxes/__package__.yml (100%) rename fern/apis/{api => fern-def}/definition/inboxes/api-keys.yml (100%) rename fern/apis/{api => fern-def}/definition/inboxes/drafts.yml (100%) rename fern/apis/{api => fern-def}/definition/inboxes/events.yml (100%) rename fern/apis/{api => fern-def}/definition/inboxes/lists.yml (100%) rename fern/apis/{api => fern-def}/definition/inboxes/messages.yml (100%) rename fern/apis/{api => fern-def}/definition/inboxes/metrics.yml (100%) rename fern/apis/{api => fern-def}/definition/inboxes/threads.yml (100%) rename fern/apis/{api => fern-def}/definition/lists.yml (100%) rename fern/apis/{api => fern-def}/definition/messages.yml (100%) rename fern/apis/{api => fern-def}/definition/metrics.yml (100%) rename fern/apis/{api => fern-def}/definition/organizations.yml (100%) rename fern/apis/{api => fern-def}/definition/pods/__package__.yml (100%) rename fern/apis/{api => fern-def}/definition/pods/api-keys.yml (100%) rename fern/apis/{api => fern-def}/definition/pods/domains.yml (100%) rename fern/apis/{api => fern-def}/definition/pods/drafts.yml (100%) rename fern/apis/{api => fern-def}/definition/pods/inboxes.yml (100%) rename fern/apis/{api => fern-def}/definition/pods/lists.yml (100%) rename fern/apis/{api => fern-def}/definition/pods/metrics.yml (100%) rename fern/apis/{api => fern-def}/definition/pods/threads.yml (100%) rename fern/apis/{api => fern-def}/definition/threads.yml (100%) rename fern/apis/{api => fern-def}/definition/webhooks/__package__.yml (100%) rename fern/apis/{api => fern-def}/definition/webhooks/events.yml (100%) rename fern/apis/{api => fern-def}/definition/websockets.yml (100%) rename fern/apis/{api => fern-def}/generators.yml (100%) rename fern/apis/{cli => openapi-spec}/generators.yml (100%) rename fern/apis/{cli => openapi-spec}/openapi.yml (100%) diff --git a/fern/apis/api/definition/__package__.yml b/fern/apis/fern-def/definition/__package__.yml similarity index 100% rename from fern/apis/api/definition/__package__.yml rename to fern/apis/fern-def/definition/__package__.yml diff --git a/fern/apis/api/definition/agent.yml b/fern/apis/fern-def/definition/agent.yml similarity index 100% rename from fern/apis/api/definition/agent.yml rename to fern/apis/fern-def/definition/agent.yml diff --git a/fern/apis/api/definition/api-keys.yml b/fern/apis/fern-def/definition/api-keys.yml similarity index 100% rename from fern/apis/api/definition/api-keys.yml rename to fern/apis/fern-def/definition/api-keys.yml diff --git a/fern/apis/api/definition/api.yml b/fern/apis/fern-def/definition/api.yml similarity index 100% rename from fern/apis/api/definition/api.yml rename to fern/apis/fern-def/definition/api.yml diff --git a/fern/apis/api/definition/attachments.yml b/fern/apis/fern-def/definition/attachments.yml similarity index 100% rename from fern/apis/api/definition/attachments.yml rename to fern/apis/fern-def/definition/attachments.yml diff --git a/fern/apis/api/definition/auth.yml b/fern/apis/fern-def/definition/auth.yml similarity index 100% rename from fern/apis/api/definition/auth.yml rename to fern/apis/fern-def/definition/auth.yml diff --git a/fern/apis/api/definition/domains.yml b/fern/apis/fern-def/definition/domains.yml similarity index 100% rename from fern/apis/api/definition/domains.yml rename to fern/apis/fern-def/definition/domains.yml diff --git a/fern/apis/api/definition/drafts.yml b/fern/apis/fern-def/definition/drafts.yml similarity index 100% rename from fern/apis/api/definition/drafts.yml rename to fern/apis/fern-def/definition/drafts.yml diff --git a/fern/apis/api/definition/events.yml b/fern/apis/fern-def/definition/events.yml similarity index 100% rename from fern/apis/api/definition/events.yml rename to fern/apis/fern-def/definition/events.yml diff --git a/fern/apis/api/definition/inbox-events.yml b/fern/apis/fern-def/definition/inbox-events.yml similarity index 100% rename from fern/apis/api/definition/inbox-events.yml rename to fern/apis/fern-def/definition/inbox-events.yml diff --git a/fern/apis/api/definition/inboxes/__package__.yml b/fern/apis/fern-def/definition/inboxes/__package__.yml similarity index 100% rename from fern/apis/api/definition/inboxes/__package__.yml rename to fern/apis/fern-def/definition/inboxes/__package__.yml diff --git a/fern/apis/api/definition/inboxes/api-keys.yml b/fern/apis/fern-def/definition/inboxes/api-keys.yml similarity index 100% rename from fern/apis/api/definition/inboxes/api-keys.yml rename to fern/apis/fern-def/definition/inboxes/api-keys.yml diff --git a/fern/apis/api/definition/inboxes/drafts.yml b/fern/apis/fern-def/definition/inboxes/drafts.yml similarity index 100% rename from fern/apis/api/definition/inboxes/drafts.yml rename to fern/apis/fern-def/definition/inboxes/drafts.yml diff --git a/fern/apis/api/definition/inboxes/events.yml b/fern/apis/fern-def/definition/inboxes/events.yml similarity index 100% rename from fern/apis/api/definition/inboxes/events.yml rename to fern/apis/fern-def/definition/inboxes/events.yml diff --git a/fern/apis/api/definition/inboxes/lists.yml b/fern/apis/fern-def/definition/inboxes/lists.yml similarity index 100% rename from fern/apis/api/definition/inboxes/lists.yml rename to fern/apis/fern-def/definition/inboxes/lists.yml diff --git a/fern/apis/api/definition/inboxes/messages.yml b/fern/apis/fern-def/definition/inboxes/messages.yml similarity index 100% rename from fern/apis/api/definition/inboxes/messages.yml rename to fern/apis/fern-def/definition/inboxes/messages.yml diff --git a/fern/apis/api/definition/inboxes/metrics.yml b/fern/apis/fern-def/definition/inboxes/metrics.yml similarity index 100% rename from fern/apis/api/definition/inboxes/metrics.yml rename to fern/apis/fern-def/definition/inboxes/metrics.yml diff --git a/fern/apis/api/definition/inboxes/threads.yml b/fern/apis/fern-def/definition/inboxes/threads.yml similarity index 100% rename from fern/apis/api/definition/inboxes/threads.yml rename to fern/apis/fern-def/definition/inboxes/threads.yml diff --git a/fern/apis/api/definition/lists.yml b/fern/apis/fern-def/definition/lists.yml similarity index 100% rename from fern/apis/api/definition/lists.yml rename to fern/apis/fern-def/definition/lists.yml diff --git a/fern/apis/api/definition/messages.yml b/fern/apis/fern-def/definition/messages.yml similarity index 100% rename from fern/apis/api/definition/messages.yml rename to fern/apis/fern-def/definition/messages.yml diff --git a/fern/apis/api/definition/metrics.yml b/fern/apis/fern-def/definition/metrics.yml similarity index 100% rename from fern/apis/api/definition/metrics.yml rename to fern/apis/fern-def/definition/metrics.yml diff --git a/fern/apis/api/definition/organizations.yml b/fern/apis/fern-def/definition/organizations.yml similarity index 100% rename from fern/apis/api/definition/organizations.yml rename to fern/apis/fern-def/definition/organizations.yml diff --git a/fern/apis/api/definition/pods/__package__.yml b/fern/apis/fern-def/definition/pods/__package__.yml similarity index 100% rename from fern/apis/api/definition/pods/__package__.yml rename to fern/apis/fern-def/definition/pods/__package__.yml diff --git a/fern/apis/api/definition/pods/api-keys.yml b/fern/apis/fern-def/definition/pods/api-keys.yml similarity index 100% rename from fern/apis/api/definition/pods/api-keys.yml rename to fern/apis/fern-def/definition/pods/api-keys.yml diff --git a/fern/apis/api/definition/pods/domains.yml b/fern/apis/fern-def/definition/pods/domains.yml similarity index 100% rename from fern/apis/api/definition/pods/domains.yml rename to fern/apis/fern-def/definition/pods/domains.yml diff --git a/fern/apis/api/definition/pods/drafts.yml b/fern/apis/fern-def/definition/pods/drafts.yml similarity index 100% rename from fern/apis/api/definition/pods/drafts.yml rename to fern/apis/fern-def/definition/pods/drafts.yml diff --git a/fern/apis/api/definition/pods/inboxes.yml b/fern/apis/fern-def/definition/pods/inboxes.yml similarity index 100% rename from fern/apis/api/definition/pods/inboxes.yml rename to fern/apis/fern-def/definition/pods/inboxes.yml diff --git a/fern/apis/api/definition/pods/lists.yml b/fern/apis/fern-def/definition/pods/lists.yml similarity index 100% rename from fern/apis/api/definition/pods/lists.yml rename to fern/apis/fern-def/definition/pods/lists.yml diff --git a/fern/apis/api/definition/pods/metrics.yml b/fern/apis/fern-def/definition/pods/metrics.yml similarity index 100% rename from fern/apis/api/definition/pods/metrics.yml rename to fern/apis/fern-def/definition/pods/metrics.yml diff --git a/fern/apis/api/definition/pods/threads.yml b/fern/apis/fern-def/definition/pods/threads.yml similarity index 100% rename from fern/apis/api/definition/pods/threads.yml rename to fern/apis/fern-def/definition/pods/threads.yml diff --git a/fern/apis/api/definition/threads.yml b/fern/apis/fern-def/definition/threads.yml similarity index 100% rename from fern/apis/api/definition/threads.yml rename to fern/apis/fern-def/definition/threads.yml diff --git a/fern/apis/api/definition/webhooks/__package__.yml b/fern/apis/fern-def/definition/webhooks/__package__.yml similarity index 100% rename from fern/apis/api/definition/webhooks/__package__.yml rename to fern/apis/fern-def/definition/webhooks/__package__.yml diff --git a/fern/apis/api/definition/webhooks/events.yml b/fern/apis/fern-def/definition/webhooks/events.yml similarity index 100% rename from fern/apis/api/definition/webhooks/events.yml rename to fern/apis/fern-def/definition/webhooks/events.yml diff --git a/fern/apis/api/definition/websockets.yml b/fern/apis/fern-def/definition/websockets.yml similarity index 100% rename from fern/apis/api/definition/websockets.yml rename to fern/apis/fern-def/definition/websockets.yml diff --git a/fern/apis/api/generators.yml b/fern/apis/fern-def/generators.yml similarity index 100% rename from fern/apis/api/generators.yml rename to fern/apis/fern-def/generators.yml diff --git a/fern/apis/cli/generators.yml b/fern/apis/openapi-spec/generators.yml similarity index 100% rename from fern/apis/cli/generators.yml rename to fern/apis/openapi-spec/generators.yml diff --git a/fern/apis/cli/openapi.yml b/fern/apis/openapi-spec/openapi.yml similarity index 100% rename from fern/apis/cli/openapi.yml rename to fern/apis/openapi-spec/openapi.yml From 1734b6322eda3bcc189ed772d347306498a4b5a8 Mon Sep 17 00:00:00 2001 From: fern-support <126544928+fern-support@users.noreply.github.com> Date: Thu, 4 Jun 2026 11:47:52 -0400 Subject: [PATCH 03/18] fix paths in generators.yml --- fern/apis/fern-def/generators.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fern/apis/fern-def/generators.yml b/fern/apis/fern-def/generators.yml index a5f3a44f..f789f947 100644 --- a/fern/apis/fern-def/generators.yml +++ b/fern/apis/fern-def/generators.yml @@ -7,7 +7,7 @@ groups: version: 3.60.0 output: location: local-file-system - path: generated/typescript + path: ../../generated/typescript config: namespaceExport: AgentMail noSerdeLayer: false @@ -18,7 +18,7 @@ groups: version: 4.64.1 output: location: local-file-system - path: generated/python + path: ../../generated/python config: client_class_name: AgentMail pydantic_config: @@ -94,7 +94,7 @@ groups: version: 0.3.0 output: location: local-file-system - path: ../openapi + path: ../../../openapi smart-casing: false postman: generators: From 44476510e5dc10a8c366bc759814baa8639ebed5 Mon Sep 17 00:00:00 2001 From: fern-support <126544928+fern-support@users.noreply.github.com> Date: Thu, 4 Jun 2026 11:51:10 -0400 Subject: [PATCH 04/18] Rewire config to commit the spec and use it as input for the cli generation --- fern/apis/openapi-spec/generators.yml | 19 +- fern/apis/openapi-spec/openapi.yml | 129 - openapi/openapi.yml | 8500 +++++++++++++++++++++++++ 3 files changed, 8512 insertions(+), 136 deletions(-) delete mode 100644 fern/apis/openapi-spec/openapi.yml create mode 100644 openapi/openapi.yml diff --git a/fern/apis/openapi-spec/generators.yml b/fern/apis/openapi-spec/generators.yml index bc31346f..ffa3a235 100644 --- a/fern/apis/openapi-spec/generators.yml +++ b/fern/apis/openapi-spec/generators.yml @@ -1,13 +1,18 @@ # yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json api: specs: - - openapi: openapi.yml -default-group: local + - openapi: ../../../openapi/openapi.yml +default-group: cli groups: - local: + cli: generators: - - name: fern-typescript-sdk + - name: fern-cli-generator + version: 0.8.0 + smart-casing: true output: - location: local-file-system - path: ../sdks/typescript - version: 3.71.3 + location: npm + package-name: "agentmail-cli" + token: OIDC + github: + repository: agentmail-to/agentmail-cli + mode: release diff --git a/fern/apis/openapi-spec/openapi.yml b/fern/apis/openapi-spec/openapi.yml deleted file mode 100644 index 193397f1..00000000 --- a/fern/apis/openapi-spec/openapi.yml +++ /dev/null @@ -1,129 +0,0 @@ -openapi: 3.0.3 -info: - title: Petstore API - version: 1.0.0 - description: A sample API for managing pets. - -paths: - /pets: - get: - summary: List all pets - operationId: listPets - tags: - - pets - parameters: - - name: limit - in: query - required: false - schema: - type: integer - format: int32 - maximum: 100 - description: Maximum number of pets to return. - responses: - "200": - description: A list of pets. - content: - application/json: - schema: - type: array - items: - $ref: "#/components/schemas/Pet" - default: - description: Unexpected error. - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - post: - summary: Create a pet - operationId: createPet - tags: - - pets - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/CreatePetRequest" - responses: - "201": - description: The created pet. - content: - application/json: - schema: - $ref: "#/components/schemas/Pet" - default: - description: Unexpected error. - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /pets/{petId}: - get: - summary: Get a pet by ID - operationId: getPet - tags: - - pets - parameters: - - name: petId - in: path - required: true - schema: - type: string - description: The ID of the pet to retrieve. - responses: - "200": - description: The requested pet. - content: - application/json: - schema: - $ref: "#/components/schemas/Pet" - default: - description: Unexpected error. - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - -components: - schemas: - Pet: - type: object - required: - - id - - name - properties: - id: - type: string - description: Unique identifier for the pet. - name: - type: string - description: Name of the pet. - tag: - type: string - description: Optional tag for the pet. - CreatePetRequest: - type: object - required: - - name - properties: - name: - type: string - description: Name of the pet. - tag: - type: string - description: Optional tag for the pet. - Error: - type: object - required: - - code - - message - properties: - code: - type: integer - format: int32 - description: Error code. - message: - type: string - description: Error message. diff --git a/openapi/openapi.yml b/openapi/openapi.yml new file mode 100644 index 00000000..3d3337b0 --- /dev/null +++ b/openapi/openapi.yml @@ -0,0 +1,8500 @@ +openapi: 3.0.1 +info: + title: api + version: '' +paths: + /v0/inboxes: + get: + description: |- + **CLI:** + ```bash + agentmail inboxes list + ``` + operationId: inboxes_list + tags: + - Inboxes + parameters: + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + - name: ascending + in: query + required: false + schema: + $ref: '#/components/schemas/Ascending' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/inboxesListInboxesResponse' + summary: List Inboxes + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + post: + description: >- + **CLI:** + + ```bash + + agentmail inboxes create --display-name "My Agent" --username myagent + --domain agentmail.to + + ``` + operationId: inboxes_create + tags: + - Inboxes + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/inboxesInbox' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + summary: Create Inbox + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: false + content: + application/json: + schema: + $ref: '#/components/schemas/inboxesCreateInboxRequest' + nullable: true + /v0/inboxes/{inbox_id}: + get: + description: |- + **CLI:** + ```bash + agentmail inboxes get --inbox-id + ``` + operationId: inboxes_get + tags: + - Inboxes + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/inboxesInbox' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Inbox + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + patch: + description: >- + **CLI:** + + ```bash + + agentmail inboxes update --inbox-id --display-name "Updated + Name" + + ``` + operationId: inboxes_update + tags: + - Inboxes + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/inboxesInbox' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Update Inbox + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + description: >- + Expects an object; provide at least one of `display_name` or + `metadata`. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/inboxesUpdateInboxRequest' + delete: + description: |- + **CLI:** + ```bash + agentmail inboxes delete --inbox-id + ``` + operationId: inboxes_delete + tags: + - Inboxes + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Delete Inbox + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/pods: + get: + description: |- + **CLI:** + ```bash + agentmail pods list + ``` + operationId: pods_list + tags: + - Pods + parameters: + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + - name: ascending + in: query + required: false + schema: + $ref: '#/components/schemas/Ascending' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/podsListPodsResponse' + summary: List Pods + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + post: + description: |- + **CLI:** + ```bash + agentmail pods create --client-id my-pod + ``` + operationId: pods_create + tags: + - Pods + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/podsPod' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + summary: Create Pod + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/podsCreatePodRequest' + /v0/pods/{pod_id}: + get: + description: |- + **CLI:** + ```bash + agentmail pods get --pod-id + ``` + operationId: pods_get + tags: + - Pods + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/podsPod' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Pod + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + delete: + description: |- + **CLI:** + ```bash + agentmail pods delete --pod-id + ``` + operationId: pods_delete + tags: + - Pods + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Delete Pod + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/webhooks: + get: + description: |- + **CLI:** + ```bash + agentmail webhooks list + ``` + operationId: webhooks_list + tags: + - Webhooks + parameters: + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + - name: ascending + in: query + required: false + schema: + $ref: '#/components/schemas/Ascending' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/webhooksListWebhooksResponse' + summary: List Webhooks + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + post: + description: >- + **CLI:** + + ```bash + + agentmail webhooks create --url https://example.com/webhook --event-type + message.received + + ``` + operationId: webhooks_create + tags: + - Webhooks + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/webhooksWebhook' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + summary: Create Webhook + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/webhooksCreateWebhookRequest' + /v0/webhooks/{webhook_id}: + get: + description: |- + **CLI:** + ```bash + agentmail webhooks get --webhook-id + ``` + operationId: webhooks_get + tags: + - Webhooks + parameters: + - name: webhook_id + in: path + required: true + schema: + $ref: '#/components/schemas/webhooksWebhookId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/webhooksWebhook' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Webhook + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + patch: + description: >- + Update inbox or pod subscriptions, or replace the webhook's + `event_types` in full when you pass a + + non-empty `event_types` array (see request field docs). Inbox and pod + changes use add/remove lists. + + + **CLI:** + + ```bash + + agentmail webhooks update --webhook-id --add-inbox-id + + + ``` + operationId: webhooks_update + tags: + - Webhooks + parameters: + - name: webhook_id + in: path + required: true + schema: + $ref: '#/components/schemas/webhooksWebhookId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/webhooksWebhook' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Update Webhook + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/webhooksUpdateWebhookRequest' + delete: + description: |- + **CLI:** + ```bash + agentmail webhooks delete --webhook-id + ``` + operationId: webhooks_delete + tags: + - Webhooks + parameters: + - name: webhook_id + in: path + required: true + schema: + $ref: '#/components/schemas/webhooksWebhookId' + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Delete Webhook + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/agent/sign-up: + post: + description: >- + Create a new agent organization with an inbox and API key. This endpoint + is for signing up for the first time. If you've already signed up, + you're all set — just use your existing API key. + + + A 6-digit OTP is sent to the human's email for verification. + + + This endpoint is idempotent. Calling it again with the same + `human_email` will rotate the API key and resend the OTP if expired. + + + The returned API key has limited permissions until the organization is + verified via the verify endpoint. + + + **CLI:** + + ```bash + + agentmail agent sign-up --human-email user@example.com --username + my-agent + + ``` + operationId: agent_signUp + tags: + - Agent + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AgentSignupResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + summary: Sign Up + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AgentSignupRequest' + /v0/agent/verify: + post: + description: >- + Verify an agent organization using the 6-digit OTP sent to the human's + email during sign-up. + + + On success, the organization is upgraded from `agent_unverified` to + `agent_verified`, the send allowlist is removed, and free plan + entitlements are applied. + + + The OTP expires after 24 hours and allows a maximum of 10 attempts. If + you run into any difficulties receiving the OTP code, you can also + create an account on + [console.agentmail.to](https://console.agentmail.to) using the human + email address you provided to verify your account. + + + **CLI:** + + ```bash + + agentmail agent verify --otp-code 123456 + + ``` + operationId: agent_verify + tags: + - Agent + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AgentVerifyResponse' + summary: Verify + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AgentVerifyRequest' + /v0/api-keys: + get: + description: |- + **CLI:** + ```bash + agentmail api-keys list + ``` + operationId: apiKeys_list + tags: + - ApiKeys + parameters: + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + - name: ascending + in: query + required: false + schema: + $ref: '#/components/schemas/Ascending' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ListApiKeysResponse' + summary: List API Keys + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + post: + description: |- + **CLI:** + ```bash + agentmail api-keys create --name "My Key" + ``` + operationId: apiKeys_create + tags: + - ApiKeys + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/CreateApiKeyResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + summary: Create API Key + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateApiKeyRequest' + /v0/api-keys/{api_key_id}: + delete: + description: |- + **CLI:** + ```bash + agentmail api-keys delete --api-key-id + ``` + operationId: apiKeys_delete + tags: + - ApiKeys + parameters: + - name: api_key_id + in: path + required: true + schema: + $ref: '#/components/schemas/ApiKeyId' + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Delete API Key + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/auth/me: + get: + description: >- + Returns the identity and scope of the authenticated credential. Useful + when a client holds a pod-scoped or inbox-scoped API key and needs to + discover the parent organization, pod, or inbox without prior knowledge. + + + **CLI:** + + ```bash + + agentmail auth me + + ``` + operationId: auth_me + tags: + - Auth + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Identity' + summary: Who Am I + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/domains: + get: + description: |- + **CLI:** + ```bash + agentmail domains list + ``` + operationId: domains_list + tags: + - Domains + parameters: + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + - name: ascending + in: query + required: false + schema: + $ref: '#/components/schemas/Ascending' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ListDomainsResponse' + summary: List Domains + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + post: + description: |- + **CLI:** + ```bash + agentmail domains create --domain example.com + ``` + operationId: domains_create + tags: + - Domains + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Domain' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + summary: Create Domain + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateDomainRequest' + /v0/domains/{domain_id}: + get: + description: |- + **CLI:** + ```bash + agentmail domains get --domain-id + ``` + operationId: domains_get + tags: + - Domains + parameters: + - name: domain_id + in: path + required: true + schema: + $ref: '#/components/schemas/DomainId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Domain' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Domain + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + patch: + description: |- + **CLI:** + ```bash + agentmail domains update --domain-id + ``` + operationId: domains_update + tags: + - Domains + parameters: + - name: domain_id + in: path + required: true + schema: + $ref: '#/components/schemas/DomainId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Domain' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Update Domain + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateDomainRequest' + delete: + description: |- + **CLI:** + ```bash + agentmail domains delete --domain-id + ``` + operationId: domains_delete + tags: + - Domains + parameters: + - name: domain_id + in: path + required: true + schema: + $ref: '#/components/schemas/DomainId' + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Delete Domain + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/domains/{domain_id}/zone-file: + get: + description: |- + **CLI:** + ```bash + agentmail domains get-zone-file --domain-id + ``` + operationId: domains_getZoneFile + tags: + - Domains + parameters: + - name: domain_id + in: path + required: true + schema: + $ref: '#/components/schemas/DomainId' + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Zone File + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/domains/{domain_id}/verify: + post: + description: |- + **CLI:** + ```bash + agentmail domains verify --domain-id + ``` + operationId: domains_verify + tags: + - Domains + parameters: + - name: domain_id + in: path + required: true + schema: + $ref: '#/components/schemas/DomainId' + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Verify Domain + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/drafts: + get: + description: |- + **CLI:** + ```bash + agentmail drafts list + ``` + operationId: drafts_list + tags: + - Drafts + parameters: + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + - name: labels + in: query + required: false + schema: + $ref: '#/components/schemas/Labels' + nullable: true + - name: before + in: query + required: false + schema: + $ref: '#/components/schemas/Before' + nullable: true + - name: after + in: query + required: false + schema: + $ref: '#/components/schemas/After' + nullable: true + - name: ascending + in: query + required: false + schema: + $ref: '#/components/schemas/Ascending' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ListDraftsResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: List Drafts + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/drafts/{draft_id}: + get: + description: |- + **CLI:** + ```bash + agentmail drafts get --draft-id + ``` + operationId: drafts_get + tags: + - Drafts + parameters: + - name: draft_id + in: path + required: true + schema: + $ref: '#/components/schemas/DraftId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Draft' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Draft + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/drafts/{draft_id}/attachments/{attachment_id}: + get: + description: >- + **CLI:** + + ```bash + + agentmail drafts get-attachment --draft-id --attachment-id + + + ``` + operationId: drafts_getAttachment + tags: + - Drafts + parameters: + - name: draft_id + in: path + required: true + schema: + $ref: '#/components/schemas/DraftId' + - name: attachment_id + in: path + required: true + schema: + $ref: '#/components/schemas/AttachmentId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AttachmentResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Attachment + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/inboxes/{inbox_id}/api-keys: + get: + description: |- + **CLI:** + ```bash + agentmail inboxes:api-keys list --inbox-id + ``` + operationId: inboxes_apiKeys_list + tags: + - InboxesApiKeys + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ListApiKeysResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: List API Keys + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + post: + description: |- + **CLI:** + ```bash + agentmail inboxes:api-keys create --inbox-id --name "My Key" + ``` + operationId: inboxes_apiKeys_create + tags: + - InboxesApiKeys + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/CreateApiKeyResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Create API Key + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateApiKeyRequest' + /v0/inboxes/{inbox_id}/api-keys/{api_key_id}: + delete: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:api-keys delete --inbox-id --api-key-id + + + ``` + operationId: inboxes_apiKeys_delete + tags: + - InboxesApiKeys + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: api_key_id + in: path + required: true + schema: + $ref: '#/components/schemas/ApiKeyId' + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Delete API Key + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/inboxes/{inbox_id}/drafts: + get: + description: |- + **CLI:** + ```bash + agentmail inboxes:drafts list --inbox-id + ``` + operationId: inboxes_drafts_list + tags: + - InboxesDrafts + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + - name: labels + in: query + required: false + schema: + $ref: '#/components/schemas/Labels' + nullable: true + - name: before + in: query + required: false + schema: + $ref: '#/components/schemas/Before' + nullable: true + - name: after + in: query + required: false + schema: + $ref: '#/components/schemas/After' + nullable: true + - name: ascending + in: query + required: false + schema: + $ref: '#/components/schemas/Ascending' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ListDraftsResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: List Drafts + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + post: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:drafts create --inbox-id --to + recipient@example.com --subject "Draft subject" --text "Draft body" + + ``` + operationId: inboxes_drafts_create + tags: + - InboxesDrafts + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Draft' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Create Draft + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateDraftRequest' + /v0/inboxes/{inbox_id}/drafts/{draft_id}: + get: + description: |- + **CLI:** + ```bash + agentmail inboxes:drafts get --inbox-id --draft-id + ``` + operationId: inboxes_drafts_get + tags: + - InboxesDrafts + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: draft_id + in: path + required: true + schema: + $ref: '#/components/schemas/DraftId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Draft' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Draft + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + patch: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:drafts update --inbox-id --draft-id + --subject "Updated subject" + + ``` + operationId: inboxes_drafts_update + tags: + - InboxesDrafts + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: draft_id + in: path + required: true + schema: + $ref: '#/components/schemas/DraftId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Draft' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Update Draft + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateDraftRequest' + delete: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:drafts delete --inbox-id --draft-id + + + ``` + operationId: inboxes_drafts_delete + tags: + - InboxesDrafts + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: draft_id + in: path + required: true + schema: + $ref: '#/components/schemas/DraftId' + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Delete Draft + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/inboxes/{inbox_id}/drafts/{draft_id}/attachments/{attachment_id}: + get: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:drafts get-attachment --inbox-id --draft-id + --attachment-id + + ``` + operationId: inboxes_drafts_getAttachment + tags: + - InboxesDrafts + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: draft_id + in: path + required: true + schema: + $ref: '#/components/schemas/DraftId' + - name: attachment_id + in: path + required: true + schema: + $ref: '#/components/schemas/AttachmentId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AttachmentResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Attachment + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/inboxes/{inbox_id}/drafts/{draft_id}/send: + post: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:drafts send --inbox-id --draft-id + + + ``` + operationId: inboxes_drafts_send + tags: + - InboxesDrafts + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: draft_id + in: path + required: true + schema: + $ref: '#/components/schemas/DraftId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SendMessageResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '403': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Send Draft + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateMessageRequest' + /v0/inboxes/{inbox_id}/events: + get: + description: >- + List label change events for an inbox. Returns events in reverse + chronological order by default. Use for IMAP UID projection or audit + logging. + + + **CLI:** + + ```bash + + agentmail inboxes:events list --inbox-id + + ``` + operationId: inboxes_events_list + tags: + - InboxesEvents + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + - name: ascending + in: query + required: false + schema: + $ref: '#/components/schemas/Ascending' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ListInboxEventsResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: List Inbox Events + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/inboxes/{inbox_id}/lists/{direction}/{type}: + get: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:lists list --inbox-id --direction + --type + + ``` + operationId: inboxes_lists_list + tags: + - InboxesLists + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: direction + in: path + required: true + schema: + $ref: '#/components/schemas/Direction' + - name: type + in: path + required: true + schema: + $ref: '#/components/schemas/ListType' + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/PodListListEntriesResponse' + summary: List Entries + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + post: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:lists create --inbox-id --direction + --type --entry user@example.com + + ``` + operationId: inboxes_lists_create + tags: + - InboxesLists + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: direction + in: path + required: true + schema: + $ref: '#/components/schemas/Direction' + - name: type + in: path + required: true + schema: + $ref: '#/components/schemas/ListType' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/PodListEntry' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + summary: Create List Entry + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateListEntryRequest' + /v0/inboxes/{inbox_id}/lists/{direction}/{type}/{entry}: + get: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:lists get --inbox-id --direction + --type --entry + + ``` + operationId: inboxes_lists_get + tags: + - InboxesLists + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: direction + in: path + required: true + schema: + $ref: '#/components/schemas/Direction' + - name: type + in: path + required: true + schema: + $ref: '#/components/schemas/ListType' + - name: entry + in: path + description: Email address or domain. + required: true + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/PodListEntry' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get List Entry + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + delete: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:lists delete --inbox-id --direction + --type --entry + + ``` + operationId: inboxes_lists_delete + tags: + - InboxesLists + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: direction + in: path + required: true + schema: + $ref: '#/components/schemas/Direction' + - name: type + in: path + required: true + schema: + $ref: '#/components/schemas/ListType' + - name: entry + in: path + description: Email address or domain. + required: true + schema: + type: string + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Delete List Entry + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/inboxes/{inbox_id}/messages: + get: + description: |- + Lists messages in the inbox, most recent first. Pass `from`, `to`, or + `subject` to filter by substring. Filtered requests are served by + search, which caps `limit` at 100. For relevance-ranked full-text + search across sender, recipients, subject, and message body, use + `Search Messages`. + + **CLI:** + ```bash + agentmail inboxes:messages list --inbox-id + ``` + operationId: inboxes_messages_list + tags: + - InboxesMessages + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + - name: labels + in: query + required: false + schema: + $ref: '#/components/schemas/Labels' + nullable: true + - name: before + in: query + required: false + schema: + $ref: '#/components/schemas/Before' + nullable: true + - name: after + in: query + required: false + schema: + $ref: '#/components/schemas/After' + nullable: true + - name: ascending + in: query + required: false + schema: + $ref: '#/components/schemas/Ascending' + nullable: true + - name: include_spam + in: query + required: false + schema: + $ref: '#/components/schemas/IncludeSpam' + nullable: true + - name: include_blocked + in: query + required: false + schema: + $ref: '#/components/schemas/IncludeBlocked' + nullable: true + - name: include_unauthenticated + in: query + required: false + schema: + $ref: '#/components/schemas/IncludeUnauthenticated' + nullable: true + - name: include_trash + in: query + required: false + schema: + $ref: '#/components/schemas/IncludeTrash' + nullable: true + - name: from + in: query + description: >- + Filter to messages whose sender contains this value (substring + match). Repeatable; all values must match. + required: false + schema: + type: array + items: + type: string + nullable: true + - name: to + in: query + description: >- + Filter to messages whose recipients (to, cc, or bcc) contain this + value (substring match). Repeatable; all values must match. + required: false + schema: + type: array + items: + type: string + nullable: true + - name: subject + in: query + description: >- + Filter to messages whose subject contains this value (substring + match). Repeatable; all values must match. + required: false + schema: + type: array + items: + type: string + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ListMessagesResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: List Messages + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/inboxes/{inbox_id}/messages/search: + get: + description: |- + Full-text search across messages in the inbox, ranked by relevance. The + query is matched against the sender, recipients, and subject (substring) + and the message body (tokenized full text). Spam, trash, blocked, and + unauthenticated messages are always excluded. `limit` cannot exceed 100. + operationId: inboxes_messages_search + tags: + - InboxesMessages + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: q + in: query + required: true + schema: + $ref: '#/components/schemas/Query' + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + - name: before + in: query + required: false + schema: + $ref: '#/components/schemas/Before' + nullable: true + - name: after + in: query + required: false + schema: + $ref: '#/components/schemas/After' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SearchMessagesResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Search Messages + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/inboxes/{inbox_id}/messages/{message_id}: + get: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:messages get --inbox-id --message-id + + + ``` + operationId: inboxes_messages_get + tags: + - InboxesMessages + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: message_id + in: path + required: true + schema: + $ref: '#/components/schemas/MessageId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Message' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Message + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + patch: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:messages update --inbox-id --message-id + --add-label read --remove-label unread + + ``` + operationId: inboxes_messages_update + tags: + - InboxesMessages + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: message_id + in: path + required: true + schema: + $ref: '#/components/schemas/MessageId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateMessageResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Update Message + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateMessageRequest' + delete: + description: >- + Permanently deletes a message. + + + **CLI:** + + ```bash + + agentmail inboxes:messages delete --inbox-id --message-id + + + ``` + operationId: inboxes_messages_delete + tags: + - InboxesMessages + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: message_id + in: path + required: true + schema: + $ref: '#/components/schemas/MessageId' + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Delete Message + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/inboxes/{inbox_id}/messages/batch-get: + post: + description: >- + Fetch metadata for up to 500 messages in one request. Missing or + + restricted IDs are silently omitted; compare `count` against `limit` + + to detect misses. + + + **CLI:** + + ```bash + + agentmail inboxes:messages batch-get --inbox-id --message-id + --message-id + + ``` + operationId: inboxes_messages_batchGet + tags: + - InboxesMessages + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/BatchGetMessagesResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + summary: Batch Get Messages + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BatchGetMessagesRequest' + /v0/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}: + get: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:messages get-attachment --inbox-id + --message-id --attachment-id + + ``` + operationId: inboxes_messages_getAttachment + tags: + - InboxesMessages + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: message_id + in: path + required: true + schema: + $ref: '#/components/schemas/MessageId' + - name: attachment_id + in: path + required: true + schema: + $ref: '#/components/schemas/AttachmentId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AttachmentResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Attachment + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/inboxes/{inbox_id}/messages/{message_id}/raw: + get: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:messages get-raw --inbox-id --message-id + + + ``` + operationId: inboxes_messages_getRaw + tags: + - InboxesMessages + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: message_id + in: path + required: true + schema: + $ref: '#/components/schemas/MessageId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/RawMessageResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Raw Message + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/inboxes/{inbox_id}/messages/send: + post: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:messages send --inbox-id --to + recipient@example.com --subject "Hello" --text "Body" + + ``` + operationId: inboxes_messages_send + tags: + - InboxesMessages + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SendMessageResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '403': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Send Message + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SendMessageRequest' + /v0/inboxes/{inbox_id}/messages/{message_id}/reply: + post: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:messages reply --inbox-id --message-id + --text "Reply text" + + ``` + operationId: inboxes_messages_reply + tags: + - InboxesMessages + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: message_id + in: path + required: true + schema: + $ref: '#/components/schemas/MessageId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SendMessageResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '403': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Reply To Message + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ReplyToMessageRequest' + /v0/inboxes/{inbox_id}/messages/{message_id}/reply-all: + post: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:messages reply-all --inbox-id --message-id + --text "Reply text" + + ``` + operationId: inboxes_messages_reply-all + tags: + - InboxesMessages + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: message_id + in: path + required: true + schema: + $ref: '#/components/schemas/MessageId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SendMessageResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '403': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Reply All Message + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ReplyAllMessageRequest' + /v0/inboxes/{inbox_id}/messages/{message_id}/forward: + post: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:messages forward --inbox-id --message-id + --to recipient@example.com + + ``` + operationId: inboxes_messages_forward + tags: + - InboxesMessages + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: message_id + in: path + required: true + schema: + $ref: '#/components/schemas/MessageId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SendMessageResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '403': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Forward Message + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SendMessageRequest' + /v0/inboxes/{inbox_id}/metrics: + get: + description: |- + **CLI:** + ```bash + agentmail inboxes:metrics query --inbox-id + ``` + operationId: inboxes_metrics_query + tags: + - InboxesMetrics + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: event_types + in: query + required: false + schema: + $ref: '#/components/schemas/MetricEventTypes' + nullable: true + - name: start + in: query + required: false + schema: + $ref: '#/components/schemas/Start' + nullable: true + - name: end + in: query + required: false + schema: + $ref: '#/components/schemas/End' + nullable: true + - name: period + in: query + required: false + schema: + $ref: '#/components/schemas/Period' + nullable: true + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/MetricLimit' + nullable: true + - name: descending + in: query + required: false + schema: + $ref: '#/components/schemas/Descending' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/QueryMetricsResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + summary: Query Metrics + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/inboxes/{inbox_id}/threads: + get: + description: |- + Lists threads in the inbox, most recent first. Pass `senders`, + `recipients`, or `subject` to filter by substring. Filtered requests are + served by search, which caps `limit` at 100. For relevance-ranked + full-text search, use `Search Threads`. + + **CLI:** + ```bash + agentmail inboxes:threads list --inbox-id + ``` + operationId: inboxes_threads_list + tags: + - InboxesThreads + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + - name: labels + in: query + required: false + schema: + $ref: '#/components/schemas/Labels' + nullable: true + - name: before + in: query + required: false + schema: + $ref: '#/components/schemas/Before' + nullable: true + - name: after + in: query + required: false + schema: + $ref: '#/components/schemas/After' + nullable: true + - name: ascending + in: query + required: false + schema: + $ref: '#/components/schemas/Ascending' + nullable: true + - name: include_spam + in: query + required: false + schema: + $ref: '#/components/schemas/IncludeSpam' + nullable: true + - name: include_blocked + in: query + required: false + schema: + $ref: '#/components/schemas/IncludeBlocked' + nullable: true + - name: include_unauthenticated + in: query + required: false + schema: + $ref: '#/components/schemas/IncludeUnauthenticated' + nullable: true + - name: include_trash + in: query + required: false + schema: + $ref: '#/components/schemas/IncludeTrash' + nullable: true + - name: senders + in: query + description: >- + Filter to threads whose senders contain this value (substring + match). Repeatable; all values must match. + required: false + schema: + type: array + items: + type: string + nullable: true + - name: recipients + in: query + description: >- + Filter to threads whose recipients contain this value (substring + match). Repeatable; all values must match. + required: false + schema: + type: array + items: + type: string + nullable: true + - name: subject + in: query + description: >- + Filter to threads whose subject contains this value (substring + match). Repeatable; all values must match. + required: false + schema: + type: array + items: + type: string + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ListThreadsResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: List Threads + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/inboxes/{inbox_id}/threads/search: + get: + description: |- + Full-text search across threads in the inbox, ranked by relevance. The + query is matched against senders, recipients, and subject (substring) + and the message body (tokenized full text). Spam, trash, blocked, and + unauthenticated threads are always excluded. `limit` cannot exceed 100. + operationId: inboxes_threads_search + tags: + - InboxesThreads + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: q + in: query + required: true + schema: + $ref: '#/components/schemas/Query' + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + - name: before + in: query + required: false + schema: + $ref: '#/components/schemas/Before' + nullable: true + - name: after + in: query + required: false + schema: + $ref: '#/components/schemas/After' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SearchThreadsResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Search Threads + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/inboxes/{inbox_id}/threads/{thread_id}: + get: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:threads get --inbox-id --thread-id + + + ``` + operationId: inboxes_threads_get + tags: + - InboxesThreads + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: thread_id + in: path + required: true + schema: + $ref: '#/components/schemas/ThreadId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Thread' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Thread + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + patch: + description: >- + Updates thread labels. Cannot add or remove system labels (sent, + received, bounced, etc.). Rejects requests with a `422` for threads with + 100 or more messages. + operationId: inboxes_threads_update + tags: + - InboxesThreads + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: thread_id + in: path + required: true + schema: + $ref: '#/components/schemas/ThreadId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateThreadResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '422': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Update Thread + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateThreadRequest' + delete: + description: >- + Moves the thread to trash by adding a trash label to all messages. If + the thread is already in trash, it will be permanently deleted. Use + `permanent=true` to force permanent deletion. + + + **CLI:** + + ```bash + + agentmail inboxes:threads delete --inbox-id --thread-id + + + ``` + operationId: inboxes_threads_delete + tags: + - InboxesThreads + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: thread_id + in: path + required: true + schema: + $ref: '#/components/schemas/ThreadId' + - name: permanent + in: query + description: If true, permanently delete the thread instead of moving to trash. + required: false + schema: + type: boolean + nullable: true + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Delete Thread + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/inboxes/{inbox_id}/threads/{thread_id}/attachments/{attachment_id}: + get: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:threads get-attachment --inbox-id + --thread-id --attachment-id + + ``` + operationId: inboxes_threads_getAttachment + tags: + - InboxesThreads + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: thread_id + in: path + required: true + schema: + $ref: '#/components/schemas/ThreadId' + - name: attachment_id + in: path + required: true + schema: + $ref: '#/components/schemas/AttachmentId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AttachmentResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Attachment + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/lists/{direction}/{type}: + get: + description: |- + **CLI:** + ```bash + agentmail lists list --direction --type + ``` + operationId: lists_list + tags: + - Lists + parameters: + - name: direction + in: path + required: true + schema: + $ref: '#/components/schemas/Direction' + - name: type + in: path + required: true + schema: + $ref: '#/components/schemas/ListType' + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ListListEntriesResponse' + summary: List Entries + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + post: + description: >- + **CLI:** + + ```bash + + agentmail lists create --direction --type --entry + user@example.com + + ``` + operationId: lists_create + tags: + - Lists + parameters: + - name: direction + in: path + required: true + schema: + $ref: '#/components/schemas/Direction' + - name: type + in: path + required: true + schema: + $ref: '#/components/schemas/ListType' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ListEntry' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + summary: Create List Entry + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateListEntryRequest' + /v0/lists/{direction}/{type}/{entry}: + get: + description: >- + **CLI:** + + ```bash + + agentmail lists get --direction --type --entry + + + ``` + operationId: lists_get + tags: + - Lists + parameters: + - name: direction + in: path + required: true + schema: + $ref: '#/components/schemas/Direction' + - name: type + in: path + required: true + schema: + $ref: '#/components/schemas/ListType' + - name: entry + in: path + description: Email address or domain. + required: true + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ListEntry' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get List Entry + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + delete: + description: >- + **CLI:** + + ```bash + + agentmail lists delete --direction --type --entry + + + ``` + operationId: lists_delete + tags: + - Lists + parameters: + - name: direction + in: path + required: true + schema: + $ref: '#/components/schemas/Direction' + - name: type + in: path + required: true + schema: + $ref: '#/components/schemas/ListType' + - name: entry + in: path + description: Email address or domain. + required: true + schema: + type: string + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Delete List Entry + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/metrics: + get: + description: |- + **CLI:** + ```bash + agentmail metrics list + ``` + operationId: metrics_query + tags: + - Metrics + parameters: + - name: event_types + in: query + required: false + schema: + $ref: '#/components/schemas/MetricEventTypes' + nullable: true + - name: start + in: query + required: false + schema: + $ref: '#/components/schemas/Start' + nullable: true + - name: end + in: query + required: false + schema: + $ref: '#/components/schemas/End' + nullable: true + - name: period + in: query + required: false + schema: + $ref: '#/components/schemas/Period' + nullable: true + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/MetricLimit' + nullable: true + - name: descending + in: query + required: false + schema: + $ref: '#/components/schemas/Descending' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/QueryMetricsResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + summary: Query Metrics + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/organizations: + get: + description: >- + Returns the organization for the authenticated API key (usage limits, + counts, and billing metadata). + + + **CLI:** + + ```bash + + agentmail organizations get + + ``` + operationId: organizations_get + tags: + - Organizations + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Organization' + summary: Get Organization + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/pods/{pod_id}/api-keys: + get: + description: |- + **CLI:** + ```bash + agentmail pods:api-keys list --pod-id + ``` + operationId: pods_apiKeys_list + tags: + - PodsApiKeys + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ListApiKeysResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: List API Keys + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + post: + description: |- + **CLI:** + ```bash + agentmail pods:api-keys create --pod-id --name "My Key" + ``` + operationId: pods_apiKeys_create + tags: + - PodsApiKeys + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/CreateApiKeyResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Create API Key + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateApiKeyRequest' + /v0/pods/{pod_id}/api-keys/{api_key_id}: + delete: + description: >- + **CLI:** + + ```bash + + agentmail pods:api-keys delete --pod-id --api-key-id + + + ``` + operationId: pods_apiKeys_delete + tags: + - PodsApiKeys + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: api_key_id + in: path + required: true + schema: + $ref: '#/components/schemas/ApiKeyId' + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Delete API Key + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/pods/{pod_id}/domains: + get: + description: |- + **CLI:** + ```bash + agentmail pods:domains list --pod-id + ``` + operationId: pods_domains_list + tags: + - PodsDomains + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + - name: ascending + in: query + required: false + schema: + $ref: '#/components/schemas/Ascending' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ListDomainsResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: List Domains + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + post: + description: |- + **CLI:** + ```bash + agentmail pods:domains create --pod-id --domain example.com + ``` + operationId: pods_domains_create + tags: + - PodsDomains + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Domain' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + summary: Create Domain + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateDomainRequest' + /v0/pods/{pod_id}/domains/{domain_id}: + get: + description: |- + **CLI:** + ```bash + agentmail pods:domains get --pod-id --domain-id + ``` + operationId: pods_domains_get + tags: + - PodsDomains + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: domain_id + in: path + required: true + schema: + $ref: '#/components/schemas/DomainId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Domain' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Domain + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + patch: + description: |- + **CLI:** + ```bash + agentmail pods:domains update --pod-id --domain-id + ``` + operationId: pods_domains_update + tags: + - PodsDomains + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: domain_id + in: path + required: true + schema: + $ref: '#/components/schemas/DomainId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Domain' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Update Domain + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateDomainRequest' + delete: + description: |- + **CLI:** + ```bash + agentmail pods:domains delete --pod-id --domain-id + ``` + operationId: pods_domains_delete + tags: + - PodsDomains + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: domain_id + in: path + required: true + schema: + $ref: '#/components/schemas/DomainId' + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Delete Domain + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/pods/{pod_id}/domains/{domain_id}/zone-file: + get: + description: >- + **CLI:** + + ```bash + + agentmail pods:domains get-zone-file --pod-id --domain-id + + + ``` + operationId: pods_domains_getZoneFile + tags: + - PodsDomains + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: domain_id + in: path + required: true + schema: + $ref: '#/components/schemas/DomainId' + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Zone File + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/pods/{pod_id}/domains/{domain_id}/verify: + post: + description: |- + **CLI:** + ```bash + agentmail pods:domains verify --pod-id --domain-id + ``` + operationId: pods_domains_verify + tags: + - PodsDomains + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: domain_id + in: path + required: true + schema: + $ref: '#/components/schemas/DomainId' + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Verify Domain + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/pods/{pod_id}/drafts: + get: + description: |- + **CLI:** + ```bash + agentmail pods:drafts list --pod-id + ``` + operationId: pods_drafts_list + tags: + - PodsDrafts + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + - name: labels + in: query + required: false + schema: + $ref: '#/components/schemas/Labels' + nullable: true + - name: before + in: query + required: false + schema: + $ref: '#/components/schemas/Before' + nullable: true + - name: after + in: query + required: false + schema: + $ref: '#/components/schemas/After' + nullable: true + - name: ascending + in: query + required: false + schema: + $ref: '#/components/schemas/Ascending' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ListDraftsResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: List Drafts + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/pods/{pod_id}/drafts/{draft_id}: + get: + description: |- + **CLI:** + ```bash + agentmail pods:drafts get --pod-id --draft-id + ``` + operationId: pods_drafts_get + tags: + - PodsDrafts + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: draft_id + in: path + required: true + schema: + $ref: '#/components/schemas/DraftId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Draft' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Draft + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/pods/{pod_id}/drafts/{draft_id}/attachments/{attachment_id}: + get: + description: >- + **CLI:** + + ```bash + + agentmail pods:drafts get-attachment --pod-id --draft-id + --attachment-id + + ``` + operationId: pods_drafts_getAttachment + tags: + - PodsDrafts + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: draft_id + in: path + required: true + schema: + $ref: '#/components/schemas/DraftId' + - name: attachment_id + in: path + required: true + schema: + $ref: '#/components/schemas/AttachmentId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AttachmentResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Attachment + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/pods/{pod_id}/inboxes: + get: + description: |- + **CLI:** + ```bash + agentmail pods:inboxes list --pod-id + ``` + operationId: pods_inboxes_list + tags: + - PodsInboxes + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + - name: ascending + in: query + required: false + schema: + $ref: '#/components/schemas/Ascending' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/inboxesListInboxesResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: List Inboxes + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + post: + description: >- + **CLI:** + + ```bash + + agentmail pods:inboxes create --pod-id --username myagent + --domain example.com + + ``` + operationId: pods_inboxes_create + tags: + - PodsInboxes + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/inboxesInbox' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + summary: Create Inbox + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/inboxesCreateInboxRequest' + /v0/pods/{pod_id}/inboxes/{inbox_id}: + get: + description: |- + **CLI:** + ```bash + agentmail pods:inboxes get --pod-id --inbox-id + ``` + operationId: pods_inboxes_get + tags: + - PodsInboxes + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/inboxesInbox' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Inbox + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + patch: + description: |- + **CLI:** + ```bash + agentmail pods:inboxes update --pod-id --inbox-id + ``` + operationId: pods_inboxes_update + tags: + - PodsInboxes + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/inboxesInbox' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Update Inbox + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/inboxesUpdateInboxRequest' + delete: + description: |- + **CLI:** + ```bash + agentmail pods:inboxes delete --pod-id --inbox-id + ``` + operationId: pods_inboxes_delete + tags: + - PodsInboxes + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Delete Inbox + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/pods/{pod_id}/lists/{direction}/{type}: + get: + description: >- + **CLI:** + + ```bash + + agentmail pods:lists list --pod-id --direction + --type + + ``` + operationId: pods_lists_list + tags: + - PodsLists + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: direction + in: path + required: true + schema: + $ref: '#/components/schemas/Direction' + - name: type + in: path + required: true + schema: + $ref: '#/components/schemas/ListType' + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/PodListListEntriesResponse' + summary: List Entries + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + post: + description: >- + **CLI:** + + ```bash + + agentmail pods:lists create --pod-id --direction + --type --entry user@example.com + + ``` + operationId: pods_lists_create + tags: + - PodsLists + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: direction + in: path + required: true + schema: + $ref: '#/components/schemas/Direction' + - name: type + in: path + required: true + schema: + $ref: '#/components/schemas/ListType' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/PodListEntry' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + summary: Create List Entry + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateListEntryRequest' + /v0/pods/{pod_id}/lists/{direction}/{type}/{entry}: + get: + description: >- + **CLI:** + + ```bash + + agentmail pods:lists get --pod-id --direction + --type --entry + + ``` + operationId: pods_lists_get + tags: + - PodsLists + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: direction + in: path + required: true + schema: + $ref: '#/components/schemas/Direction' + - name: type + in: path + required: true + schema: + $ref: '#/components/schemas/ListType' + - name: entry + in: path + description: Email address or domain. + required: true + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/PodListEntry' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get List Entry + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + delete: + description: >- + **CLI:** + + ```bash + + agentmail pods:lists delete --pod-id --direction + --type --entry + + ``` + operationId: pods_lists_delete + tags: + - PodsLists + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: direction + in: path + required: true + schema: + $ref: '#/components/schemas/Direction' + - name: type + in: path + required: true + schema: + $ref: '#/components/schemas/ListType' + - name: entry + in: path + description: Email address or domain. + required: true + schema: + type: string + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Delete List Entry + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/pods/{pod_id}/metrics: + get: + description: |- + **CLI:** + ```bash + agentmail pods:metrics query --pod-id + ``` + operationId: pods_metrics_query + tags: + - PodsMetrics + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: event_types + in: query + required: false + schema: + $ref: '#/components/schemas/MetricEventTypes' + nullable: true + - name: start + in: query + required: false + schema: + $ref: '#/components/schemas/Start' + nullable: true + - name: end + in: query + required: false + schema: + $ref: '#/components/schemas/End' + nullable: true + - name: period + in: query + required: false + schema: + $ref: '#/components/schemas/Period' + nullable: true + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/MetricLimit' + nullable: true + - name: descending + in: query + required: false + schema: + $ref: '#/components/schemas/Descending' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/QueryMetricsResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + summary: Query Metrics + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/pods/{pod_id}/threads: + get: + description: |- + Lists threads in the pod, most recent first. Pass `senders`, + `recipients`, or `subject` to filter by substring. Filtered requests are + served by search, which caps `limit` at 100. For relevance-ranked + full-text search, use `Search Threads`. + + **CLI:** + ```bash + agentmail pods:threads list --pod-id + ``` + operationId: pods_threads_list + tags: + - PodsThreads + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + - name: labels + in: query + required: false + schema: + $ref: '#/components/schemas/Labels' + nullable: true + - name: before + in: query + required: false + schema: + $ref: '#/components/schemas/Before' + nullable: true + - name: after + in: query + required: false + schema: + $ref: '#/components/schemas/After' + nullable: true + - name: ascending + in: query + required: false + schema: + $ref: '#/components/schemas/Ascending' + nullable: true + - name: include_spam + in: query + required: false + schema: + $ref: '#/components/schemas/IncludeSpam' + nullable: true + - name: include_blocked + in: query + required: false + schema: + $ref: '#/components/schemas/IncludeBlocked' + nullable: true + - name: include_unauthenticated + in: query + required: false + schema: + $ref: '#/components/schemas/IncludeUnauthenticated' + nullable: true + - name: include_trash + in: query + required: false + schema: + $ref: '#/components/schemas/IncludeTrash' + nullable: true + - name: senders + in: query + description: >- + Filter to threads whose senders contain this value (substring + match). Repeatable; all values must match. + required: false + schema: + type: array + items: + type: string + nullable: true + - name: recipients + in: query + description: >- + Filter to threads whose recipients contain this value (substring + match). Repeatable; all values must match. + required: false + schema: + type: array + items: + type: string + nullable: true + - name: subject + in: query + description: >- + Filter to threads whose subject contains this value (substring + match). Repeatable; all values must match. + required: false + schema: + type: array + items: + type: string + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ListThreadsResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: List Threads + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/pods/{pod_id}/threads/search: + get: + description: |- + Full-text search across threads in the pod, ranked by relevance. The + query is matched against senders, recipients, and subject (substring) + and the message body (tokenized full text). Spam, trash, blocked, and + unauthenticated threads are always excluded. `limit` cannot exceed 100. + operationId: pods_threads_search + tags: + - PodsThreads + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: q + in: query + required: true + schema: + $ref: '#/components/schemas/Query' + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + - name: before + in: query + required: false + schema: + $ref: '#/components/schemas/Before' + nullable: true + - name: after + in: query + required: false + schema: + $ref: '#/components/schemas/After' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SearchThreadsResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Search Threads + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/pods/{pod_id}/threads/{thread_id}: + get: + description: |- + **CLI:** + ```bash + agentmail pods:threads get --pod-id --thread-id + ``` + operationId: pods_threads_get + tags: + - PodsThreads + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: thread_id + in: path + required: true + schema: + $ref: '#/components/schemas/ThreadId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Thread' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Thread + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + patch: + description: >- + Updates thread labels. Cannot add or remove system labels (sent, + received, bounced, etc.). Rejects requests with a `422` for threads with + 100 or more messages. + operationId: pods_threads_update + tags: + - PodsThreads + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: thread_id + in: path + required: true + schema: + $ref: '#/components/schemas/ThreadId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateThreadResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '422': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Update Thread + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateThreadRequest' + delete: + description: >- + Moves the thread to trash by adding a trash label to all messages. If + the thread is already in trash, it will be permanently deleted. Use + `permanent=true` to force permanent deletion. + + + **CLI:** + + ```bash + + agentmail pods:threads delete --pod-id --thread-id + + ``` + operationId: pods_threads_delete + tags: + - PodsThreads + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: thread_id + in: path + required: true + schema: + $ref: '#/components/schemas/ThreadId' + - name: permanent + in: query + description: If true, permanently delete the thread instead of moving to trash. + required: false + schema: + type: boolean + nullable: true + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Delete Thread + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/pods/{pod_id}/threads/{thread_id}/attachments/{attachment_id}: + get: + description: >- + **CLI:** + + ```bash + + agentmail pods:threads get-attachment --pod-id --thread-id + --attachment-id + + ``` + operationId: pods_threads_getAttachment + tags: + - PodsThreads + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: thread_id + in: path + required: true + schema: + $ref: '#/components/schemas/ThreadId' + - name: attachment_id + in: path + required: true + schema: + $ref: '#/components/schemas/AttachmentId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AttachmentResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Attachment + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/threads: + get: + description: |- + Lists threads, most recent first. Pass `senders`, `recipients`, or + `subject` to filter by substring. Filtered requests are served by + search, which caps `limit` at 100. For relevance-ranked full-text + search across senders, recipients, subject, and message body, use + `Search Threads`. + + **CLI:** + ```bash + agentmail threads list + ``` + operationId: threads_list + tags: + - Threads + parameters: + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + - name: labels + in: query + required: false + schema: + $ref: '#/components/schemas/Labels' + nullable: true + - name: before + in: query + required: false + schema: + $ref: '#/components/schemas/Before' + nullable: true + - name: after + in: query + required: false + schema: + $ref: '#/components/schemas/After' + nullable: true + - name: ascending + in: query + required: false + schema: + $ref: '#/components/schemas/Ascending' + nullable: true + - name: include_spam + in: query + required: false + schema: + $ref: '#/components/schemas/IncludeSpam' + nullable: true + - name: include_blocked + in: query + required: false + schema: + $ref: '#/components/schemas/IncludeBlocked' + nullable: true + - name: include_unauthenticated + in: query + required: false + schema: + $ref: '#/components/schemas/IncludeUnauthenticated' + nullable: true + - name: include_trash + in: query + required: false + schema: + $ref: '#/components/schemas/IncludeTrash' + nullable: true + - name: senders + in: query + description: >- + Filter to threads whose senders contain this value (substring + match). Repeatable; all values must match. + required: false + schema: + type: array + items: + type: string + nullable: true + - name: recipients + in: query + description: >- + Filter to threads whose recipients contain this value (substring + match). Repeatable; all values must match. + required: false + schema: + type: array + items: + type: string + nullable: true + - name: subject + in: query + description: >- + Filter to threads whose subject contains this value (substring + match). Repeatable; all values must match. + required: false + schema: + type: array + items: + type: string + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ListThreadsResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: List Threads + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/threads/search: + get: + description: |- + Full-text search across threads in the organization, ranked by + relevance. The query is matched against senders, recipients, and + subject (substring) and the message body (tokenized full text). Spam, + trash, blocked, and unauthenticated threads are always excluded. + `limit` cannot exceed 100. + operationId: threads_search + tags: + - Threads + parameters: + - name: q + in: query + required: true + schema: + $ref: '#/components/schemas/Query' + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + - name: before + in: query + required: false + schema: + $ref: '#/components/schemas/Before' + nullable: true + - name: after + in: query + required: false + schema: + $ref: '#/components/schemas/After' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SearchThreadsResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Search Threads + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/threads/{thread_id}: + get: + description: |- + **CLI:** + ```bash + agentmail threads get --thread-id + ``` + operationId: threads_get + tags: + - Threads + parameters: + - name: thread_id + in: path + required: true + schema: + $ref: '#/components/schemas/ThreadId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Thread' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Thread + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + patch: + description: >- + Updates thread labels. Cannot add or remove system labels (sent, + received, bounced, etc.). Rejects requests with a `422` for threads with + 100 or more messages. + operationId: threads_update + tags: + - Threads + parameters: + - name: thread_id + in: path + required: true + schema: + $ref: '#/components/schemas/ThreadId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateThreadResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '422': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Update Thread + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateThreadRequest' + delete: + description: >- + Moves the thread to trash by adding a trash label to all messages. If + the thread is already in trash, it will be permanently deleted. Use + `permanent=true` to force permanent deletion. + + + **CLI:** + + ```bash + + agentmail threads delete --thread-id + + ``` + operationId: threads_delete + tags: + - Threads + parameters: + - name: thread_id + in: path + required: true + schema: + $ref: '#/components/schemas/ThreadId' + - name: permanent + in: query + description: If true, permanently delete the thread instead of moving to trash. + required: false + schema: + type: boolean + nullable: true + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Delete Thread + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/threads/{thread_id}/attachments/{attachment_id}: + get: + description: >- + **CLI:** + + ```bash + + agentmail threads get-attachment --thread-id --attachment-id + + + ``` + operationId: threads_getAttachment + tags: + - Threads + parameters: + - name: thread_id + in: path + required: true + schema: + $ref: '#/components/schemas/ThreadId' + - name: attachment_id + in: path + required: true + schema: + $ref: '#/components/schemas/AttachmentId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AttachmentResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Attachment + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] +components: + schemas: + Limit: + title: Limit + type: integer + description: Limit of number of items returned. + Count: + title: Count + type: integer + description: Number of items returned. + PageToken: + title: PageToken + type: string + description: Page token for pagination. + Labels: + title: Labels + type: array + items: + type: string + description: Labels to filter by. + Before: + title: Before + type: string + format: date-time + description: Timestamp before which to filter by. + After: + title: After + type: string + format: date-time + description: Timestamp after which to filter by. + Ascending: + title: Ascending + type: boolean + description: Sort in ascending temporal order. + IncludeSpam: + title: IncludeSpam + type: boolean + description: Include spam in results. + IncludeBlocked: + title: IncludeBlocked + type: boolean + description: Include blocked in results. + IncludeUnauthenticated: + title: IncludeUnauthenticated + type: boolean + description: Include unauthenticated in results. + IncludeTrash: + title: IncludeTrash + type: boolean + description: Include trash in results. + OrganizationId: + title: OrganizationId + type: string + description: ID of organization. + Query: + title: Query + type: string + description: |- + Full-text search query. Matched against the sender, recipients, and + subject (substring) and the message body (tokenized full text). + ErrorName: + title: ErrorName + type: string + description: Name of error. + ErrorMessage: + title: ErrorMessage + type: string + description: Error message. + ErrorResponse: + title: ErrorResponse + type: object + properties: + name: + $ref: '#/components/schemas/ErrorName' + message: + $ref: '#/components/schemas/ErrorMessage' + required: + - name + - message + ValidationErrorResponse: + title: ValidationErrorResponse + type: object + properties: + name: + $ref: '#/components/schemas/ErrorName' + errors: + description: Validation errors. + required: + - name + - errors + inboxesInboxId: + title: inboxesInboxId + type: string + description: The ID of the inbox. + inboxesEmail: + title: inboxesEmail + type: string + description: Email address of the inbox. + inboxesDisplayName: + title: inboxesDisplayName + type: string + description: 'Display name: `Display Name `.' + inboxesClientId: + title: inboxesClientId + type: string + description: Client ID of inbox. + inboxesMetadataValue: + title: inboxesMetadataValue + oneOf: + - type: string + - type: number + format: double + - type: boolean + description: A metadata value. May be a string, number, or boolean. + inboxesMetadata: + title: inboxesMetadata + type: object + additionalProperties: + $ref: '#/components/schemas/inboxesMetadataValue' + description: >- + Custom key-value pairs attached to the inbox. Up to 256 keys. Keys and + + string values are each limited to 256 characters. When updating + metadata, + + send a key with a null value to remove that key. + inboxesUpdateMetadata: + title: inboxesUpdateMetadata + type: object + additionalProperties: + $ref: '#/components/schemas/inboxesMetadataValue' + nullable: true + description: |- + Custom key-value pairs to merge into the inbox's existing metadata. A + value may be a string, number, boolean, or null. Setting a key to null + removes it. Up to 256 keys; keys and string values are each limited to + 256 characters. + inboxesInbox: + title: inboxesInbox + type: object + properties: + pod_id: + $ref: '#/components/schemas/podsPodId' + inbox_id: + $ref: '#/components/schemas/inboxesInboxId' + email: + $ref: '#/components/schemas/inboxesEmail' + display_name: + $ref: '#/components/schemas/inboxesDisplayName' + nullable: true + client_id: + $ref: '#/components/schemas/inboxesClientId' + nullable: true + metadata: + $ref: '#/components/schemas/inboxesMetadata' + nullable: true + description: Custom metadata attached to the inbox. + updated_at: + type: string + format: date-time + description: Time at which inbox was last updated. + created_at: + type: string + format: date-time + description: Time at which inbox was created. + required: + - pod_id + - inbox_id + - email + - updated_at + - created_at + inboxesListInboxesResponse: + title: inboxesListInboxesResponse + type: object + properties: + count: + $ref: '#/components/schemas/Count' + limit: + $ref: '#/components/schemas/Limit' + nullable: true + next_page_token: + $ref: '#/components/schemas/PageToken' + nullable: true + inboxes: + type: array + items: + $ref: '#/components/schemas/inboxesInbox' + description: Ordered by `created_at` descending. + required: + - count + - inboxes + inboxesCreateInboxRequest: + title: inboxesCreateInboxRequest + type: object + properties: + username: + type: string + nullable: true + description: Username of address. Randomly generated if not specified. + domain: + type: string + nullable: true + description: >- + Domain of address. Must be verified domain. Defaults to + `agentmail.to`. + display_name: + $ref: '#/components/schemas/inboxesDisplayName' + nullable: true + client_id: + $ref: '#/components/schemas/inboxesClientId' + nullable: true + metadata: + $ref: '#/components/schemas/inboxesMetadata' + nullable: true + description: Custom metadata to attach to the inbox. + inboxesUpdateInboxRequest: + title: inboxesUpdateInboxRequest + type: object + properties: + display_name: + $ref: '#/components/schemas/inboxesDisplayName' + nullable: true + metadata: + $ref: '#/components/schemas/inboxesUpdateMetadata' + nullable: true + description: >- + Metadata to merge into the inbox's existing metadata. Keys you + include + + are added or overwritten; keys you omit are left unchanged. To + remove a + + single key, send it with a null value. To clear all metadata, send + + `metadata` as null. Sending an empty object is rejected; use null to + + clear. Each update must include at least one of `display_name` or + + `metadata`. + podsPodId: + title: podsPodId + type: string + description: ID of pod. + podsName: + title: podsName + type: string + description: Name of pod. + podsClientId: + title: podsClientId + type: string + description: Client ID of pod. + podsPod: + title: podsPod + type: object + properties: + pod_id: + $ref: '#/components/schemas/podsPodId' + name: + $ref: '#/components/schemas/podsName' + updated_at: + type: string + format: date-time + description: Time at which pod was last updated. + created_at: + type: string + format: date-time + description: Time at which pod was created. + client_id: + $ref: '#/components/schemas/podsClientId' + nullable: true + required: + - pod_id + - name + - updated_at + - created_at + podsListPodsResponse: + title: podsListPodsResponse + type: object + properties: + count: + $ref: '#/components/schemas/Count' + limit: + $ref: '#/components/schemas/Limit' + nullable: true + next_page_token: + $ref: '#/components/schemas/PageToken' + nullable: true + pods: + type: array + items: + $ref: '#/components/schemas/podsPod' + description: Ordered by `created_at` descending. + required: + - count + - pods + podsCreatePodRequest: + title: podsCreatePodRequest + type: object + properties: + name: + $ref: '#/components/schemas/podsName' + nullable: true + client_id: + $ref: '#/components/schemas/podsClientId' + nullable: true + webhooksWebhookId: + title: webhooksWebhookId + type: string + description: ID of webhook. + webhooksClientId: + title: webhooksClientId + type: string + description: Client ID of webhook. + webhooksUrl: + title: webhooksUrl + type: string + description: URL of webhook endpoint. + webhooksWebhook: + title: webhooksWebhook + type: object + properties: + webhook_id: + $ref: '#/components/schemas/webhooksWebhookId' + url: + $ref: '#/components/schemas/webhooksUrl' + event_types: + $ref: '#/components/schemas/EventTypes' + nullable: true + pod_ids: + $ref: '#/components/schemas/PodIds' + nullable: true + inbox_ids: + $ref: '#/components/schemas/InboxIds' + nullable: true + secret: + type: string + description: Secret for webhook signature verification. + enabled: + type: boolean + description: Webhook is enabled. + updated_at: + type: string + format: date-time + description: Time at which webhook was last updated. + created_at: + type: string + format: date-time + description: Time at which webhook was created. + client_id: + $ref: '#/components/schemas/webhooksClientId' + nullable: true + required: + - webhook_id + - url + - secret + - enabled + - updated_at + - created_at + webhooksListWebhooksResponse: + title: webhooksListWebhooksResponse + type: object + properties: + count: + $ref: '#/components/schemas/Count' + limit: + $ref: '#/components/schemas/Limit' + nullable: true + next_page_token: + $ref: '#/components/schemas/PageToken' + nullable: true + webhooks: + type: array + items: + $ref: '#/components/schemas/webhooksWebhook' + description: Ordered by `created_at` descending. + required: + - count + - webhooks + webhooksCreateWebhookRequest: + title: webhooksCreateWebhookRequest + type: object + properties: + url: + $ref: '#/components/schemas/webhooksUrl' + event_types: + $ref: '#/components/schemas/EventTypes' + description: >- + Full list of event types this webhook should receive. At least one + type is required. Send every type you + + want in this array (not incremental). See [Webhooks + overview](https://docs.agentmail.to/webhooks-overview) + + for spam, blocked, and unauthenticated events and required + permissions. + pod_ids: + $ref: '#/components/schemas/PodIds' + nullable: true + inbox_ids: + $ref: '#/components/schemas/InboxIds' + nullable: true + client_id: + $ref: '#/components/schemas/webhooksClientId' + nullable: true + required: + - url + - event_types + webhooksUpdateWebhookRequest: + title: webhooksUpdateWebhookRequest + type: object + properties: + add_inbox_ids: + $ref: '#/components/schemas/InboxIds' + nullable: true + description: Inbox IDs to subscribe to the webhook. + remove_inbox_ids: + $ref: '#/components/schemas/InboxIds' + nullable: true + description: Inbox IDs to unsubscribe from the webhook. + add_pod_ids: + $ref: '#/components/schemas/PodIds' + nullable: true + description: Pod IDs to subscribe to the webhook. + remove_pod_ids: + $ref: '#/components/schemas/PodIds' + nullable: true + description: Pod IDs to unsubscribe from the webhook. + event_types: + $ref: '#/components/schemas/EventTypes' + nullable: true + description: >- + When you send a non-empty list, it replaces the webhook's subscribed + event types in full (the same + + "set the list" behavior as create). It is not a merge or diff: + include every event type you want after + + the update. Sending a one-element array means the webhook will only + receive that one type afterward. + + Omit this field or send an empty array to leave event types + unchanged. Clearing all types with an empty + + list is not supported. Subscribing to `message.received.spam`, + `message.received.blocked`, or + + `message.received.unauthenticated` requires the matching label + permission on the API key. + AgentSignupRequest: + title: AgentSignupRequest + type: object + description: Request body to sign up an agent. + properties: + human_email: + type: string + description: >- + Email address of the human who owns the agent. A 6-digit OTP will be + sent to this address. + username: + type: string + description: >- + Username for the auto-created inbox (e.g. "my-agent" creates + my-agent@agentmail.to). + source: + type: string + nullable: true + description: >- + The SDK, framework, or platform issuing this sign-up (e.g. + `agentmail-python`, `agentmail-cli`, `agentmail-mcp`). + + Identifies the caller — answers "who is signing up". + + Max 2048 characters. + referrer: + type: string + nullable: true + description: >- + The channel that drove this sign-up — where the agent or its + developer discovered AgentMail + + (e.g. `agent.email`, a partner URL, a campaign tag). Answers "where + did this sign-up come from". + + Max 2048 characters. + required: + - human_email + - username + AgentSignupResponse: + title: AgentSignupResponse + type: object + description: Response after successful agent sign-up. + properties: + organization_id: + type: string + description: ID of the created organization. + inbox_id: + type: string + description: ID of the auto-created inbox. + api_key: + type: string + description: >- + API key for authenticating subsequent requests. Store this securely, + it cannot be retrieved again. + required: + - organization_id + - inbox_id + - api_key + AgentVerifyRequest: + title: AgentVerifyRequest + type: object + description: Request body to verify an agent with an OTP code. + properties: + otp_code: + type: string + description: 6-digit verification code sent to the human's email address. + required: + - otp_code + AgentVerifyResponse: + title: AgentVerifyResponse + type: object + description: Response after successful agent verification. + properties: + verified: + type: boolean + description: Whether the organization was verified. + required: + - verified + ApiKeyId: + title: ApiKeyId + type: string + description: ID of api key. + Prefix: + title: Prefix + type: string + description: Prefix of api key. + Name: + title: Name + type: string + description: Name of api key. + CreatedAt: + title: CreatedAt + type: string + format: date-time + description: Time at which api key was created. + ApiKeyPermissions: + title: ApiKeyPermissions + type: object + description: >- + Granular permissions for the API key. When ommitted all permissions are + granted. Otherwise, only permissions set to true are granted. + properties: + inbox_read: + type: boolean + nullable: true + description: Read inbox details. + inbox_create: + type: boolean + nullable: true + description: Create new inboxes. + inbox_update: + type: boolean + nullable: true + description: Update inbox settings. + inbox_delete: + type: boolean + nullable: true + description: Delete inboxes. + thread_read: + type: boolean + nullable: true + description: Read threads. + thread_delete: + type: boolean + nullable: true + description: Delete threads. + message_read: + type: boolean + nullable: true + description: Read messages. + message_send: + type: boolean + nullable: true + description: Send messages. + message_update: + type: boolean + nullable: true + description: Update message labels. + label_spam_read: + type: boolean + nullable: true + description: Access messages labeled spam. + label_blocked_read: + type: boolean + nullable: true + description: Access messages labeled blocked. + label_trash_read: + type: boolean + nullable: true + description: Access messages labeled trash. + draft_read: + type: boolean + nullable: true + description: Read drafts. + draft_create: + type: boolean + nullable: true + description: Create drafts. + draft_update: + type: boolean + nullable: true + description: Update drafts. + draft_delete: + type: boolean + nullable: true + description: Delete drafts. + draft_send: + type: boolean + nullable: true + description: Send drafts. + webhook_read: + type: boolean + nullable: true + description: Read webhook configurations. + webhook_create: + type: boolean + nullable: true + description: Create webhooks. + webhook_update: + type: boolean + nullable: true + description: Update webhooks. + webhook_delete: + type: boolean + nullable: true + description: Delete webhooks. + domain_read: + type: boolean + nullable: true + description: Read domain details. + domain_create: + type: boolean + nullable: true + description: Create domains. + domain_update: + type: boolean + nullable: true + description: Update domains. + domain_delete: + type: boolean + nullable: true + description: Delete domains. + list_entry_read: + type: boolean + nullable: true + description: Read list entries. + list_entry_create: + type: boolean + nullable: true + description: Create list entries. + list_entry_delete: + type: boolean + nullable: true + description: Delete list entries. + metrics_read: + type: boolean + nullable: true + description: Read metrics. + api_key_read: + type: boolean + nullable: true + description: Read API keys. + api_key_create: + type: boolean + nullable: true + description: Create API keys. + api_key_delete: + type: boolean + nullable: true + description: Delete API keys. + pod_read: + type: boolean + nullable: true + description: Read pods. + pod_create: + type: boolean + nullable: true + description: Create pods. + pod_delete: + type: boolean + nullable: true + description: Delete pods. + ApiKey: + title: ApiKey + type: object + properties: + api_key_id: + $ref: '#/components/schemas/ApiKeyId' + prefix: + $ref: '#/components/schemas/Prefix' + name: + $ref: '#/components/schemas/Name' + pod_id: + type: string + nullable: true + description: >- + Pod ID the api key is scoped to. If set, the key can only access + resources within this pod. + inbox_id: + type: string + nullable: true + description: >- + Inbox ID the api key is scoped to. If set, the key can only access + resources within this inbox. + used_at: + type: string + format: date-time + nullable: true + description: Time at which api key was last used. + permissions: + $ref: '#/components/schemas/ApiKeyPermissions' + nullable: true + created_at: + $ref: '#/components/schemas/CreatedAt' + required: + - api_key_id + - prefix + - name + - created_at + CreateApiKeyResponse: + title: CreateApiKeyResponse + type: object + properties: + api_key_id: + $ref: '#/components/schemas/ApiKeyId' + api_key: + type: string + description: API key. + prefix: + $ref: '#/components/schemas/Prefix' + name: + $ref: '#/components/schemas/Name' + pod_id: + type: string + nullable: true + description: Pod ID the api key is scoped to. + inbox_id: + type: string + nullable: true + description: Inbox ID the api key is scoped to. + permissions: + $ref: '#/components/schemas/ApiKeyPermissions' + nullable: true + created_at: + $ref: '#/components/schemas/CreatedAt' + required: + - api_key_id + - api_key + - prefix + - name + - created_at + ListApiKeysResponse: + title: ListApiKeysResponse + type: object + properties: + count: + $ref: '#/components/schemas/Count' + next_page_token: + $ref: '#/components/schemas/PageToken' + nullable: true + api_keys: + type: array + items: + $ref: '#/components/schemas/ApiKey' + description: Ordered by `created_at` descending. + required: + - count + - api_keys + CreateApiKeyRequest: + title: CreateApiKeyRequest + type: object + properties: + name: + $ref: '#/components/schemas/Name' + nullable: true + permissions: + $ref: '#/components/schemas/ApiKeyPermissions' + nullable: true + AttachmentId: + title: AttachmentId + type: string + description: ID of attachment. + AttachmentFilename: + title: AttachmentFilename + type: string + description: Filename of attachment. + AttachmentSize: + title: AttachmentSize + type: integer + description: Size of attachment in bytes. + AttachmentContentType: + title: AttachmentContentType + type: string + description: Content type of attachment. + AttachmentContentDisposition: + title: AttachmentContentDisposition + type: string + enum: + - inline + - attachment + description: Content disposition of attachment. + AttachmentContentId: + title: AttachmentContentId + type: string + description: Content ID of attachment. + Attachment: + title: Attachment + type: object + properties: + attachment_id: + $ref: '#/components/schemas/AttachmentId' + filename: + $ref: '#/components/schemas/AttachmentFilename' + nullable: true + size: + $ref: '#/components/schemas/AttachmentSize' + content_type: + $ref: '#/components/schemas/AttachmentContentType' + nullable: true + content_disposition: + $ref: '#/components/schemas/AttachmentContentDisposition' + nullable: true + content_id: + $ref: '#/components/schemas/AttachmentContentId' + nullable: true + required: + - attachment_id + - size + AttachmentResponse: + title: AttachmentResponse + type: object + properties: + attachment_id: + $ref: '#/components/schemas/AttachmentId' + filename: + $ref: '#/components/schemas/AttachmentFilename' + nullable: true + size: + $ref: '#/components/schemas/AttachmentSize' + content_type: + $ref: '#/components/schemas/AttachmentContentType' + nullable: true + content_disposition: + $ref: '#/components/schemas/AttachmentContentDisposition' + nullable: true + content_id: + $ref: '#/components/schemas/AttachmentContentId' + nullable: true + download_url: + type: string + description: URL to download the attachment. + expires_at: + type: string + format: date-time + description: Time at which the download URL expires. + required: + - attachment_id + - size + - download_url + - expires_at + SendAttachment: + title: SendAttachment + type: object + properties: + filename: + $ref: '#/components/schemas/AttachmentFilename' + nullable: true + content_type: + $ref: '#/components/schemas/AttachmentContentType' + nullable: true + content_disposition: + $ref: '#/components/schemas/AttachmentContentDisposition' + nullable: true + content_id: + $ref: '#/components/schemas/AttachmentContentId' + nullable: true + content: + type: string + nullable: true + description: Base64 encoded content of attachment. + url: + type: string + nullable: true + description: URL to the attachment. + ScopeType: + title: ScopeType + type: string + enum: + - organization + - pod + - inbox + description: The scope tier the authenticated credential is bound to. + Identity: + title: Identity + type: object + description: Identity and scope of the authenticated credential. + properties: + scope_type: + $ref: '#/components/schemas/ScopeType' + scope_id: + type: string + description: >- + ID of the most specific scope the credential is bound to. + + Equals inbox_id when scope_type is inbox, pod_id when pod, + organization_id when organization. + organization_id: + $ref: '#/components/schemas/OrganizationId' + pod_id: + type: string + nullable: true + description: >- + ID of the pod the credential is scoped to. Present when scope_type + is pod or inbox. + inbox_id: + type: string + nullable: true + description: >- + ID of the inbox the credential is scoped to. Present when scope_type + is inbox. + api_key_id: + type: string + nullable: true + description: >- + ID of the API key used to authenticate. Absent for JWT and proxy + credentials. + required: + - scope_type + - scope_id + - organization_id + DomainId: + title: DomainId + type: string + description: The ID of the domain. + DomainName: + title: DomainName + type: string + description: The name of the domain (e.g., `example.com`). + RecordType: + title: RecordType + type: string + enum: + - TXT + - CNAME + - MX + VerificationStatus: + title: VerificationStatus + type: string + enum: + - NOT_STARTED + - PENDING + - INVALID + - FAILED + - VERIFYING + - VERIFIED + RecordStatus: + title: RecordStatus + type: string + enum: + - MISSING + - INVALID + - VALID + VerificationRecord: + title: VerificationRecord + type: object + properties: + type: + $ref: '#/components/schemas/RecordType' + description: The type of the DNS record. + name: + type: string + description: The name or host of the record. + value: + type: string + description: The value of the record. + status: + $ref: '#/components/schemas/RecordStatus' + description: The verification status of this specific record. + priority: + type: integer + nullable: true + description: The priority of the MX record. + required: + - type + - name + - value + - status + Status: + title: Status + $ref: '#/components/schemas/VerificationStatus' + description: The verification status of the domain. + FeedbackEnabled: + title: FeedbackEnabled + type: boolean + description: Bounce and complaint notifications are sent to your inboxes. + ClientId: + title: ClientId + type: string + description: Client ID of domain. + Domain: + title: Domain + type: object + properties: + pod_id: + $ref: '#/components/schemas/podsPodId' + nullable: true + domain_id: + $ref: '#/components/schemas/DomainId' + domain: + $ref: '#/components/schemas/DomainName' + status: + $ref: '#/components/schemas/Status' + feedback_enabled: + $ref: '#/components/schemas/FeedbackEnabled' + records: + type: array + items: + $ref: '#/components/schemas/VerificationRecord' + description: A list of DNS records required to verify the domain. + client_id: + $ref: '#/components/schemas/ClientId' + nullable: true + updated_at: + type: string + format: date-time + description: Time at which the domain was last updated. + created_at: + type: string + format: date-time + description: Time at which the domain was created. + required: + - domain_id + - domain + - status + - feedback_enabled + - records + - updated_at + - created_at + DomainItem: + title: DomainItem + type: object + properties: + pod_id: + $ref: '#/components/schemas/podsPodId' + nullable: true + domain_id: + $ref: '#/components/schemas/DomainId' + domain: + $ref: '#/components/schemas/DomainName' + feedback_enabled: + $ref: '#/components/schemas/FeedbackEnabled' + client_id: + $ref: '#/components/schemas/ClientId' + nullable: true + updated_at: + type: string + format: date-time + description: Time at which the domain was last updated. + created_at: + type: string + format: date-time + description: Time at which the domain was created. + required: + - domain_id + - domain + - feedback_enabled + - updated_at + - created_at + ListDomainsResponse: + title: ListDomainsResponse + type: object + properties: + count: + $ref: '#/components/schemas/Count' + limit: + $ref: '#/components/schemas/Limit' + nullable: true + next_page_token: + $ref: '#/components/schemas/PageToken' + nullable: true + domains: + type: array + items: + $ref: '#/components/schemas/DomainItem' + description: Ordered by `created_at` descending. + required: + - count + - domains + CreateDomainRequest: + title: CreateDomainRequest + type: object + properties: + domain: + $ref: '#/components/schemas/DomainName' + feedback_enabled: + $ref: '#/components/schemas/FeedbackEnabled' + required: + - domain + - feedback_enabled + UpdateDomainRequest: + title: UpdateDomainRequest + type: object + properties: + feedback_enabled: + $ref: '#/components/schemas/FeedbackEnabled' + nullable: true + DraftId: + title: DraftId + type: string + description: ID of draft. + DraftClientId: + title: DraftClientId + type: string + description: Client ID of draft. + DraftLabels: + title: DraftLabels + type: array + items: + type: string + description: Labels of draft. + DraftReplyTo: + title: DraftReplyTo + type: array + items: + type: string + description: >- + Reply-to addresses. In format `username@domain.com` or `Display Name + `. + DraftTo: + title: DraftTo + type: array + items: + type: string + description: >- + Addresses of recipients. In format `username@domain.com` or `Display + Name `. + DraftCc: + title: DraftCc + type: array + items: + type: string + description: >- + Addresses of CC recipients. In format `username@domain.com` or `Display + Name `. + DraftBcc: + title: DraftBcc + type: array + items: + type: string + description: >- + Addresses of BCC recipients. In format `username@domain.com` or `Display + Name `. + DraftSubject: + title: DraftSubject + type: string + description: Subject of draft. + DraftPreview: + title: DraftPreview + type: string + description: Text preview of draft. + DraftText: + title: DraftText + type: string + description: Plain text body of draft. + DraftHtml: + title: DraftHtml + type: string + description: HTML body of draft. + DraftAttachments: + title: DraftAttachments + type: array + items: + $ref: '#/components/schemas/Attachment' + description: Attachments in draft. + DraftInReplyTo: + title: DraftInReplyTo + type: string + description: ID of message being replied to. + DraftSendStatus: + title: DraftSendStatus + type: string + enum: + - scheduled + - sending + - failed + description: Schedule send status of draft. + DraftSendAt: + title: DraftSendAt + type: string + format: date-time + description: Time at which to schedule send draft. + DraftUpdatedAt: + title: DraftUpdatedAt + type: string + format: date-time + description: Time at which draft was last updated. + DraftItem: + title: DraftItem + type: object + properties: + inbox_id: + $ref: '#/components/schemas/inboxesInboxId' + draft_id: + $ref: '#/components/schemas/DraftId' + labels: + $ref: '#/components/schemas/DraftLabels' + to: + $ref: '#/components/schemas/DraftTo' + nullable: true + cc: + $ref: '#/components/schemas/DraftCc' + nullable: true + bcc: + $ref: '#/components/schemas/DraftBcc' + nullable: true + subject: + $ref: '#/components/schemas/DraftSubject' + nullable: true + preview: + $ref: '#/components/schemas/DraftPreview' + nullable: true + attachments: + $ref: '#/components/schemas/DraftAttachments' + nullable: true + in_reply_to: + $ref: '#/components/schemas/DraftInReplyTo' + nullable: true + send_status: + $ref: '#/components/schemas/DraftSendStatus' + nullable: true + send_at: + $ref: '#/components/schemas/DraftSendAt' + nullable: true + updated_at: + $ref: '#/components/schemas/DraftUpdatedAt' + required: + - inbox_id + - draft_id + - labels + - updated_at + Draft: + title: Draft + type: object + properties: + inbox_id: + $ref: '#/components/schemas/inboxesInboxId' + draft_id: + $ref: '#/components/schemas/DraftId' + client_id: + $ref: '#/components/schemas/DraftClientId' + nullable: true + labels: + $ref: '#/components/schemas/DraftLabels' + reply_to: + $ref: '#/components/schemas/DraftReplyTo' + nullable: true + to: + $ref: '#/components/schemas/DraftTo' + nullable: true + cc: + $ref: '#/components/schemas/DraftCc' + nullable: true + bcc: + $ref: '#/components/schemas/DraftBcc' + nullable: true + subject: + $ref: '#/components/schemas/DraftSubject' + nullable: true + preview: + $ref: '#/components/schemas/DraftPreview' + nullable: true + text: + $ref: '#/components/schemas/DraftText' + nullable: true + html: + $ref: '#/components/schemas/DraftHtml' + nullable: true + attachments: + $ref: '#/components/schemas/DraftAttachments' + nullable: true + in_reply_to: + $ref: '#/components/schemas/DraftInReplyTo' + nullable: true + references: + type: array + items: + type: string + nullable: true + description: IDs of previous messages in thread. + send_status: + $ref: '#/components/schemas/DraftSendStatus' + nullable: true + send_at: + $ref: '#/components/schemas/DraftSendAt' + nullable: true + updated_at: + $ref: '#/components/schemas/DraftUpdatedAt' + created_at: + type: string + format: date-time + description: Time at which draft was created. + required: + - inbox_id + - draft_id + - labels + - updated_at + - created_at + ListDraftsResponse: + title: ListDraftsResponse + type: object + properties: + count: + $ref: '#/components/schemas/Count' + limit: + $ref: '#/components/schemas/Limit' + nullable: true + next_page_token: + $ref: '#/components/schemas/PageToken' + nullable: true + drafts: + type: array + items: + $ref: '#/components/schemas/DraftItem' + description: Ordered by `updated_at` descending. + required: + - count + - drafts + CreateDraftRequest: + title: CreateDraftRequest + type: object + properties: + labels: + $ref: '#/components/schemas/DraftLabels' + nullable: true + reply_to: + $ref: '#/components/schemas/DraftReplyTo' + nullable: true + to: + $ref: '#/components/schemas/DraftTo' + nullable: true + cc: + $ref: '#/components/schemas/DraftCc' + nullable: true + bcc: + $ref: '#/components/schemas/DraftBcc' + nullable: true + subject: + $ref: '#/components/schemas/DraftSubject' + nullable: true + text: + $ref: '#/components/schemas/DraftText' + nullable: true + html: + $ref: '#/components/schemas/DraftHtml' + nullable: true + attachments: + type: array + items: + $ref: '#/components/schemas/SendAttachment' + nullable: true + description: Attachments to include in draft. + in_reply_to: + $ref: '#/components/schemas/DraftInReplyTo' + nullable: true + send_at: + $ref: '#/components/schemas/DraftSendAt' + nullable: true + client_id: + $ref: '#/components/schemas/DraftClientId' + nullable: true + UpdateDraftRequest: + title: UpdateDraftRequest + type: object + properties: + reply_to: + $ref: '#/components/schemas/DraftReplyTo' + nullable: true + to: + $ref: '#/components/schemas/DraftTo' + nullable: true + cc: + $ref: '#/components/schemas/DraftCc' + nullable: true + bcc: + $ref: '#/components/schemas/DraftBcc' + nullable: true + subject: + $ref: '#/components/schemas/DraftSubject' + nullable: true + text: + $ref: '#/components/schemas/DraftText' + nullable: true + html: + $ref: '#/components/schemas/DraftHtml' + nullable: true + send_at: + $ref: '#/components/schemas/DraftSendAt' + nullable: true + EventType: + title: EventType + type: string + enum: + - message.received + - message.received.spam + - message.received.blocked + - message.received.unauthenticated + - message.sent + - message.delivered + - message.bounced + - message.complained + - message.rejected + - domain.verified + EventTypes: + title: EventTypes + type: array + items: + $ref: '#/components/schemas/EventType' + description: Event types for which to send events. + MessageReceivedEventType: + title: MessageReceivedEventType + type: string + enum: + - message.received + - message.received.spam + - message.received.blocked + - message.received.unauthenticated + PodIds: + title: PodIds + type: array + items: + type: string + description: Pods for which to send events. Maximum 10 per webhook. + InboxIds: + title: InboxIds + type: array + items: + type: string + description: Inboxes for which to send events. Maximum 10 per webhook. + EventId: + title: EventId + type: string + description: ID of event. + Timestamp: + title: Timestamp + type: string + format: date-time + description: Timestamp of event. + Recipient: + title: Recipient + type: object + properties: + address: + type: string + description: Recipient address. + status: + type: string + description: Recipient status. + required: + - address + - status + Send: + title: Send + type: object + properties: + inbox_id: + $ref: '#/components/schemas/inboxesInboxId' + thread_id: + $ref: '#/components/schemas/ThreadId' + message_id: + $ref: '#/components/schemas/MessageId' + timestamp: + $ref: '#/components/schemas/Timestamp' + recipients: + type: array + items: + type: string + description: Sent recipients. + required: + - inbox_id + - thread_id + - message_id + - timestamp + - recipients + Delivery: + title: Delivery + type: object + properties: + inbox_id: + $ref: '#/components/schemas/inboxesInboxId' + thread_id: + $ref: '#/components/schemas/ThreadId' + message_id: + $ref: '#/components/schemas/MessageId' + timestamp: + $ref: '#/components/schemas/Timestamp' + recipients: + type: array + items: + type: string + description: Delivered recipients. + required: + - inbox_id + - thread_id + - message_id + - timestamp + - recipients + Bounce: + title: Bounce + type: object + properties: + inbox_id: + $ref: '#/components/schemas/inboxesInboxId' + thread_id: + $ref: '#/components/schemas/ThreadId' + message_id: + $ref: '#/components/schemas/MessageId' + timestamp: + $ref: '#/components/schemas/Timestamp' + type: + type: string + description: Bounce type. + sub_type: + type: string + description: Bounce sub-type. + recipients: + type: array + items: + $ref: '#/components/schemas/Recipient' + description: Bounced recipients. + required: + - inbox_id + - thread_id + - message_id + - timestamp + - type + - sub_type + - recipients + Complaint: + title: Complaint + type: object + properties: + inbox_id: + $ref: '#/components/schemas/inboxesInboxId' + thread_id: + $ref: '#/components/schemas/ThreadId' + message_id: + $ref: '#/components/schemas/MessageId' + timestamp: + $ref: '#/components/schemas/Timestamp' + type: + type: string + description: Complaint type. + sub_type: + type: string + description: Complaint sub-type. + recipients: + type: array + items: + type: string + description: Complained recipients. + required: + - inbox_id + - thread_id + - message_id + - timestamp + - type + - sub_type + - recipients + Reject: + title: Reject + type: object + properties: + inbox_id: + $ref: '#/components/schemas/inboxesInboxId' + thread_id: + $ref: '#/components/schemas/ThreadId' + message_id: + $ref: '#/components/schemas/MessageId' + timestamp: + $ref: '#/components/schemas/Timestamp' + reason: + type: string + description: Reject reason. + required: + - inbox_id + - thread_id + - message_id + - timestamp + - reason + MessageReceivedEvent: + title: MessageReceivedEvent + type: object + description: >- + A message was received. Spam, blocked, and unauthenticated + received-message events use the same payload shape with different + `event_type` values. + properties: + type: + type: string + const: event + event_type: + $ref: '#/components/schemas/MessageReceivedEventType' + event_id: + $ref: '#/components/schemas/EventId' + message: + $ref: '#/components/schemas/Message' + thread: + $ref: '#/components/schemas/ThreadItem' + required: + - type + - event_type + - event_id + - message + - thread + MessageSentEvent: + title: MessageSentEvent + type: object + properties: + type: + type: string + const: event + event_type: + type: string + const: message.sent + event_id: + $ref: '#/components/schemas/EventId' + send: + $ref: '#/components/schemas/Send' + required: + - type + - event_type + - event_id + - send + MessageDeliveredEvent: + title: MessageDeliveredEvent + type: object + properties: + type: + type: string + const: event + event_type: + type: string + const: message.delivered + event_id: + $ref: '#/components/schemas/EventId' + delivery: + $ref: '#/components/schemas/Delivery' + required: + - type + - event_type + - event_id + - delivery + MessageBouncedEvent: + title: MessageBouncedEvent + type: object + properties: + type: + type: string + const: event + event_type: + type: string + const: message.bounced + event_id: + $ref: '#/components/schemas/EventId' + bounce: + $ref: '#/components/schemas/Bounce' + required: + - type + - event_type + - event_id + - bounce + MessageComplainedEvent: + title: MessageComplainedEvent + type: object + properties: + type: + type: string + const: event + event_type: + type: string + const: message.complained + event_id: + $ref: '#/components/schemas/EventId' + complaint: + $ref: '#/components/schemas/Complaint' + required: + - type + - event_type + - event_id + - complaint + MessageRejectedEvent: + title: MessageRejectedEvent + type: object + properties: + type: + type: string + const: event + event_type: + type: string + const: message.rejected + event_id: + $ref: '#/components/schemas/EventId' + reject: + $ref: '#/components/schemas/Reject' + required: + - type + - event_type + - event_id + - reject + DomainVerifiedEvent: + title: DomainVerifiedEvent + type: object + properties: + type: + type: string + const: event + event_type: + type: string + const: domain.verified + event_id: + $ref: '#/components/schemas/EventId' + domain: + $ref: '#/components/schemas/Domain' + required: + - type + - event_type + - event_id + - domain + InboxEventId: + title: InboxEventId + type: string + description: ID of event. + InboxEventType: + title: InboxEventType + type: string + enum: + - label.added + - label.removed + description: |- + Type of inbox event. Wire format is dot.case to match the + convention used by webhook events (`message.received`, + `domain.verified`, etc. in events.yml). Pre-2026-04 these were + `label_added`/`label_removed` (snake_case). The Fern enum's `name` + field stays uppercase-snake (Fern convention); only the wire + `value` changed. + InboxEvent: + title: InboxEvent + type: object + properties: + organization_id: + $ref: '#/components/schemas/OrganizationId' + pod_id: + type: string + description: ID of pod. + inbox_id: + $ref: '#/components/schemas/inboxesInboxId' + event_id: + $ref: '#/components/schemas/InboxEventId' + event_type: + $ref: '#/components/schemas/InboxEventType' + message_id: + type: string + description: ID of message. + label: + type: string + description: Label added or removed. + event_at: + type: string + format: date-time + description: Time at which the event occurred. + created_at: + type: string + format: date-time + description: Time at which the event was recorded. + required: + - organization_id + - pod_id + - inbox_id + - event_id + - event_type + - message_id + - label + - event_at + - created_at + ListInboxEventsResponse: + title: ListInboxEventsResponse + type: object + properties: + count: + $ref: '#/components/schemas/Count' + limit: + $ref: '#/components/schemas/Limit' + nullable: true + next_page_token: + $ref: '#/components/schemas/PageToken' + nullable: true + events: + type: array + items: + $ref: '#/components/schemas/InboxEvent' + description: Ordered by `event_id` descending. + required: + - count + - events + Direction: + title: Direction + type: string + enum: + - send + - receive + - reply + description: Direction of list entry. + ListType: + title: ListType + type: string + enum: + - allow + - block + description: Type of list entry. + EntryType: + title: EntryType + type: string + enum: + - email + - domain + description: Whether the entry is an email address or domain. + ListEntryBase: + title: ListEntryBase + type: object + properties: + entry: + type: string + description: Email address or domain of list entry. + organization_id: + $ref: '#/components/schemas/OrganizationId' + reason: + type: string + nullable: true + description: Reason for adding the entry. + direction: + $ref: '#/components/schemas/Direction' + list_type: + $ref: '#/components/schemas/ListType' + entry_type: + $ref: '#/components/schemas/EntryType' + created_at: + type: string + format: date-time + description: Time at which entry was created. + read_only: + type: boolean + nullable: true + description: Whether the entry is read-only and cannot be deleted via the API. + required: + - entry + - organization_id + - direction + - list_type + - entry_type + - created_at + ListEntry: + title: ListEntry + type: object + properties: {} + allOf: + - $ref: '#/components/schemas/ListEntryBase' + PodListEntry: + title: PodListEntry + type: object + properties: + pod_id: + type: string + description: ID of pod. + inbox_id: + type: string + nullable: true + description: ID of inbox, if entry is inbox-scoped. + required: + - pod_id + allOf: + - $ref: '#/components/schemas/ListEntryBase' + PodListListEntriesResponse: + title: PodListListEntriesResponse + type: object + properties: + count: + $ref: '#/components/schemas/Count' + limit: + $ref: '#/components/schemas/Limit' + nullable: true + next_page_token: + $ref: '#/components/schemas/PageToken' + nullable: true + entries: + type: array + items: + $ref: '#/components/schemas/PodListEntry' + description: Ordered by entry ascending. + required: + - count + - entries + ListListEntriesResponse: + title: ListListEntriesResponse + type: object + properties: + count: + $ref: '#/components/schemas/Count' + limit: + $ref: '#/components/schemas/Limit' + nullable: true + next_page_token: + $ref: '#/components/schemas/PageToken' + nullable: true + entries: + type: array + items: + $ref: '#/components/schemas/ListEntry' + description: Ordered by entry ascending. + required: + - count + - entries + CreateListEntryRequest: + title: CreateListEntryRequest + type: object + properties: + entry: + type: string + description: Email address or domain to add. + reason: + type: string + nullable: true + description: Reason for adding the entry. + required: + - entry + MessageId: + title: MessageId + type: string + description: ID of message. + MessageLabels: + title: MessageLabels + type: array + items: + type: string + description: Labels of message. + MessageTimestamp: + title: MessageTimestamp + type: string + format: date-time + description: Time at which message was sent or drafted. + MessageFrom: + title: MessageFrom + type: string + description: >- + Address of sender. In format `username@domain.com` or `Display Name + `. + MessageReplyTo: + title: MessageReplyTo + type: array + items: + type: string + description: >- + Addresses of reply-to recipients. In format `username@domain.com` or + `Display Name `. + MessageTo: + title: MessageTo + type: array + items: + type: string + description: >- + Addresses of recipients. In format `username@domain.com` or `Display + Name `. + MessageCc: + title: MessageCc + type: array + items: + type: string + description: >- + Addresses of CC recipients. In format `username@domain.com` or `Display + Name `. + MessageBcc: + title: MessageBcc + type: array + items: + type: string + description: >- + Addresses of BCC recipients. In format `username@domain.com` or `Display + Name `. + MessageSubject: + title: MessageSubject + type: string + description: Subject of message. + MessagePreview: + title: MessagePreview + type: string + description: Text preview of message. + MessageText: + title: MessageText + type: string + description: Plain text body of message. + MessageHtml: + title: MessageHtml + type: string + description: HTML body of message. + MessageAttachments: + title: MessageAttachments + type: array + items: + $ref: '#/components/schemas/Attachment' + description: Attachments in message. + MessageInReplyTo: + title: MessageInReplyTo + type: string + description: ID of message being replied to. + MessageReferences: + title: MessageReferences + type: array + items: + type: string + description: IDs of previous messages in thread. + MessageHeaders: + title: MessageHeaders + type: object + additionalProperties: + type: string + description: Headers in message. + MessageSize: + title: MessageSize + type: integer + description: Size of message in bytes. + MessageUpdatedAt: + title: MessageUpdatedAt + type: string + format: date-time + description: Time at which message was last updated. + MessageCreatedAt: + title: MessageCreatedAt + type: string + format: date-time + description: Time at which message was created. + MessageItem: + title: MessageItem + type: object + properties: + inbox_id: + $ref: '#/components/schemas/inboxesInboxId' + thread_id: + $ref: '#/components/schemas/ThreadId' + message_id: + $ref: '#/components/schemas/MessageId' + labels: + $ref: '#/components/schemas/MessageLabels' + timestamp: + $ref: '#/components/schemas/MessageTimestamp' + from: + $ref: '#/components/schemas/MessageFrom' + to: + $ref: '#/components/schemas/MessageTo' + cc: + $ref: '#/components/schemas/MessageCc' + nullable: true + bcc: + $ref: '#/components/schemas/MessageBcc' + nullable: true + subject: + $ref: '#/components/schemas/MessageSubject' + nullable: true + preview: + $ref: '#/components/schemas/MessagePreview' + nullable: true + attachments: + $ref: '#/components/schemas/MessageAttachments' + nullable: true + in_reply_to: + $ref: '#/components/schemas/MessageInReplyTo' + nullable: true + references: + $ref: '#/components/schemas/MessageReferences' + nullable: true + headers: + $ref: '#/components/schemas/MessageHeaders' + nullable: true + size: + $ref: '#/components/schemas/MessageSize' + updated_at: + $ref: '#/components/schemas/MessageUpdatedAt' + created_at: + $ref: '#/components/schemas/MessageCreatedAt' + required: + - inbox_id + - thread_id + - message_id + - labels + - timestamp + - from + - to + - size + - updated_at + - created_at + Message: + title: Message + type: object + properties: + inbox_id: + $ref: '#/components/schemas/inboxesInboxId' + thread_id: + $ref: '#/components/schemas/ThreadId' + message_id: + $ref: '#/components/schemas/MessageId' + labels: + $ref: '#/components/schemas/MessageLabels' + timestamp: + $ref: '#/components/schemas/MessageTimestamp' + from: + $ref: '#/components/schemas/MessageFrom' + reply_to: + type: array + items: + type: string + nullable: true + description: >- + Reply-to addresses. In format `username@domain.com` or `Display Name + `. + to: + $ref: '#/components/schemas/MessageTo' + cc: + $ref: '#/components/schemas/MessageCc' + nullable: true + bcc: + $ref: '#/components/schemas/MessageBcc' + nullable: true + subject: + $ref: '#/components/schemas/MessageSubject' + nullable: true + preview: + $ref: '#/components/schemas/MessagePreview' + nullable: true + text: + $ref: '#/components/schemas/MessageText' + nullable: true + html: + $ref: '#/components/schemas/MessageHtml' + nullable: true + extracted_text: + type: string + nullable: true + description: Extracted new text content. + extracted_html: + type: string + nullable: true + description: Extracted new HTML content. + attachments: + $ref: '#/components/schemas/MessageAttachments' + nullable: true + in_reply_to: + $ref: '#/components/schemas/MessageInReplyTo' + nullable: true + references: + $ref: '#/components/schemas/MessageReferences' + nullable: true + headers: + $ref: '#/components/schemas/MessageHeaders' + nullable: true + size: + $ref: '#/components/schemas/MessageSize' + updated_at: + $ref: '#/components/schemas/MessageUpdatedAt' + created_at: + $ref: '#/components/schemas/MessageCreatedAt' + required: + - inbox_id + - thread_id + - message_id + - labels + - timestamp + - from + - to + - size + - updated_at + - created_at + ListMessagesResponse: + title: ListMessagesResponse + type: object + properties: + count: + $ref: '#/components/schemas/Count' + limit: + $ref: '#/components/schemas/Limit' + nullable: true + next_page_token: + $ref: '#/components/schemas/PageToken' + nullable: true + messages: + type: array + items: + $ref: '#/components/schemas/MessageItem' + description: Ordered by `timestamp` descending. + required: + - count + - messages + SearchMessageHighlights: + title: SearchMessageHighlights + type: object + description: >- + Matched fragments per field on a message search result, with matched + terms + + wrapped in `**`. A field key is present only when the query matched that + + field, so the present keys also tell you which fields produced the hit. + properties: + from: + type: array + items: + type: string + nullable: true + description: Matched fragments from the sender address. + recipients: + type: array + items: + type: string + nullable: true + description: Matched fragments from the recipient addresses (to, cc, or bcc). + subject: + type: array + items: + type: string + nullable: true + description: Matched fragments from the subject. + text: + type: array + items: + type: string + nullable: true + description: Matched fragments from the message body. + SearchMessageItem: + title: SearchMessageItem + type: object + properties: + highlights: + $ref: '#/components/schemas/SearchMessageHighlights' + nullable: true + description: >- + Matched fragments per field. Present only when the query matched an + indexed field. + allOf: + - $ref: '#/components/schemas/MessageItem' + SearchMessagesResponse: + title: SearchMessagesResponse + type: object + properties: + count: + $ref: '#/components/schemas/Count' + limit: + $ref: '#/components/schemas/Limit' + nullable: true + next_page_token: + $ref: '#/components/schemas/PageToken' + nullable: true + messages: + type: array + items: + $ref: '#/components/schemas/SearchMessageItem' + description: Ordered by relevance, best match first. + required: + - count + - messages + BatchGetMessagesMessageIds: + title: BatchGetMessagesMessageIds + type: array + items: + $ref: '#/components/schemas/MessageId' + description: |- + IDs of messages to fetch. Maximum 500 ids per request. Duplicates are + rejected with a validation error. IDs not found in the inbox (including + cross-inbox or permission-restricted) are silently omitted from the + response; callers detect misses by comparing `count` against `limit`. + BatchGetMessagesRequest: + title: BatchGetMessagesRequest + type: object + properties: + message_ids: + $ref: '#/components/schemas/BatchGetMessagesMessageIds' + required: + - message_ids + BatchGetMessagesResponse: + title: BatchGetMessagesResponse + type: object + properties: + limit: + $ref: '#/components/schemas/Limit' + count: + $ref: '#/components/schemas/Count' + messages: + type: array + items: + $ref: '#/components/schemas/Message' + description: |- + Found messages. Order matches `message_ids` in the request. Body + fields (`text`, `html`, `extracted_text`, `extracted_html`) are + never populated; use the single-message endpoint to retrieve bodies. + required: + - limit + - count + - messages + RawMessageResponse: + title: RawMessageResponse + type: object + description: S3 presigned URL to download the raw .eml file. + properties: + message_id: + $ref: '#/components/schemas/MessageId' + description: ID of the message. + size: + $ref: '#/components/schemas/MessageSize' + description: Size of the raw message in bytes. + download_url: + type: string + description: S3 presigned URL to download the raw message. Expires at expires_at. + expires_at: + type: string + format: date-time + description: Time at which the download URL expires. + required: + - message_id + - size + - download_url + - expires_at + Addresses: + title: Addresses + oneOf: + - type: string + - type: array + items: + type: string + SendMessageReplyTo: + title: SendMessageReplyTo + $ref: '#/components/schemas/Addresses' + description: Reply-to address or addresses. + SendMessageTo: + title: SendMessageTo + $ref: '#/components/schemas/Addresses' + description: Recipient address or addresses. + SendMessageCc: + title: SendMessageCc + $ref: '#/components/schemas/Addresses' + description: CC recipient address or addresses. + SendMessageBcc: + title: SendMessageBcc + $ref: '#/components/schemas/Addresses' + description: BCC recipient address or addresses. + SendMessageAttachments: + title: SendMessageAttachments + type: array + items: + $ref: '#/components/schemas/SendAttachment' + description: Attachments to include in message. + SendMessageHeaders: + title: SendMessageHeaders + type: object + additionalProperties: + type: string + description: Headers to include in message. + SendMessageRequest: + title: SendMessageRequest + type: object + properties: + labels: + $ref: '#/components/schemas/MessageLabels' + nullable: true + reply_to: + $ref: '#/components/schemas/SendMessageReplyTo' + nullable: true + to: + $ref: '#/components/schemas/SendMessageTo' + nullable: true + cc: + $ref: '#/components/schemas/SendMessageCc' + nullable: true + bcc: + $ref: '#/components/schemas/SendMessageBcc' + nullable: true + subject: + $ref: '#/components/schemas/MessageSubject' + nullable: true + text: + $ref: '#/components/schemas/MessageText' + nullable: true + html: + $ref: '#/components/schemas/MessageHtml' + nullable: true + attachments: + $ref: '#/components/schemas/SendMessageAttachments' + nullable: true + headers: + $ref: '#/components/schemas/SendMessageHeaders' + nullable: true + SendMessageResponse: + title: SendMessageResponse + type: object + properties: + message_id: + $ref: '#/components/schemas/MessageId' + thread_id: + $ref: '#/components/schemas/ThreadId' + required: + - message_id + - thread_id + UpdateMessageResponse: + title: UpdateMessageResponse + type: object + properties: + message_id: + $ref: '#/components/schemas/MessageId' + labels: + $ref: '#/components/schemas/MessageLabels' + required: + - message_id + - labels + ReplyAll: + title: ReplyAll + type: boolean + description: Reply to all recipients of the original message. + ReplyToMessageRequest: + title: ReplyToMessageRequest + type: object + properties: + labels: + $ref: '#/components/schemas/MessageLabels' + nullable: true + reply_to: + $ref: '#/components/schemas/SendMessageReplyTo' + nullable: true + to: + $ref: '#/components/schemas/SendMessageTo' + nullable: true + cc: + $ref: '#/components/schemas/SendMessageCc' + nullable: true + bcc: + $ref: '#/components/schemas/SendMessageBcc' + nullable: true + reply_all: + $ref: '#/components/schemas/ReplyAll' + nullable: true + text: + $ref: '#/components/schemas/MessageText' + nullable: true + html: + $ref: '#/components/schemas/MessageHtml' + nullable: true + attachments: + $ref: '#/components/schemas/SendMessageAttachments' + nullable: true + headers: + $ref: '#/components/schemas/SendMessageHeaders' + nullable: true + ReplyAllMessageRequest: + title: ReplyAllMessageRequest + type: object + properties: + labels: + $ref: '#/components/schemas/MessageLabels' + nullable: true + reply_to: + $ref: '#/components/schemas/SendMessageReplyTo' + nullable: true + text: + $ref: '#/components/schemas/MessageText' + nullable: true + html: + $ref: '#/components/schemas/MessageHtml' + nullable: true + attachments: + $ref: '#/components/schemas/SendMessageAttachments' + nullable: true + headers: + $ref: '#/components/schemas/SendMessageHeaders' + nullable: true + UpdateMessageLabels: + title: UpdateMessageLabels + oneOf: + - type: string + - type: array + items: + type: string + description: Label or list of labels. + UpdateMessageRequest: + title: UpdateMessageRequest + type: object + properties: + add_labels: + $ref: '#/components/schemas/UpdateMessageLabels' + nullable: true + description: Label or labels to add to message. + remove_labels: + $ref: '#/components/schemas/UpdateMessageLabels' + nullable: true + description: Label or labels to remove from message. + MetricEventType: + title: MetricEventType + type: string + enum: + - message.sent + - message.delivered + - message.bounced + - message.delayed + - message.rejected + - message.complained + - message.received + description: Type of metric event. + MetricEventTypes: + title: MetricEventTypes + type: array + items: + $ref: '#/components/schemas/MetricEventType' + description: List of metric event types to query. + Start: + title: Start + type: string + format: date-time + description: Start timestamp for the query. + End: + title: End + type: string + format: date-time + description: End timestamp for the query. + Period: + title: Period + type: string + description: Period in number of seconds for the query. + MetricLimit: + title: MetricLimit + type: integer + description: Limit on number of buckets to return. + Descending: + title: Descending + type: boolean + description: Sort in descending order. + MetricBucket: + title: MetricBucket + type: object + properties: + timestamp: + type: string + format: date-time + description: Timestamp of the bucket. + count: + type: integer + description: Count of events in the bucket. + required: + - timestamp + - count + QueryMetricsResponse: + title: QueryMetricsResponse + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/MetricBucket' + description: Metrics grouped by event type. + Organization: + title: Organization + type: object + description: Organization details with usage limits and counts. + properties: + organization_id: + $ref: '#/components/schemas/OrganizationId' + inbox_count: + type: integer + description: Current number of inboxes. + domain_count: + type: integer + description: Current number of domains. + inbox_limit: + type: integer + nullable: true + description: Maximum number of inboxes allowed. + domain_limit: + type: integer + nullable: true + description: Maximum number of domains allowed. + billing_id: + type: string + nullable: true + description: Provider-agnostic billing customer ID. + billing_type: + type: string + nullable: true + description: Billing provider type (e.g. "stripe"). + billing_subscription_id: + type: string + nullable: true + description: Active billing subscription ID. + authentication_id: + type: string + nullable: true + description: Provider-agnostic authentication ID. + authentication_type: + type: string + nullable: true + description: Authentication provider type. + updated_at: + type: string + format: date-time + description: Time at which organization was last updated. + created_at: + type: string + format: date-time + description: Time at which organization was created. + required: + - organization_id + - inbox_count + - domain_count + - updated_at + - created_at + ThreadId: + title: ThreadId + type: string + description: ID of thread. + ThreadLabels: + title: ThreadLabels + type: array + items: + type: string + description: Labels of thread. + ThreadTimestamp: + title: ThreadTimestamp + type: string + format: date-time + description: Timestamp of last sent or received message. + ThreadReceivedTimestamp: + title: ThreadReceivedTimestamp + type: string + format: date-time + description: Timestamp of last received message. + ThreadSentTimestamp: + title: ThreadSentTimestamp + type: string + format: date-time + description: Timestamp of last sent message. + ThreadSenders: + title: ThreadSenders + type: array + items: + type: string + description: >- + Senders in thread. In format `username@domain.com` or `Display Name + `. + ThreadRecipients: + title: ThreadRecipients + type: array + items: + type: string + description: >- + Recipients in thread. In format `username@domain.com` or `Display Name + `. + ThreadSubject: + title: ThreadSubject + type: string + description: Subject of thread. + ThreadPreview: + title: ThreadPreview + type: string + description: Text preview of last message in thread. + ThreadAttachments: + title: ThreadAttachments + type: array + items: + $ref: '#/components/schemas/Attachment' + description: Attachments in thread. + ThreadLastMessageId: + title: ThreadLastMessageId + type: string + description: ID of last message in thread. + ThreadMessageCount: + title: ThreadMessageCount + type: integer + description: Number of messages in thread. + ThreadSize: + title: ThreadSize + type: integer + description: Size of thread in bytes. + ThreadUpdatedAt: + title: ThreadUpdatedAt + type: string + format: date-time + description: Time at which thread was last updated. + ThreadCreatedAt: + title: ThreadCreatedAt + type: string + format: date-time + description: Time at which thread was created. + ThreadItem: + title: ThreadItem + type: object + properties: + inbox_id: + $ref: '#/components/schemas/inboxesInboxId' + thread_id: + $ref: '#/components/schemas/ThreadId' + labels: + $ref: '#/components/schemas/ThreadLabels' + timestamp: + $ref: '#/components/schemas/ThreadTimestamp' + received_timestamp: + $ref: '#/components/schemas/ThreadReceivedTimestamp' + nullable: true + sent_timestamp: + $ref: '#/components/schemas/ThreadSentTimestamp' + nullable: true + senders: + $ref: '#/components/schemas/ThreadSenders' + recipients: + $ref: '#/components/schemas/ThreadRecipients' + subject: + $ref: '#/components/schemas/ThreadSubject' + nullable: true + preview: + $ref: '#/components/schemas/ThreadPreview' + nullable: true + attachments: + $ref: '#/components/schemas/ThreadAttachments' + nullable: true + last_message_id: + $ref: '#/components/schemas/ThreadLastMessageId' + message_count: + $ref: '#/components/schemas/ThreadMessageCount' + size: + $ref: '#/components/schemas/ThreadSize' + updated_at: + $ref: '#/components/schemas/ThreadUpdatedAt' + created_at: + $ref: '#/components/schemas/ThreadCreatedAt' + required: + - inbox_id + - thread_id + - labels + - timestamp + - senders + - recipients + - last_message_id + - message_count + - size + - updated_at + - created_at + Thread: + title: Thread + type: object + properties: + inbox_id: + $ref: '#/components/schemas/inboxesInboxId' + thread_id: + $ref: '#/components/schemas/ThreadId' + labels: + $ref: '#/components/schemas/ThreadLabels' + timestamp: + $ref: '#/components/schemas/ThreadTimestamp' + received_timestamp: + $ref: '#/components/schemas/ThreadReceivedTimestamp' + nullable: true + sent_timestamp: + $ref: '#/components/schemas/ThreadSentTimestamp' + nullable: true + senders: + $ref: '#/components/schemas/ThreadSenders' + recipients: + $ref: '#/components/schemas/ThreadRecipients' + subject: + $ref: '#/components/schemas/ThreadSubject' + nullable: true + preview: + $ref: '#/components/schemas/ThreadPreview' + nullable: true + attachments: + $ref: '#/components/schemas/ThreadAttachments' + nullable: true + last_message_id: + $ref: '#/components/schemas/ThreadLastMessageId' + message_count: + $ref: '#/components/schemas/ThreadMessageCount' + size: + $ref: '#/components/schemas/ThreadSize' + updated_at: + $ref: '#/components/schemas/ThreadUpdatedAt' + created_at: + $ref: '#/components/schemas/ThreadCreatedAt' + messages: + type: array + items: + $ref: '#/components/schemas/Message' + description: Messages in thread. Ordered by `timestamp` ascending. + required: + - inbox_id + - thread_id + - labels + - timestamp + - senders + - recipients + - last_message_id + - message_count + - size + - updated_at + - created_at + - messages + UpdateThreadRequest: + title: UpdateThreadRequest + type: object + properties: + add_labels: + type: array + items: + type: string + nullable: true + description: Labels to add to thread. Cannot be system labels. + remove_labels: + type: array + items: + type: string + nullable: true + description: >- + Labels to remove from thread. Cannot be system labels. Takes + priority over `add_labels` (in the event of duplicate labels passed + in). + UpdateThreadResponse: + title: UpdateThreadResponse + type: object + properties: + thread_id: + $ref: '#/components/schemas/ThreadId' + labels: + $ref: '#/components/schemas/ThreadLabels' + required: + - thread_id + - labels + ListThreadsResponse: + title: ListThreadsResponse + type: object + properties: + count: + $ref: '#/components/schemas/Count' + limit: + $ref: '#/components/schemas/Limit' + nullable: true + next_page_token: + $ref: '#/components/schemas/PageToken' + nullable: true + threads: + type: array + items: + $ref: '#/components/schemas/ThreadItem' + description: Ordered by `timestamp` descending. + required: + - count + - threads + SearchThreadHighlights: + title: SearchThreadHighlights + type: object + description: >- + Matched fragments per field on a thread search result, with matched + terms + + wrapped in `**`. A field key is present only when the query matched that + + field, so the present keys also tell you which fields produced the hit. + properties: + from: + type: array + items: + type: string + nullable: true + description: Matched fragments from a sender address in the thread. + recipients: + type: array + items: + type: string + nullable: true + description: >- + Matched fragments from a recipient address in the thread (to, cc, or + bcc). + subject: + type: array + items: + type: string + nullable: true + description: Matched fragments from the subject. + text: + type: array + items: + type: string + nullable: true + description: Matched fragments from a message body in the thread. + SearchThreadItem: + title: SearchThreadItem + type: object + properties: + highlights: + $ref: '#/components/schemas/SearchThreadHighlights' + nullable: true + description: >- + Matched fragments per field. Present only when the query matched an + indexed field. + allOf: + - $ref: '#/components/schemas/ThreadItem' + SearchThreadsResponse: + title: SearchThreadsResponse + type: object + properties: + count: + $ref: '#/components/schemas/Count' + limit: + $ref: '#/components/schemas/Limit' + nullable: true + next_page_token: + $ref: '#/components/schemas/PageToken' + nullable: true + threads: + type: array + items: + $ref: '#/components/schemas/SearchThreadItem' + description: Ordered by relevance, best match first. + required: + - count + - threads + webhooksSvixId: + title: webhooksSvixId + type: string + description: ID of webhook message. + webhooksSvixTimestamp: + title: webhooksSvixTimestamp + type: string + format: date-time + description: Timestamp of webhook message. + webhooksSvixSignature: + title: webhooksSvixSignature + type: string + description: Signature of webhook message. + Subscribe: + title: Subscribe + type: object + properties: + type: + type: string + const: subscribe + event_types: + $ref: '#/components/schemas/EventTypes' + nullable: true + inbox_ids: + $ref: '#/components/schemas/InboxIds' + nullable: true + pod_ids: + $ref: '#/components/schemas/PodIds' + nullable: true + required: + - type + Subscribed: + title: Subscribed + type: object + properties: + type: + type: string + const: subscribed + event_types: + $ref: '#/components/schemas/EventTypes' + nullable: true + inbox_ids: + $ref: '#/components/schemas/InboxIds' + nullable: true + pod_ids: + $ref: '#/components/schemas/PodIds' + nullable: true + required: + - type + Error: + title: Error + type: object + properties: + type: + type: string + const: error + name: + $ref: '#/components/schemas/ErrorName' + message: + $ref: '#/components/schemas/ErrorMessage' + required: + - type + - name + - message + securitySchemes: + BearerAuth: + type: http + scheme: bearer From 4ffbe5bf42618bac2a5ab049cb66f5fb1c0d6ee6 Mon Sep 17 00:00:00 2001 From: fern-support <126544928+fern-support@users.noreply.github.com> Date: Thu, 4 Jun 2026 11:53:28 -0400 Subject: [PATCH 05/18] revert folder rename --- fern/apis/{fern-def => api}/definition/__package__.yml | 0 fern/apis/{fern-def => api}/definition/agent.yml | 0 fern/apis/{fern-def => api}/definition/api-keys.yml | 0 fern/apis/{fern-def => api}/definition/api.yml | 0 fern/apis/{fern-def => api}/definition/attachments.yml | 0 fern/apis/{fern-def => api}/definition/auth.yml | 0 fern/apis/{fern-def => api}/definition/domains.yml | 0 fern/apis/{fern-def => api}/definition/drafts.yml | 0 fern/apis/{fern-def => api}/definition/events.yml | 0 fern/apis/{fern-def => api}/definition/inbox-events.yml | 0 fern/apis/{fern-def => api}/definition/inboxes/__package__.yml | 0 fern/apis/{fern-def => api}/definition/inboxes/api-keys.yml | 0 fern/apis/{fern-def => api}/definition/inboxes/drafts.yml | 0 fern/apis/{fern-def => api}/definition/inboxes/events.yml | 0 fern/apis/{fern-def => api}/definition/inboxes/lists.yml | 0 fern/apis/{fern-def => api}/definition/inboxes/messages.yml | 0 fern/apis/{fern-def => api}/definition/inboxes/metrics.yml | 0 fern/apis/{fern-def => api}/definition/inboxes/threads.yml | 0 fern/apis/{fern-def => api}/definition/lists.yml | 0 fern/apis/{fern-def => api}/definition/messages.yml | 0 fern/apis/{fern-def => api}/definition/metrics.yml | 0 fern/apis/{fern-def => api}/definition/organizations.yml | 0 fern/apis/{fern-def => api}/definition/pods/__package__.yml | 0 fern/apis/{fern-def => api}/definition/pods/api-keys.yml | 0 fern/apis/{fern-def => api}/definition/pods/domains.yml | 0 fern/apis/{fern-def => api}/definition/pods/drafts.yml | 0 fern/apis/{fern-def => api}/definition/pods/inboxes.yml | 0 fern/apis/{fern-def => api}/definition/pods/lists.yml | 0 fern/apis/{fern-def => api}/definition/pods/metrics.yml | 0 fern/apis/{fern-def => api}/definition/pods/threads.yml | 0 fern/apis/{fern-def => api}/definition/threads.yml | 0 fern/apis/{fern-def => api}/definition/webhooks/__package__.yml | 0 fern/apis/{fern-def => api}/definition/webhooks/events.yml | 0 fern/apis/{fern-def => api}/definition/websockets.yml | 0 fern/apis/{fern-def => api}/generators.yml | 0 fern/apis/{openapi-spec => cli}/generators.yml | 0 36 files changed, 0 insertions(+), 0 deletions(-) rename fern/apis/{fern-def => api}/definition/__package__.yml (100%) rename fern/apis/{fern-def => api}/definition/agent.yml (100%) rename fern/apis/{fern-def => api}/definition/api-keys.yml (100%) rename fern/apis/{fern-def => api}/definition/api.yml (100%) rename fern/apis/{fern-def => api}/definition/attachments.yml (100%) rename fern/apis/{fern-def => api}/definition/auth.yml (100%) rename fern/apis/{fern-def => api}/definition/domains.yml (100%) rename fern/apis/{fern-def => api}/definition/drafts.yml (100%) rename fern/apis/{fern-def => api}/definition/events.yml (100%) rename fern/apis/{fern-def => api}/definition/inbox-events.yml (100%) rename fern/apis/{fern-def => api}/definition/inboxes/__package__.yml (100%) rename fern/apis/{fern-def => api}/definition/inboxes/api-keys.yml (100%) rename fern/apis/{fern-def => api}/definition/inboxes/drafts.yml (100%) rename fern/apis/{fern-def => api}/definition/inboxes/events.yml (100%) rename fern/apis/{fern-def => api}/definition/inboxes/lists.yml (100%) rename fern/apis/{fern-def => api}/definition/inboxes/messages.yml (100%) rename fern/apis/{fern-def => api}/definition/inboxes/metrics.yml (100%) rename fern/apis/{fern-def => api}/definition/inboxes/threads.yml (100%) rename fern/apis/{fern-def => api}/definition/lists.yml (100%) rename fern/apis/{fern-def => api}/definition/messages.yml (100%) rename fern/apis/{fern-def => api}/definition/metrics.yml (100%) rename fern/apis/{fern-def => api}/definition/organizations.yml (100%) rename fern/apis/{fern-def => api}/definition/pods/__package__.yml (100%) rename fern/apis/{fern-def => api}/definition/pods/api-keys.yml (100%) rename fern/apis/{fern-def => api}/definition/pods/domains.yml (100%) rename fern/apis/{fern-def => api}/definition/pods/drafts.yml (100%) rename fern/apis/{fern-def => api}/definition/pods/inboxes.yml (100%) rename fern/apis/{fern-def => api}/definition/pods/lists.yml (100%) rename fern/apis/{fern-def => api}/definition/pods/metrics.yml (100%) rename fern/apis/{fern-def => api}/definition/pods/threads.yml (100%) rename fern/apis/{fern-def => api}/definition/threads.yml (100%) rename fern/apis/{fern-def => api}/definition/webhooks/__package__.yml (100%) rename fern/apis/{fern-def => api}/definition/webhooks/events.yml (100%) rename fern/apis/{fern-def => api}/definition/websockets.yml (100%) rename fern/apis/{fern-def => api}/generators.yml (100%) rename fern/apis/{openapi-spec => cli}/generators.yml (100%) diff --git a/fern/apis/fern-def/definition/__package__.yml b/fern/apis/api/definition/__package__.yml similarity index 100% rename from fern/apis/fern-def/definition/__package__.yml rename to fern/apis/api/definition/__package__.yml diff --git a/fern/apis/fern-def/definition/agent.yml b/fern/apis/api/definition/agent.yml similarity index 100% rename from fern/apis/fern-def/definition/agent.yml rename to fern/apis/api/definition/agent.yml diff --git a/fern/apis/fern-def/definition/api-keys.yml b/fern/apis/api/definition/api-keys.yml similarity index 100% rename from fern/apis/fern-def/definition/api-keys.yml rename to fern/apis/api/definition/api-keys.yml diff --git a/fern/apis/fern-def/definition/api.yml b/fern/apis/api/definition/api.yml similarity index 100% rename from fern/apis/fern-def/definition/api.yml rename to fern/apis/api/definition/api.yml diff --git a/fern/apis/fern-def/definition/attachments.yml b/fern/apis/api/definition/attachments.yml similarity index 100% rename from fern/apis/fern-def/definition/attachments.yml rename to fern/apis/api/definition/attachments.yml diff --git a/fern/apis/fern-def/definition/auth.yml b/fern/apis/api/definition/auth.yml similarity index 100% rename from fern/apis/fern-def/definition/auth.yml rename to fern/apis/api/definition/auth.yml diff --git a/fern/apis/fern-def/definition/domains.yml b/fern/apis/api/definition/domains.yml similarity index 100% rename from fern/apis/fern-def/definition/domains.yml rename to fern/apis/api/definition/domains.yml diff --git a/fern/apis/fern-def/definition/drafts.yml b/fern/apis/api/definition/drafts.yml similarity index 100% rename from fern/apis/fern-def/definition/drafts.yml rename to fern/apis/api/definition/drafts.yml diff --git a/fern/apis/fern-def/definition/events.yml b/fern/apis/api/definition/events.yml similarity index 100% rename from fern/apis/fern-def/definition/events.yml rename to fern/apis/api/definition/events.yml diff --git a/fern/apis/fern-def/definition/inbox-events.yml b/fern/apis/api/definition/inbox-events.yml similarity index 100% rename from fern/apis/fern-def/definition/inbox-events.yml rename to fern/apis/api/definition/inbox-events.yml diff --git a/fern/apis/fern-def/definition/inboxes/__package__.yml b/fern/apis/api/definition/inboxes/__package__.yml similarity index 100% rename from fern/apis/fern-def/definition/inboxes/__package__.yml rename to fern/apis/api/definition/inboxes/__package__.yml diff --git a/fern/apis/fern-def/definition/inboxes/api-keys.yml b/fern/apis/api/definition/inboxes/api-keys.yml similarity index 100% rename from fern/apis/fern-def/definition/inboxes/api-keys.yml rename to fern/apis/api/definition/inboxes/api-keys.yml diff --git a/fern/apis/fern-def/definition/inboxes/drafts.yml b/fern/apis/api/definition/inboxes/drafts.yml similarity index 100% rename from fern/apis/fern-def/definition/inboxes/drafts.yml rename to fern/apis/api/definition/inboxes/drafts.yml diff --git a/fern/apis/fern-def/definition/inboxes/events.yml b/fern/apis/api/definition/inboxes/events.yml similarity index 100% rename from fern/apis/fern-def/definition/inboxes/events.yml rename to fern/apis/api/definition/inboxes/events.yml diff --git a/fern/apis/fern-def/definition/inboxes/lists.yml b/fern/apis/api/definition/inboxes/lists.yml similarity index 100% rename from fern/apis/fern-def/definition/inboxes/lists.yml rename to fern/apis/api/definition/inboxes/lists.yml diff --git a/fern/apis/fern-def/definition/inboxes/messages.yml b/fern/apis/api/definition/inboxes/messages.yml similarity index 100% rename from fern/apis/fern-def/definition/inboxes/messages.yml rename to fern/apis/api/definition/inboxes/messages.yml diff --git a/fern/apis/fern-def/definition/inboxes/metrics.yml b/fern/apis/api/definition/inboxes/metrics.yml similarity index 100% rename from fern/apis/fern-def/definition/inboxes/metrics.yml rename to fern/apis/api/definition/inboxes/metrics.yml diff --git a/fern/apis/fern-def/definition/inboxes/threads.yml b/fern/apis/api/definition/inboxes/threads.yml similarity index 100% rename from fern/apis/fern-def/definition/inboxes/threads.yml rename to fern/apis/api/definition/inboxes/threads.yml diff --git a/fern/apis/fern-def/definition/lists.yml b/fern/apis/api/definition/lists.yml similarity index 100% rename from fern/apis/fern-def/definition/lists.yml rename to fern/apis/api/definition/lists.yml diff --git a/fern/apis/fern-def/definition/messages.yml b/fern/apis/api/definition/messages.yml similarity index 100% rename from fern/apis/fern-def/definition/messages.yml rename to fern/apis/api/definition/messages.yml diff --git a/fern/apis/fern-def/definition/metrics.yml b/fern/apis/api/definition/metrics.yml similarity index 100% rename from fern/apis/fern-def/definition/metrics.yml rename to fern/apis/api/definition/metrics.yml diff --git a/fern/apis/fern-def/definition/organizations.yml b/fern/apis/api/definition/organizations.yml similarity index 100% rename from fern/apis/fern-def/definition/organizations.yml rename to fern/apis/api/definition/organizations.yml diff --git a/fern/apis/fern-def/definition/pods/__package__.yml b/fern/apis/api/definition/pods/__package__.yml similarity index 100% rename from fern/apis/fern-def/definition/pods/__package__.yml rename to fern/apis/api/definition/pods/__package__.yml diff --git a/fern/apis/fern-def/definition/pods/api-keys.yml b/fern/apis/api/definition/pods/api-keys.yml similarity index 100% rename from fern/apis/fern-def/definition/pods/api-keys.yml rename to fern/apis/api/definition/pods/api-keys.yml diff --git a/fern/apis/fern-def/definition/pods/domains.yml b/fern/apis/api/definition/pods/domains.yml similarity index 100% rename from fern/apis/fern-def/definition/pods/domains.yml rename to fern/apis/api/definition/pods/domains.yml diff --git a/fern/apis/fern-def/definition/pods/drafts.yml b/fern/apis/api/definition/pods/drafts.yml similarity index 100% rename from fern/apis/fern-def/definition/pods/drafts.yml rename to fern/apis/api/definition/pods/drafts.yml diff --git a/fern/apis/fern-def/definition/pods/inboxes.yml b/fern/apis/api/definition/pods/inboxes.yml similarity index 100% rename from fern/apis/fern-def/definition/pods/inboxes.yml rename to fern/apis/api/definition/pods/inboxes.yml diff --git a/fern/apis/fern-def/definition/pods/lists.yml b/fern/apis/api/definition/pods/lists.yml similarity index 100% rename from fern/apis/fern-def/definition/pods/lists.yml rename to fern/apis/api/definition/pods/lists.yml diff --git a/fern/apis/fern-def/definition/pods/metrics.yml b/fern/apis/api/definition/pods/metrics.yml similarity index 100% rename from fern/apis/fern-def/definition/pods/metrics.yml rename to fern/apis/api/definition/pods/metrics.yml diff --git a/fern/apis/fern-def/definition/pods/threads.yml b/fern/apis/api/definition/pods/threads.yml similarity index 100% rename from fern/apis/fern-def/definition/pods/threads.yml rename to fern/apis/api/definition/pods/threads.yml diff --git a/fern/apis/fern-def/definition/threads.yml b/fern/apis/api/definition/threads.yml similarity index 100% rename from fern/apis/fern-def/definition/threads.yml rename to fern/apis/api/definition/threads.yml diff --git a/fern/apis/fern-def/definition/webhooks/__package__.yml b/fern/apis/api/definition/webhooks/__package__.yml similarity index 100% rename from fern/apis/fern-def/definition/webhooks/__package__.yml rename to fern/apis/api/definition/webhooks/__package__.yml diff --git a/fern/apis/fern-def/definition/webhooks/events.yml b/fern/apis/api/definition/webhooks/events.yml similarity index 100% rename from fern/apis/fern-def/definition/webhooks/events.yml rename to fern/apis/api/definition/webhooks/events.yml diff --git a/fern/apis/fern-def/definition/websockets.yml b/fern/apis/api/definition/websockets.yml similarity index 100% rename from fern/apis/fern-def/definition/websockets.yml rename to fern/apis/api/definition/websockets.yml diff --git a/fern/apis/fern-def/generators.yml b/fern/apis/api/generators.yml similarity index 100% rename from fern/apis/fern-def/generators.yml rename to fern/apis/api/generators.yml diff --git a/fern/apis/openapi-spec/generators.yml b/fern/apis/cli/generators.yml similarity index 100% rename from fern/apis/openapi-spec/generators.yml rename to fern/apis/cli/generators.yml From 9c9f8232ccddd8ec9fb6955ed0d20b62bdd00925 Mon Sep 17 00:00:00 2001 From: fern-support <126544928+fern-support@users.noreply.github.com> Date: Thu, 4 Jun 2026 11:54:11 -0400 Subject: [PATCH 06/18] fix stainless sync command --- .github/workflows/sync-stainless.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-stainless.yml b/.github/workflows/sync-stainless.yml index 4a84ebd3..25a158cb 100644 --- a/.github/workflows/sync-stainless.yml +++ b/.github/workflows/sync-stainless.yml @@ -22,7 +22,7 @@ jobs: - name: Generate OpenAPI spec working-directory: fern - run: fern generate --group openapi --local + run: fern generate --api api --group openapi --local env: FERN_TOKEN: ${{ secrets.FERN_TOKEN }} From 9ba612b05b13a64adf98a2dd76c37e9da663e436 Mon Sep 17 00:00:00 2001 From: fern-support <126544928+fern-support@users.noreply.github.com> Date: Thu, 4 Jun 2026 11:58:13 -0400 Subject: [PATCH 07/18] updates --- .github/workflows/release-cli.yml | 29 +++++++++++++++++++++++++++++ fern/apis/cli/generators.yml | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release-cli.yml diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml new file mode 100644 index 00000000..487f2174 --- /dev/null +++ b/.github/workflows/release-cli.yml @@ -0,0 +1,29 @@ +name: Release CLI + +on: + push: + branches: + - main + paths: + # a) API spec changes + - "openapi/openapi.yml" + # b) Fern CLI version changes + - "fern/fern.config.json" + # c) Generator version changes + - "fern/api/cli/generators.yml" + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v6 + + - name: Setup Fern CLI + uses: fern-api/setup-fern-cli@v1 + + - name: Generate CLI + env: + FERN_TOKEN: ${{ secrets.FERN_TOKEN }} + run: fern generate --api cli --group cli --log-level debug --version AUTO diff --git a/fern/apis/cli/generators.yml b/fern/apis/cli/generators.yml index ffa3a235..e8e4dc19 100644 --- a/fern/apis/cli/generators.yml +++ b/fern/apis/cli/generators.yml @@ -15,4 +15,4 @@ groups: token: OIDC github: repository: agentmail-to/agentmail-cli - mode: release + mode: pull-request From 22b12efb0c3a425e870ad1965559e21f73846970 Mon Sep 17 00:00:00 2001 From: Cade Sarkin Date: Wed, 10 Jun 2026 16:59:12 -0400 Subject: [PATCH 08/18] Bump cli generator to 0.17.3 and rename Send type to avoid Rust trait collision The generated Rust code glob-imports the model prelude into error.rs, so a model named Send shadows std::marker::Send and breaks the `+ Send + Sync` trait-object bounds. x-fern-type-name renames the generated type to SendEvent without changing the wire format. Co-Authored-By: Claude Fable 5 --- fern/apis/cli/generators.yml | 6 ++++-- openapi/openapi.yml | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fern/apis/cli/generators.yml b/fern/apis/cli/generators.yml index e8e4dc19..7065a8d3 100644 --- a/fern/apis/cli/generators.yml +++ b/fern/apis/cli/generators.yml @@ -7,12 +7,14 @@ groups: cli: generators: - name: fern-cli-generator - version: 0.8.0 + version: 0.17.3 smart-casing: true + config: + binaryName: agentmail output: location: npm package-name: "agentmail-cli" token: OIDC github: - repository: agentmail-to/agentmail-cli + repository: fern-demo/agentmail-cli mode: pull-request diff --git a/openapi/openapi.yml b/openapi/openapi.yml index 3d3337b0..7b8c44df 100644 --- a/openapi/openapi.yml +++ b/openapi/openapi.yml @@ -6969,6 +6969,7 @@ components: - status Send: title: Send + x-fern-type-name: SendEvent type: object properties: inbox_id: From f16550440590de60affa78ca165ad68fa92a3a26 Mon Sep 17 00:00:00 2001 From: Cade Sarkin Date: Wed, 10 Jun 2026 17:23:15 -0400 Subject: [PATCH 09/18] =?UTF-8?q?Move=20Send=E2=86=92SendEvent=20rename=20?= =?UTF-8?q?out=20of=20the=20spec=20into=20a=20CLI=20overrides=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit openapi/openapi.yml is generated output, so the inline annotation would be lost on the next spec regen. The overrides file is merged onto the spec only for CLI generation. Co-Authored-By: Claude Fable 5 --- fern/apis/cli/generators.yml | 1 + fern/apis/cli/openapi-overrides.yml | 7 +++++++ openapi/openapi.yml | 1 - 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 fern/apis/cli/openapi-overrides.yml diff --git a/fern/apis/cli/generators.yml b/fern/apis/cli/generators.yml index 7065a8d3..deb50664 100644 --- a/fern/apis/cli/generators.yml +++ b/fern/apis/cli/generators.yml @@ -2,6 +2,7 @@ api: specs: - openapi: ../../../openapi/openapi.yml + overrides: ./openapi-overrides.yml default-group: cli groups: cli: diff --git a/fern/apis/cli/openapi-overrides.yml b/fern/apis/cli/openapi-overrides.yml new file mode 100644 index 00000000..08557d39 --- /dev/null +++ b/fern/apis/cli/openapi-overrides.yml @@ -0,0 +1,7 @@ +# Overrides merged onto ../../../openapi/openapi.yml for CLI generation. +# Rename the Send schema's generated type so it doesn't shadow Rust's +# std::marker::Send trait in the generated CLI crate. +components: + schemas: + Send: + x-fern-type-name: SendEvent diff --git a/openapi/openapi.yml b/openapi/openapi.yml index 7b8c44df..3d3337b0 100644 --- a/openapi/openapi.yml +++ b/openapi/openapi.yml @@ -6969,7 +6969,6 @@ components: - status Send: title: Send - x-fern-type-name: SendEvent type: object properties: inbox_id: From e16354309ce7592da631b95dd7b94203a609c64f Mon Sep 17 00:00:00 2001 From: Cade Sarkin Date: Wed, 10 Jun 2026 17:32:08 -0400 Subject: [PATCH 10/18] Override spec title so the generated CLI README says AgentMail, not "api" Co-Authored-By: Claude Fable 5 --- fern/apis/cli/openapi-overrides.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fern/apis/cli/openapi-overrides.yml b/fern/apis/cli/openapi-overrides.yml index 08557d39..fdb2e173 100644 --- a/fern/apis/cli/openapi-overrides.yml +++ b/fern/apis/cli/openapi-overrides.yml @@ -1,4 +1,8 @@ # Overrides merged onto ../../../openapi/openapi.yml for CLI generation. +# The spec's info.title is "api" (from the Fern definition's API name), +# which leaks into the generated README ("# api CLI"). +info: + title: AgentMail # Rename the Send schema's generated type so it doesn't shadow Rust's # std::marker::Send trait in the generated CLI crate. components: From 2fa9df8637956eb01973f0ac0d83afebcb2cfa97 Mon Sep 17 00:00:00 2001 From: Cade Sarkin Date: Wed, 10 Jun 2026 17:46:26 -0400 Subject: [PATCH 11/18] Scope demo CLI npm package to @fern-demo/agentmail-cli The unscoped agentmail-cli name on npm is AgentMail's production (Stainless-generated Go) CLI, so the generated README's install instructions pointed at the wrong binary. Revert to agentmail-cli when this pipeline becomes the official one. Co-Authored-By: Claude Fable 5 --- fern/apis/cli/generators.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fern/apis/cli/generators.yml b/fern/apis/cli/generators.yml index deb50664..d120ddde 100644 --- a/fern/apis/cli/generators.yml +++ b/fern/apis/cli/generators.yml @@ -14,7 +14,7 @@ groups: binaryName: agentmail output: location: npm - package-name: "agentmail-cli" + package-name: "@fern-demo/agentmail-cli" token: OIDC github: repository: fern-demo/agentmail-cli From 938f182b42337a5afdc2a3bfde6fbae0208b2715 Mon Sep 17 00:00:00 2001 From: Cade Sarkin Date: Fri, 12 Jun 2026 11:23:20 -0400 Subject: [PATCH 12/18] Nest CLI command groups via x-fern-sdk-group-name annotations The OpenAPI export drops the group nesting that exists in the Fern definition, so the CLI generator flattened nested resources into hyphenated groups (inboxes-messages send). Annotate all 63 operations in the inboxes-*/pods-* groups so commands nest properly (inboxes messages send). Names are camelCase per Fern convention; smart-casing renders them kebab-case in the CLI. Co-Authored-By: Claude Fable 5 --- fern/apis/cli/openapi-overrides.yml | 362 ++++++++++++++++++++++++++++ 1 file changed, 362 insertions(+) diff --git a/fern/apis/cli/openapi-overrides.yml b/fern/apis/cli/openapi-overrides.yml index fdb2e173..f00b5b16 100644 --- a/fern/apis/cli/openapi-overrides.yml +++ b/fern/apis/cli/openapi-overrides.yml @@ -9,3 +9,365 @@ components: schemas: Send: x-fern-type-name: SendEvent + +# Nest the flattened inboxes-*/pods-* command groups (e.g. inboxes-messages -> +# 'inboxes messages') by restoring the group structure the OpenAPI export drops. +# Generated from operationId prefixes; method names are the remaining segments. +paths: + /v0/inboxes/{inbox_id}/api-keys: + get: + x-fern-sdk-group-name: + - inboxes + - apiKeys + x-fern-sdk-method-name: list + post: + x-fern-sdk-group-name: + - inboxes + - apiKeys + x-fern-sdk-method-name: create + /v0/inboxes/{inbox_id}/api-keys/{api_key_id}: + delete: + x-fern-sdk-group-name: + - inboxes + - apiKeys + x-fern-sdk-method-name: delete + /v0/inboxes/{inbox_id}/drafts: + get: + x-fern-sdk-group-name: + - inboxes + - drafts + x-fern-sdk-method-name: list + post: + x-fern-sdk-group-name: + - inboxes + - drafts + x-fern-sdk-method-name: create + /v0/inboxes/{inbox_id}/drafts/{draft_id}: + get: + x-fern-sdk-group-name: + - inboxes + - drafts + x-fern-sdk-method-name: get + patch: + x-fern-sdk-group-name: + - inboxes + - drafts + x-fern-sdk-method-name: update + delete: + x-fern-sdk-group-name: + - inboxes + - drafts + x-fern-sdk-method-name: delete + /v0/inboxes/{inbox_id}/drafts/{draft_id}/attachments/{attachment_id}: + get: + x-fern-sdk-group-name: + - inboxes + - drafts + x-fern-sdk-method-name: getAttachment + /v0/inboxes/{inbox_id}/drafts/{draft_id}/send: + post: + x-fern-sdk-group-name: + - inboxes + - drafts + x-fern-sdk-method-name: send + /v0/inboxes/{inbox_id}/events: + get: + x-fern-sdk-group-name: + - inboxes + - events + x-fern-sdk-method-name: list + /v0/inboxes/{inbox_id}/lists/{direction}/{type}: + get: + x-fern-sdk-group-name: + - inboxes + - lists + x-fern-sdk-method-name: list + post: + x-fern-sdk-group-name: + - inboxes + - lists + x-fern-sdk-method-name: create + /v0/inboxes/{inbox_id}/lists/{direction}/{type}/{entry}: + get: + x-fern-sdk-group-name: + - inboxes + - lists + x-fern-sdk-method-name: get + delete: + x-fern-sdk-group-name: + - inboxes + - lists + x-fern-sdk-method-name: delete + /v0/inboxes/{inbox_id}/messages: + get: + x-fern-sdk-group-name: + - inboxes + - messages + x-fern-sdk-method-name: list + /v0/inboxes/{inbox_id}/messages/search: + get: + x-fern-sdk-group-name: + - inboxes + - messages + x-fern-sdk-method-name: search + /v0/inboxes/{inbox_id}/messages/{message_id}: + get: + x-fern-sdk-group-name: + - inboxes + - messages + x-fern-sdk-method-name: get + patch: + x-fern-sdk-group-name: + - inboxes + - messages + x-fern-sdk-method-name: update + delete: + x-fern-sdk-group-name: + - inboxes + - messages + x-fern-sdk-method-name: delete + /v0/inboxes/{inbox_id}/messages/batch-get: + post: + x-fern-sdk-group-name: + - inboxes + - messages + x-fern-sdk-method-name: batchGet + /v0/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}: + get: + x-fern-sdk-group-name: + - inboxes + - messages + x-fern-sdk-method-name: getAttachment + /v0/inboxes/{inbox_id}/messages/{message_id}/raw: + get: + x-fern-sdk-group-name: + - inboxes + - messages + x-fern-sdk-method-name: getRaw + /v0/inboxes/{inbox_id}/messages/send: + post: + x-fern-sdk-group-name: + - inboxes + - messages + x-fern-sdk-method-name: send + /v0/inboxes/{inbox_id}/messages/{message_id}/reply: + post: + x-fern-sdk-group-name: + - inboxes + - messages + x-fern-sdk-method-name: reply + /v0/inboxes/{inbox_id}/messages/{message_id}/reply-all: + post: + x-fern-sdk-group-name: + - inboxes + - messages + x-fern-sdk-method-name: reply-all + /v0/inboxes/{inbox_id}/messages/{message_id}/forward: + post: + x-fern-sdk-group-name: + - inboxes + - messages + x-fern-sdk-method-name: forward + /v0/inboxes/{inbox_id}/metrics: + get: + x-fern-sdk-group-name: + - inboxes + - metrics + x-fern-sdk-method-name: query + /v0/inboxes/{inbox_id}/threads: + get: + x-fern-sdk-group-name: + - inboxes + - threads + x-fern-sdk-method-name: list + /v0/inboxes/{inbox_id}/threads/search: + get: + x-fern-sdk-group-name: + - inboxes + - threads + x-fern-sdk-method-name: search + /v0/inboxes/{inbox_id}/threads/{thread_id}: + get: + x-fern-sdk-group-name: + - inboxes + - threads + x-fern-sdk-method-name: get + patch: + x-fern-sdk-group-name: + - inboxes + - threads + x-fern-sdk-method-name: update + delete: + x-fern-sdk-group-name: + - inboxes + - threads + x-fern-sdk-method-name: delete + /v0/inboxes/{inbox_id}/threads/{thread_id}/attachments/{attachment_id}: + get: + x-fern-sdk-group-name: + - inboxes + - threads + x-fern-sdk-method-name: getAttachment + /v0/pods/{pod_id}/api-keys: + get: + x-fern-sdk-group-name: + - pods + - apiKeys + x-fern-sdk-method-name: list + post: + x-fern-sdk-group-name: + - pods + - apiKeys + x-fern-sdk-method-name: create + /v0/pods/{pod_id}/api-keys/{api_key_id}: + delete: + x-fern-sdk-group-name: + - pods + - apiKeys + x-fern-sdk-method-name: delete + /v0/pods/{pod_id}/domains: + get: + x-fern-sdk-group-name: + - pods + - domains + x-fern-sdk-method-name: list + post: + x-fern-sdk-group-name: + - pods + - domains + x-fern-sdk-method-name: create + /v0/pods/{pod_id}/domains/{domain_id}: + get: + x-fern-sdk-group-name: + - pods + - domains + x-fern-sdk-method-name: get + patch: + x-fern-sdk-group-name: + - pods + - domains + x-fern-sdk-method-name: update + delete: + x-fern-sdk-group-name: + - pods + - domains + x-fern-sdk-method-name: delete + /v0/pods/{pod_id}/domains/{domain_id}/zone-file: + get: + x-fern-sdk-group-name: + - pods + - domains + x-fern-sdk-method-name: getZoneFile + /v0/pods/{pod_id}/domains/{domain_id}/verify: + post: + x-fern-sdk-group-name: + - pods + - domains + x-fern-sdk-method-name: verify + /v0/pods/{pod_id}/drafts: + get: + x-fern-sdk-group-name: + - pods + - drafts + x-fern-sdk-method-name: list + /v0/pods/{pod_id}/drafts/{draft_id}: + get: + x-fern-sdk-group-name: + - pods + - drafts + x-fern-sdk-method-name: get + /v0/pods/{pod_id}/drafts/{draft_id}/attachments/{attachment_id}: + get: + x-fern-sdk-group-name: + - pods + - drafts + x-fern-sdk-method-name: getAttachment + /v0/pods/{pod_id}/inboxes: + get: + x-fern-sdk-group-name: + - pods + - inboxes + x-fern-sdk-method-name: list + post: + x-fern-sdk-group-name: + - pods + - inboxes + x-fern-sdk-method-name: create + /v0/pods/{pod_id}/inboxes/{inbox_id}: + get: + x-fern-sdk-group-name: + - pods + - inboxes + x-fern-sdk-method-name: get + patch: + x-fern-sdk-group-name: + - pods + - inboxes + x-fern-sdk-method-name: update + delete: + x-fern-sdk-group-name: + - pods + - inboxes + x-fern-sdk-method-name: delete + /v0/pods/{pod_id}/lists/{direction}/{type}: + get: + x-fern-sdk-group-name: + - pods + - lists + x-fern-sdk-method-name: list + post: + x-fern-sdk-group-name: + - pods + - lists + x-fern-sdk-method-name: create + /v0/pods/{pod_id}/lists/{direction}/{type}/{entry}: + get: + x-fern-sdk-group-name: + - pods + - lists + x-fern-sdk-method-name: get + delete: + x-fern-sdk-group-name: + - pods + - lists + x-fern-sdk-method-name: delete + /v0/pods/{pod_id}/metrics: + get: + x-fern-sdk-group-name: + - pods + - metrics + x-fern-sdk-method-name: query + /v0/pods/{pod_id}/threads: + get: + x-fern-sdk-group-name: + - pods + - threads + x-fern-sdk-method-name: list + /v0/pods/{pod_id}/threads/search: + get: + x-fern-sdk-group-name: + - pods + - threads + x-fern-sdk-method-name: search + /v0/pods/{pod_id}/threads/{thread_id}: + get: + x-fern-sdk-group-name: + - pods + - threads + x-fern-sdk-method-name: get + patch: + x-fern-sdk-group-name: + - pods + - threads + x-fern-sdk-method-name: update + delete: + x-fern-sdk-group-name: + - pods + - threads + x-fern-sdk-method-name: delete + /v0/pods/{pod_id}/threads/{thread_id}/attachments/{attachment_id}: + get: + x-fern-sdk-group-name: + - pods + - threads + x-fern-sdk-method-name: getAttachment From b3f1632a5631a2f17629fa5c6f55012fbbbde899 Mon Sep 17 00:00:00 2001 From: Cade Sarkin Date: Fri, 12 Jun 2026 14:32:47 -0400 Subject: [PATCH 13/18] Bump cli generator to 0.17.8 Co-Authored-By: Claude Fable 5 --- fern/apis/cli/generators.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fern/apis/cli/generators.yml b/fern/apis/cli/generators.yml index d120ddde..d0bc1b3a 100644 --- a/fern/apis/cli/generators.yml +++ b/fern/apis/cli/generators.yml @@ -8,7 +8,7 @@ groups: cli: generators: - name: fern-cli-generator - version: 0.17.3 + version: 0.17.8 smart-casing: true config: binaryName: agentmail From f66350a57b17e8bf6a4e017bdde3ef6ba4e1fccf Mon Sep 17 00:00:00 2001 From: duharry0915 Date: Fri, 12 Jun 2026 12:36:05 -0700 Subject: [PATCH 14/18] Add x-fern-sdk group/method annotations for all CLI operations Co-Authored-By: Claude Fable 5 --- bin/gen-cli-overrides.py | 271 ++++++++++++++++++++++++++++ fern/apis/cli/openapi-overrides.yml | 194 ++++++++++++++++++++ 2 files changed, 465 insertions(+) create mode 100644 bin/gen-cli-overrides.py diff --git a/bin/gen-cli-overrides.py b/bin/gen-cli-overrides.py new file mode 100644 index 00000000..78c7490c --- /dev/null +++ b/bin/gen-cli-overrides.py @@ -0,0 +1,271 @@ +#!/usr/bin/env python3 +"""Generate x-fern-sdk-group-name / x-fern-sdk-method-name annotations for every +CLI operation missing from fern/apis/cli/openapi-overrides.yml. + +Idempotent: reads the committed OpenAPI spec (openapi/openapi.yml) and the +existing overrides file, computes the unannotated (path, method) pairs, and +appends entries for them. Re-run after every spec re-export so new endpoints +(e.g. batchUpdate) pick up annotations in seconds. + +Naming: + - group-name array: operationId prefix segments verbatim (matches the + convention of the hand-written entries, e.g. [inboxes, apiKeys] -- group + names are kebab-normalized by the generator, method names are NOT). + - method-name: operationId tail segment, kebab-cased (batchGet -> batch-get, + getZoneFile -> get-zone-file). Plain CRUD stays list/get/create/update/delete. + - Where the retired demo overlay (agentmail-cli/cli/agentmail/overlay.yaml) + hand-curated a name for the same path+method, its group names are ported + verbatim and its method name is kebab-normalized. + +Usage: + python3 bin/gen-cli-overrides.py # report what would be appended + python3 bin/gen-cli-overrides.py --write # append to the overrides file + python3 bin/gen-cli-overrides.py --table /tmp/cli-command-map.md + +No third-party dependencies: both inputs are machine-generated YAML with a +fixed layout, parsed line-wise. +""" +import argparse +import os +import re +import sys + +REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +SPEC = os.path.join(REPO, "openapi", "openapi.yml") +OVERRIDES = os.path.join(REPO, "fern", "apis", "cli", "openapi-overrides.yml") +OLD_OVERLAY = os.path.expanduser( + "~/Desktop/AgentMail_Workplace/agentmail-cli/cli/agentmail/overlay.yaml" +) +HTTP_METHODS = {"get", "post", "put", "patch", "delete", "head", "options"} + + +def kebab(name: str) -> str: + """batchGet -> batch-get, getZoneFile -> get-zone-file, reply-all unchanged.""" + return re.sub(r"(?<=[a-z0-9])([A-Z])", r"-\1", name).lower() + + +def parse_spec(path): + """Yield (path, method, operationId) from the generated OpenAPI YAML.""" + ops, cur_path, cur_method, in_paths = [], None, None, False + for line in open(path): + if re.match(r"^paths:\s*$", line): + in_paths = True + continue + if in_paths and re.match(r"^\S", line): # next top-level key + in_paths = False + if not in_paths: + continue + m = re.match(r"^ (/\S+):\s*$", line) + if m: + cur_path = m.group(1) + continue + m = re.match(r"^ ([a-z]+):\s*$", line) + if m and m.group(1) in HTTP_METHODS: + cur_method = m.group(1) + continue + m = re.match(r"^ operationId:\s*(\S+)\s*$", line) + if m and cur_path and cur_method: + ops.append((cur_path, cur_method, m.group(1))) + return ops + + +def parse_existing(path): + """Return {(path, method)} pairs already annotated in the overrides file.""" + annotated, cur_path, cur_method, in_paths = set(), None, None, False + for line in open(path): + if re.match(r"^paths:\s*$", line): + in_paths = True + continue + if in_paths and re.match(r"^\S", line): + in_paths = False + if not in_paths: + continue + m = re.match(r"^ (/\S+):\s*$", line) + if m: + cur_path = m.group(1) + continue + m = re.match(r"^ ([a-z]+):\s*$", line) + if m and m.group(1) in HTTP_METHODS: + cur_method = m.group(1) + continue + if "x-fern-sdk-method-name:" in line and cur_path and cur_method: + annotated.add((cur_path, cur_method)) + return annotated + + +def parse_existing_full(path): + """Return {(path, method): (groups, method_name)} from the overrides file + (used for the collision check and the review table).""" + out, cur_path, cur_method, in_paths = {}, None, None, False + groups, collecting = [], False + for line in open(path): + if re.match(r"^paths:\s*$", line): + in_paths = True + continue + if in_paths and re.match(r"^\S", line): + in_paths = False + if not in_paths: + continue + m = re.match(r"^ (/\S+):\s*$", line) + if m: + cur_path = m.group(1) + continue + m = re.match(r"^ ([a-z]+):\s*$", line) + if m and m.group(1) in HTTP_METHODS: + cur_method = m.group(1) + continue + if "x-fern-sdk-group-name:" in line: + groups, collecting = [], True + continue + m = re.match(r"^ - (\S+)\s*$", line) + if m and collecting: + groups.append(m.group(1)) + continue + m = re.match(r"^ x-fern-sdk-method-name:\s*(\S+)\s*$", line) + if m: + collecting = False + out[(cur_path, cur_method)] = (list(groups), m.group(1)) + return out + + +def parse_old_overlay(path): + """Return {(path, method): (groups, method_name)} from the retired demo + overlay (OpenAPI Overlay 1.0 format with JSONPath targets).""" + if not os.path.exists(path): + return {} + out, key, groups, collecting = {}, None, [], False + for line in open(path): + m = re.match(r"^- target: \$\.paths\['([^']+)'\]\.([a-z]+)\s*$", line) + if m: + key, groups, collecting = (m.group(1), m.group(2)), [], False + continue + if "x-fern-sdk-group-name:" in line: + collecting = True + continue + m = re.match(r"^ - (\S+)\s*$", line) + if m and collecting: + groups.append(m.group(1)) + continue + m = re.match(r"^ x-fern-sdk-method-name:\s*(\S+)\s*$", line) + if m and key: + out[key] = (list(groups), m.group(1)) + collecting = False + return out + + +def derive(operation_id, url_path): + """Derive (groups, method, ambiguous?) from an operationId like + inboxes_apiKeys_create, cross-checked against the URL's resource segments.""" + segments = operation_id.split("_") + groups, method = segments[:-1], kebab(segments[-1]) + # cross-check: every group segment should appear as a path resource segment + path_resources = { + s.replace("-", "").lower() + for s in url_path.split("/") + if s and not s.startswith("{") and s != "v0" + } + ambiguous = [ + g for g in groups if kebab(g).replace("-", "").lower() not in path_resources + ] + return groups, method, ambiguous + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--write", action="store_true", help="append to the overrides file") + ap.add_argument("--table", help="write a human-review markdown table here") + args = ap.parse_args() + + spec_ops = parse_spec(SPEC) + existing = parse_existing(OVERRIDES) + existing_full = parse_existing_full(OVERRIDES) + overlay = parse_old_overlay(OLD_OVERLAY) + + rows = [] # (groups, method, path, http, source, ambiguous) + missing = [] + for url_path, http, op_id in spec_ops: + if (url_path, http) in existing: + g, m = existing_full[(url_path, http)] + rows.append((g, m, url_path, http, "existing", [])) + continue + if (url_path, http) in overlay: + g, old_m = overlay[(url_path, http)] + m = kebab(old_m) + src = "ported" if m == old_m else f"ported (kebabbed {old_m})" + rows.append((g, m, url_path, http, src, [])) + else: + g, m, amb = derive(op_id, url_path) + rows.append((g, m, url_path, http, "derived", amb)) + missing.append((url_path, http, rows[-1][0], rows[-1][1])) + + # ---- validations ------------------------------------------------------- + print(f"spec operations: {len(spec_ops)}") + print(f"already annotated: {len(spec_ops) - len(missing)}") + print(f"to append: {len(missing)}") + covered = len(spec_ops) + print(f"coverage after append: {covered}/{len(spec_ops)}") + + seen, collisions = {}, [] + for g, m, p, h, *_ in rows: + key = (tuple(kebab(x) for x in g), m) + if key in seen: + collisions.append((key, seen[key], (p, h))) + seen[key] = (p, h) + if collisions: + print("COLLISIONS:") + for key, a, b in collisions: + print(" ", " ".join(key[0]), key[1], "<-", a, "AND", b) + sys.exit(1) + print("collisions: none") + + ambiguous_rows = [r for r in rows if r[5]] + if ambiguous_rows: + print("AMBIGUOUS derivations (group segment not found in path):") + for g, m, p, h, s, amb in ambiguous_rows: + print(f" {' '.join(g)} {m} ({h.upper()} {p}) unmatched: {amb}") + + # ---- review table ------------------------------------------------------ + if args.table: + with open(args.table, "w") as f: + f.write("# CLI command map (agentmail )\n\n") + f.write("| command | http | path | source |\n|---|---|---|---|\n") + for g, m, p, h, s, amb in sorted(rows, key=lambda r: (r[0], r[1])): + cmd = "agentmail " + " ".join(kebab(x) for x in g) + " " + m + star = " ⚠AMBIGUOUS" if amb else "" + f.write(f"| `{cmd}` | {h.upper()} | `{p}` | {s}{star} |\n") + print(f"review table -> {args.table}") + + # ---- emit -------------------------------------------------------------- + if not missing: + print("nothing to append") + return + # group consecutive methods under one path key, preserving spec order + by_path, order = {}, [] + for url_path, http, g, m in missing: + if url_path not in by_path: + by_path[url_path] = [] + order.append(url_path) + by_path[url_path].append((http, g, m)) + + chunk = [] + for url_path in order: + chunk.append(f" {url_path}:") + for http, g, m in by_path[url_path]: + chunk.append(f" {http}:") + chunk.append(" x-fern-sdk-group-name:") + for seg in g: + chunk.append(f" - {seg}") + chunk.append(f" x-fern-sdk-method-name: {m}") + text = "\n".join(chunk) + "\n" + + if args.write: + with open(OVERRIDES, "a") as f: + f.write(text) + print(f"appended {len(missing)} operations to {OVERRIDES}") + else: + print("--- would append (run with --write) ---") + print(text) + + +if __name__ == "__main__": + main() diff --git a/fern/apis/cli/openapi-overrides.yml b/fern/apis/cli/openapi-overrides.yml index f00b5b16..76f36867 100644 --- a/fern/apis/cli/openapi-overrides.yml +++ b/fern/apis/cli/openapi-overrides.yml @@ -371,3 +371,197 @@ paths: - pods - threads x-fern-sdk-method-name: getAttachment + /v0/inboxes: + get: + x-fern-sdk-group-name: + - inboxes + x-fern-sdk-method-name: list + post: + x-fern-sdk-group-name: + - inboxes + x-fern-sdk-method-name: create + /v0/inboxes/{inbox_id}: + get: + x-fern-sdk-group-name: + - inboxes + x-fern-sdk-method-name: get + patch: + x-fern-sdk-group-name: + - inboxes + x-fern-sdk-method-name: update + delete: + x-fern-sdk-group-name: + - inboxes + x-fern-sdk-method-name: delete + /v0/pods: + get: + x-fern-sdk-group-name: + - pods + x-fern-sdk-method-name: list + post: + x-fern-sdk-group-name: + - pods + x-fern-sdk-method-name: create + /v0/pods/{pod_id}: + get: + x-fern-sdk-group-name: + - pods + x-fern-sdk-method-name: get + delete: + x-fern-sdk-group-name: + - pods + x-fern-sdk-method-name: delete + /v0/webhooks: + get: + x-fern-sdk-group-name: + - webhooks + x-fern-sdk-method-name: list + post: + x-fern-sdk-group-name: + - webhooks + x-fern-sdk-method-name: create + /v0/webhooks/{webhook_id}: + get: + x-fern-sdk-group-name: + - webhooks + x-fern-sdk-method-name: get + patch: + x-fern-sdk-group-name: + - webhooks + x-fern-sdk-method-name: update + delete: + x-fern-sdk-group-name: + - webhooks + x-fern-sdk-method-name: delete + /v0/agent/sign-up: + post: + x-fern-sdk-group-name: + - agent + x-fern-sdk-method-name: sign-up + /v0/agent/verify: + post: + x-fern-sdk-group-name: + - agent + x-fern-sdk-method-name: verify + /v0/api-keys: + get: + x-fern-sdk-group-name: + - apiKeys + x-fern-sdk-method-name: list + post: + x-fern-sdk-group-name: + - apiKeys + x-fern-sdk-method-name: create + /v0/api-keys/{api_key_id}: + delete: + x-fern-sdk-group-name: + - apiKeys + x-fern-sdk-method-name: delete + /v0/auth/me: + get: + x-fern-sdk-group-name: + - auth + x-fern-sdk-method-name: me + /v0/domains: + get: + x-fern-sdk-group-name: + - domains + x-fern-sdk-method-name: list + post: + x-fern-sdk-group-name: + - domains + x-fern-sdk-method-name: create + /v0/domains/{domain_id}: + get: + x-fern-sdk-group-name: + - domains + x-fern-sdk-method-name: get + patch: + x-fern-sdk-group-name: + - domains + x-fern-sdk-method-name: update + delete: + x-fern-sdk-group-name: + - domains + x-fern-sdk-method-name: delete + /v0/domains/{domain_id}/zone-file: + get: + x-fern-sdk-group-name: + - domains + x-fern-sdk-method-name: get-zone-file + /v0/domains/{domain_id}/verify: + post: + x-fern-sdk-group-name: + - domains + x-fern-sdk-method-name: verify + /v0/drafts: + get: + x-fern-sdk-group-name: + - drafts + x-fern-sdk-method-name: list + /v0/drafts/{draft_id}: + get: + x-fern-sdk-group-name: + - drafts + x-fern-sdk-method-name: get + /v0/drafts/{draft_id}/attachments/{attachment_id}: + get: + x-fern-sdk-group-name: + - drafts + x-fern-sdk-method-name: get-attachment + /v0/lists/{direction}/{type}: + get: + x-fern-sdk-group-name: + - lists + x-fern-sdk-method-name: list + post: + x-fern-sdk-group-name: + - lists + x-fern-sdk-method-name: create + /v0/lists/{direction}/{type}/{entry}: + get: + x-fern-sdk-group-name: + - lists + x-fern-sdk-method-name: get + delete: + x-fern-sdk-group-name: + - lists + x-fern-sdk-method-name: delete + /v0/metrics: + get: + x-fern-sdk-group-name: + - metrics + x-fern-sdk-method-name: list + /v0/organizations: + get: + x-fern-sdk-group-name: + - organizations + x-fern-sdk-method-name: get + /v0/threads: + get: + x-fern-sdk-group-name: + - threads + x-fern-sdk-method-name: list + /v0/threads/search: + get: + x-fern-sdk-group-name: + - threads + x-fern-sdk-method-name: search + /v0/threads/{thread_id}: + get: + x-fern-sdk-group-name: + - threads + x-fern-sdk-method-name: get + patch: + x-fern-sdk-group-name: + - threads + x-fern-sdk-method-name: update + delete: + x-fern-sdk-group-name: + - threads + x-fern-sdk-method-name: delete + /v0/threads/{thread_id}/attachments/{attachment_id}: + get: + x-fern-sdk-group-name: + - threads + x-fern-sdk-method-name: get-attachment From 9bdd942262b97a479d425ba80a12ecd3bd95345f Mon Sep 17 00:00:00 2001 From: duharry0915 Date: Sun, 12 Jul 2026 18:30:09 -0700 Subject: [PATCH 15/18] fix(cli): kebab method names, repair regen triggers, keep stainless sync alive Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/release-cli.yml | 16 ++++++++++++---- .github/workflows/sync-stainless.yml | 5 ++--- fern/apis/cli/openapi-overrides.yml | 18 +++++++++--------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 487f2174..44ab9cbf 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -5,12 +5,15 @@ on: branches: - main paths: - # a) API spec changes + # a) API definition changes (source of truth) + - "fern/apis/api/definition/**" + # b) Committed OpenAPI export changes - "openapi/openapi.yml" - # b) Fern CLI version changes + # c) CLI generator config / overrides changes + - "fern/apis/cli/generators.yml" + - "fern/apis/cli/openapi-overrides.yml" + # d) Fern CLI version changes - "fern/fern.config.json" - # c) Generator version changes - - "fern/api/cli/generators.yml" workflow_dispatch: jobs: @@ -23,6 +26,11 @@ jobs: - name: Setup Fern CLI uses: fern-api/setup-fern-cli@v1 + - name: Re-export OpenAPI from definition + env: + FERN_TOKEN: ${{ secrets.FERN_TOKEN }} + run: fern generate --api api --group openapi --local + - name: Generate CLI env: FERN_TOKEN: ${{ secrets.FERN_TOKEN }} diff --git a/.github/workflows/sync-stainless.yml b/.github/workflows/sync-stainless.yml index 25a158cb..9cdd2627 100644 --- a/.github/workflows/sync-stainless.yml +++ b/.github/workflows/sync-stainless.yml @@ -6,9 +6,8 @@ on: branches: - main paths: - - "fern/definition/**" - - "fern/generators.yml" - - "fern/api.yml" + - "fern/apis/api/definition/**" + - "fern/apis/api/generators.yml" jobs: sync: diff --git a/fern/apis/cli/openapi-overrides.yml b/fern/apis/cli/openapi-overrides.yml index 76f36867..463c932f 100644 --- a/fern/apis/cli/openapi-overrides.yml +++ b/fern/apis/cli/openapi-overrides.yml @@ -63,7 +63,7 @@ paths: x-fern-sdk-group-name: - inboxes - drafts - x-fern-sdk-method-name: getAttachment + x-fern-sdk-method-name: get-attachment /v0/inboxes/{inbox_id}/drafts/{draft_id}/send: post: x-fern-sdk-group-name: @@ -131,19 +131,19 @@ paths: x-fern-sdk-group-name: - inboxes - messages - x-fern-sdk-method-name: batchGet + x-fern-sdk-method-name: batch-get /v0/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}: get: x-fern-sdk-group-name: - inboxes - messages - x-fern-sdk-method-name: getAttachment + x-fern-sdk-method-name: get-attachment /v0/inboxes/{inbox_id}/messages/{message_id}/raw: get: x-fern-sdk-group-name: - inboxes - messages - x-fern-sdk-method-name: getRaw + x-fern-sdk-method-name: get-raw /v0/inboxes/{inbox_id}/messages/send: post: x-fern-sdk-group-name: @@ -207,7 +207,7 @@ paths: x-fern-sdk-group-name: - inboxes - threads - x-fern-sdk-method-name: getAttachment + x-fern-sdk-method-name: get-attachment /v0/pods/{pod_id}/api-keys: get: x-fern-sdk-group-name: @@ -257,7 +257,7 @@ paths: x-fern-sdk-group-name: - pods - domains - x-fern-sdk-method-name: getZoneFile + x-fern-sdk-method-name: get-zone-file /v0/pods/{pod_id}/domains/{domain_id}/verify: post: x-fern-sdk-group-name: @@ -281,7 +281,7 @@ paths: x-fern-sdk-group-name: - pods - drafts - x-fern-sdk-method-name: getAttachment + x-fern-sdk-method-name: get-attachment /v0/pods/{pod_id}/inboxes: get: x-fern-sdk-group-name: @@ -370,7 +370,7 @@ paths: x-fern-sdk-group-name: - pods - threads - x-fern-sdk-method-name: getAttachment + x-fern-sdk-method-name: get-attachment /v0/inboxes: get: x-fern-sdk-group-name: @@ -531,7 +531,7 @@ paths: get: x-fern-sdk-group-name: - metrics - x-fern-sdk-method-name: list + x-fern-sdk-method-name: query /v0/organizations: get: x-fern-sdk-group-name: From 614aef3f7846db4d8543c21293fcc7740286e1a8 Mon Sep 17 00:00:00 2001 From: duharry0915 Date: Sun, 12 Jul 2026 18:48:18 -0700 Subject: [PATCH 16/18] chore: re-export openapi from definition Co-Authored-By: Claude Opus 4.8 (1M context) --- openapi/openapi.yml | 1554 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 1473 insertions(+), 81 deletions(-) diff --git a/openapi/openapi.yml b/openapi/openapi.yml index 3d3337b0..41cfe232 100644 --- a/openapi/openapi.yml +++ b/openapi/openapi.yml @@ -74,6 +74,12 @@ paths: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' + '422': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' summary: Create Inbox servers: - url: https://api.agentmail.to @@ -1733,6 +1739,12 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorResponse' + '409': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' summary: Send Draft servers: - url: https://api.agentmail.to @@ -2441,6 +2453,67 @@ paths: application/json: schema: $ref: '#/components/schemas/BatchGetMessagesRequest' + /v0/inboxes/{inbox_id}/messages/batch-update: + post: + description: >- + Apply one label change to up to 50 messages in a single request. The + + same add_labels and remove_labels apply to every message id, and at + + least one of them must be provided. The update is atomic: either all + + resolved messages are updated or none are. Missing or restricted ids + + are silently excluded; compare `count` against `limit` to detect + + exclusions. + + + **CLI:** + + ```bash + + agentmail inboxes:messages batch-update --inbox-id + --message-id --message-id --add-label read --remove-label + unread + + ``` + operationId: inboxes_messages_batchUpdate + tags: + - InboxesMessages + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/BatchUpdateMessagesResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + summary: Batch Update Messages + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BatchUpdateMessagesRequest' /v0/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}: get: description: >- @@ -2583,6 +2656,12 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorResponse' + '409': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' summary: Send Message servers: - url: https://api.agentmail.to @@ -2647,6 +2726,12 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorResponse' + '409': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' summary: Reply To Message servers: - url: https://api.agentmail.to @@ -2711,6 +2796,12 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorResponse' + '409': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' summary: Reply All Message servers: - url: https://api.agentmail.to @@ -2775,6 +2866,12 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorResponse' + '409': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' summary: Forward Message servers: - url: https://api.agentmail.to @@ -2789,14 +2886,216 @@ paths: application/json: schema: $ref: '#/components/schemas/SendMessageRequest' - /v0/inboxes/{inbox_id}/metrics: + /v0/inboxes/{inbox_id}/messages/{message_id}/draft-reply: + post: + description: >- + Create a draft that replies to a message instead of sending it. The + + recipients, subject, and threading are derived from the source message. + + Send it later with `Send Draft`. + + + **CLI:** + + ```bash + + agentmail inboxes:messages draft-reply --inbox-id + --message-id --text "Reply text" + + ``` + operationId: inboxes_messages_draft-reply + tags: + - InboxesMessages + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: message_id + in: path + required: true + schema: + $ref: '#/components/schemas/MessageId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Draft' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Create Draft Reply + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateDraftReplyRequest' + /v0/inboxes/{inbox_id}/messages/{message_id}/draft-reply-all: + post: + description: >- + Create a draft that replies to every recipient of a message instead of + + sending it. Recipients, subject, and threading are derived from the + + source message. Send it later with `Send Draft`. + + + **CLI:** + + ```bash + + agentmail inboxes:messages draft-reply-all --inbox-id + --message-id --text "Reply text" + + ``` + operationId: inboxes_messages_draft-reply-all + tags: + - InboxesMessages + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: message_id + in: path + required: true + schema: + $ref: '#/components/schemas/MessageId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Draft' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Create Draft Reply All + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateDraftReplyAllRequest' + /v0/inboxes/{inbox_id}/messages/{message_id}/draft-forward: + post: + description: >- + Create a draft that forwards a message instead of sending it. The + subject + + and threading are derived from the source message, whose body and + + attachments are merged in at send time. Send it later with `Send Draft`. + + + **CLI:** + + ```bash + + agentmail inboxes:messages draft-forward --inbox-id + --message-id --to recipient@example.com + + ``` + operationId: inboxes_messages_draft-forward + tags: + - InboxesMessages + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: message_id + in: path + required: true + schema: + $ref: '#/components/schemas/MessageId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Draft' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Create Draft Forward + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateDraftForwardRequest' + /v0/inboxes/{inbox_id}/metrics/events: get: description: |- + Counts of email events (sent, delivered, bounced, etc.) over time for + the inbox. Defaults to the last 24 hours; `start` must be within the + last 90 days, and a future `end` is clamped to now. Omit `period` for + individual event counts, or set it to sum counts into buckets of that + many seconds. + **CLI:** ```bash agentmail inboxes:metrics query --inbox-id ``` - operationId: inboxes_metrics_query + operationId: inboxes_metrics_queryEvents tags: - InboxesMetrics parameters: @@ -2854,7 +3153,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' - summary: Query Metrics + summary: Query Events servers: - url: https://api.agentmail.to - url: https://x402.api.agentmail.to @@ -2862,17 +3161,93 @@ paths: - url: https://api.agentmail.eu security: - BearerAuth: [] - /v0/inboxes/{inbox_id}/threads: + /v0/inboxes/{inbox_id}/metrics/usage: get: description: |- - Lists threads in the inbox, most recent first. Pass `senders`, - `recipients`, or `subject` to filter by substring. Filtered requests are - served by search, which caps `limit` at 100. For relevance-ranked - full-text search, use `Search Threads`. - - **CLI:** - ```bash - agentmail inboxes:threads list --inbox-id + Cumulative usage series for the inbox. Each point is the running total + of the usage type at that timestamp, not the change within the bucket. + Inbox-scoped queries carry `storage_bytes`, `message_count`, and + `thread_count`; requested types that don't apply to the scope are + ignored. Defaults to the last 24 hours; `start` must be within the + last 90 days, and a future `end` is clamped to now. The range divided + by `period` must not exceed 1000 buckets. + operationId: inboxes_metrics_queryUsage + tags: + - InboxesMetrics + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: usage_types + in: query + required: false + schema: + $ref: '#/components/schemas/UsageTypes' + nullable: true + - name: start + in: query + required: false + schema: + $ref: '#/components/schemas/Start' + nullable: true + - name: end + in: query + required: false + schema: + $ref: '#/components/schemas/End' + nullable: true + - name: period + in: query + required: false + schema: + $ref: '#/components/schemas/Period' + nullable: true + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/MetricLimit' + nullable: true + - name: descending + in: query + required: false + schema: + $ref: '#/components/schemas/Descending' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/QueryUsageResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + summary: Query Usage + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/inboxes/{inbox_id}/threads: + get: + description: |- + Lists threads in the inbox, most recent first. Pass `senders`, + `recipients`, or `subject` to filter by substring. Filtered requests are + served by search, which caps `limit` at 100. For relevance-ranked + full-text search, use `Search Threads`. + + **CLI:** + ```bash + agentmail inboxes:threads list --inbox-id ``` operationId: inboxes_threads_list tags: @@ -3277,6 +3652,248 @@ paths: - url: https://api.agentmail.eu security: - BearerAuth: [] + /v0/inboxes/{inbox_id}/webhooks: + get: + description: |- + **CLI:** + ```bash + agentmail inboxes:webhooks list --inbox-id + ``` + operationId: inboxes_webhooks_list + tags: + - InboxesWebhooks + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + - name: ascending + in: query + required: false + schema: + $ref: '#/components/schemas/Ascending' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/webhooksListWebhooksResponse' + summary: List Webhooks + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + post: + description: >- + Create a webhook scoped to this inbox. + + + **CLI:** + + ```bash + + agentmail inboxes:webhooks create --inbox-id --url + https://example.com/webhook --event-type message.received + + ``` + operationId: inboxes_webhooks_create + tags: + - InboxesWebhooks + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/webhooksWebhook' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + summary: Create Webhook + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/webhooksCreateInboxWebhookRequest' + /v0/inboxes/{inbox_id}/webhooks/{webhook_id}: + get: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:webhooks get --inbox-id --webhook-id + + + ``` + operationId: inboxes_webhooks_get + tags: + - InboxesWebhooks + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: webhook_id + in: path + required: true + schema: + $ref: '#/components/schemas/webhooksWebhookId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/webhooksWebhook' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Webhook + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + patch: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:webhooks update --inbox-id --webhook-id + --event-type message.received + + ``` + operationId: inboxes_webhooks_update + tags: + - InboxesWebhooks + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: webhook_id + in: path + required: true + schema: + $ref: '#/components/schemas/webhooksWebhookId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/webhooksWebhook' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Update Webhook + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/webhooksUpdateInboxWebhookRequest' + delete: + description: >- + **CLI:** + + ```bash + + agentmail inboxes:webhooks delete --inbox-id --webhook-id + + + ``` + operationId: inboxes_webhooks_delete + tags: + - InboxesWebhooks + parameters: + - name: inbox_id + in: path + required: true + schema: + $ref: '#/components/schemas/inboxesInboxId' + - name: webhook_id + in: path + required: true + schema: + $ref: '#/components/schemas/webhooksWebhookId' + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Delete Webhook + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] /v0/lists/{direction}/{type}: get: description: |- @@ -3475,14 +4092,20 @@ paths: - url: https://api.agentmail.eu security: - BearerAuth: [] - /v0/metrics: + /v0/metrics/events: get: description: |- + Counts of email events (sent, delivered, bounced, etc.) over time for + the organization. Defaults to the last 24 hours; `start` must be within + the last 90 days, and a future `end` is clamped to now. Omit `period` + for individual event counts, or set it to sum counts into buckets of + that many seconds. + **CLI:** ```bash agentmail metrics list ``` - operationId: metrics_query + operationId: metrics_queryEvents tags: - Metrics parameters: @@ -3535,7 +4158,76 @@ paths: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' - summary: Query Metrics + summary: Query Events + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/metrics/usage: + get: + description: |- + Cumulative usage series for the organization. Each point is the running + total of the usage type at that timestamp, not the change within the + bucket. Defaults to the last 24 hours; `start` must be within the last + 90 days, and a future `end` is clamped to now. The range divided by + `period` must not exceed 1000 buckets. + operationId: metrics_queryUsage + tags: + - Metrics + parameters: + - name: usage_types + in: query + required: false + schema: + $ref: '#/components/schemas/UsageTypes' + nullable: true + - name: start + in: query + required: false + schema: + $ref: '#/components/schemas/Start' + nullable: true + - name: end + in: query + required: false + schema: + $ref: '#/components/schemas/End' + nullable: true + - name: period + in: query + required: false + schema: + $ref: '#/components/schemas/Period' + nullable: true + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/MetricLimit' + nullable: true + - name: descending + in: query + required: false + schema: + $ref: '#/components/schemas/Descending' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/QueryUsageResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + summary: Query Usage servers: - url: https://api.agentmail.to - url: https://x402.api.agentmail.to @@ -4271,6 +4963,12 @@ paths: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' + '422': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' summary: Create Inbox servers: - url: https://api.agentmail.to @@ -4615,17 +5313,96 @@ paths: description: Email address or domain. required: true schema: - type: string + type: string + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Delete List Entry + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + /v0/pods/{pod_id}/metrics/events: + get: + description: |- + Counts of email events (sent, delivered, bounced, etc.) over time for + the pod. Defaults to the last 24 hours; `start` must be within the last + 90 days, and a future `end` is clamped to now. Omit `period` for + individual event counts, or set it to sum counts into buckets of that + many seconds. + + **CLI:** + ```bash + agentmail pods:metrics query --pod-id + ``` + operationId: pods_metrics_queryEvents + tags: + - PodsMetrics + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: event_types + in: query + required: false + schema: + $ref: '#/components/schemas/MetricEventTypes' + nullable: true + - name: start + in: query + required: false + schema: + $ref: '#/components/schemas/Start' + nullable: true + - name: end + in: query + required: false + schema: + $ref: '#/components/schemas/End' + nullable: true + - name: period + in: query + required: false + schema: + $ref: '#/components/schemas/Period' + nullable: true + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/MetricLimit' + nullable: true + - name: descending + in: query + required: false + schema: + $ref: '#/components/schemas/Descending' + nullable: true responses: - '204': + '200': description: '' - '404': + content: + application/json: + schema: + $ref: '#/components/schemas/QueryMetricsResponse' + '400': description: '' content: application/json: schema: - $ref: '#/components/schemas/ErrorResponse' - summary: Delete List Entry + $ref: '#/components/schemas/ValidationErrorResponse' + summary: Query Events servers: - url: https://api.agentmail.to - url: https://x402.api.agentmail.to @@ -4633,14 +5410,17 @@ paths: - url: https://api.agentmail.eu security: - BearerAuth: [] - /v0/pods/{pod_id}/metrics: + /v0/pods/{pod_id}/metrics/usage: get: description: |- - **CLI:** - ```bash - agentmail pods:metrics query --pod-id - ``` - operationId: pods_metrics_query + Cumulative usage series for the pod. Each point is the running total of + the usage type at that timestamp, not the change within the bucket. + Pod-scoped queries carry every usage type except `pod_count`; requested + types that don't apply to the scope are ignored. Defaults to the last + 24 hours; `start` must be within the last 90 days, and a future `end` + is clamped to now. The range divided by `period` must not exceed 1000 + buckets. + operationId: pods_metrics_queryUsage tags: - PodsMetrics parameters: @@ -4649,11 +5429,11 @@ paths: required: true schema: $ref: '#/components/schemas/podsPodId' - - name: event_types + - name: usage_types in: query required: false schema: - $ref: '#/components/schemas/MetricEventTypes' + $ref: '#/components/schemas/UsageTypes' nullable: true - name: start in: query @@ -4691,14 +5471,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/QueryMetricsResponse' + $ref: '#/components/schemas/QueryUsageResponse' '400': description: '' content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' - summary: Query Metrics + summary: Query Usage servers: - url: https://api.agentmail.to - url: https://x402.api.agentmail.to @@ -5116,6 +5896,244 @@ paths: - url: https://api.agentmail.eu security: - BearerAuth: [] + /v0/pods/{pod_id}/webhooks: + get: + description: |- + **CLI:** + ```bash + agentmail pods:webhooks list --pod-id + ``` + operationId: pods_webhooks_list + tags: + - PodsWebhooks + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: limit + in: query + required: false + schema: + $ref: '#/components/schemas/Limit' + nullable: true + - name: page_token + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + nullable: true + - name: ascending + in: query + required: false + schema: + $ref: '#/components/schemas/Ascending' + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/webhooksListWebhooksResponse' + summary: List Webhooks + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + post: + description: >- + Create a webhook scoped to this pod. + + + **CLI:** + + ```bash + + agentmail pods:webhooks create --pod-id --url + https://example.com/webhook --event-type message.received + + ``` + operationId: pods_webhooks_create + tags: + - PodsWebhooks + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/webhooksWebhook' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + summary: Create Webhook + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/webhooksCreatePodWebhookRequest' + /v0/pods/{pod_id}/webhooks/{webhook_id}: + get: + description: |- + **CLI:** + ```bash + agentmail pods:webhooks get --pod-id --webhook-id + ``` + operationId: pods_webhooks_get + tags: + - PodsWebhooks + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: webhook_id + in: path + required: true + schema: + $ref: '#/components/schemas/webhooksWebhookId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/webhooksWebhook' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Get Webhook + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + patch: + description: >- + **CLI:** + + ```bash + + agentmail pods:webhooks update --pod-id --webhook-id + --add-inbox-id + + ``` + operationId: pods_webhooks_update + tags: + - PodsWebhooks + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: webhook_id + in: path + required: true + schema: + $ref: '#/components/schemas/webhooksWebhookId' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/webhooksWebhook' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationErrorResponse' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Update Webhook + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/webhooksUpdatePodWebhookRequest' + delete: + description: >- + **CLI:** + + ```bash + + agentmail pods:webhooks delete --pod-id --webhook-id + + + ``` + operationId: pods_webhooks_delete + tags: + - PodsWebhooks + parameters: + - name: pod_id + in: path + required: true + schema: + $ref: '#/components/schemas/podsPodId' + - name: webhook_id + in: path + required: true + schema: + $ref: '#/components/schemas/webhooksWebhookId' + responses: + '204': + description: '' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Delete Webhook + servers: + - url: https://api.agentmail.to + - url: https://x402.api.agentmail.to + - url: https://mpp.api.agentmail.to + - url: https://api.agentmail.eu + security: + - BearerAuth: [] /v0/threads: get: description: |- @@ -5566,14 +6584,38 @@ components: title: ErrorMessage type: string description: Error message. + ErrorCode: + title: ErrorCode + type: string + description: >- + Stable, machine-readable error code in snake_case (for example, + not_found or missing_permission). Branch on this rather than the message + text. + ErrorFix: + title: ErrorFix + type: string + description: The concrete next action that resolves the error. + ErrorDocs: + title: ErrorDocs + type: string + description: Link to the error reference entry for this code. ErrorResponse: title: ErrorResponse type: object properties: name: $ref: '#/components/schemas/ErrorName' + code: + $ref: '#/components/schemas/ErrorCode' + nullable: true message: $ref: '#/components/schemas/ErrorMessage' + fix: + $ref: '#/components/schemas/ErrorFix' + nullable: true + docs: + $ref: '#/components/schemas/ErrorDocs' + nullable: true required: - name - message @@ -5583,8 +6625,22 @@ components: properties: name: $ref: '#/components/schemas/ErrorName' + code: + $ref: '#/components/schemas/ErrorCode' + nullable: true + message: + $ref: '#/components/schemas/ErrorMessage' + nullable: true errors: - description: Validation errors. + description: >- + Validation errors. Each entry has a path and a message identifying + the invalid field. + fix: + $ref: '#/components/schemas/ErrorFix' + nullable: true + docs: + $ref: '#/components/schemas/ErrorDocs' + nullable: true required: - name - errors @@ -5701,8 +6757,12 @@ components: type: string nullable: true description: >- - Domain of address. Must be verified domain. Defaults to - `agentmail.to`. + Domain of address. Must be a verified domain, or any subdomain of a + + verified domain that has subdomains enabled (e.g., + `bot.example.com`). + + Defaults to `agentmail.to`. display_name: $ref: '#/components/schemas/inboxesDisplayName' nullable: true @@ -5876,38 +6936,101 @@ components: required: - count - webhooks - webhooksCreateWebhookRequest: - title: webhooksCreateWebhookRequest + webhooksCreateWebhookEventTypes: + title: webhooksCreateWebhookEventTypes + $ref: '#/components/schemas/EventTypes' + description: >- + Full list of event types this webhook should receive. At least one type + is required. Send every type you + + want in this array (not incremental). See [Webhooks + overview](https://docs.agentmail.to/webhooks-overview) + + for spam, blocked, and unauthenticated events and required permissions. + webhooksUpdateWebhookEventTypes: + title: webhooksUpdateWebhookEventTypes + $ref: '#/components/schemas/EventTypes' + description: >- + When you send a non-empty list, it replaces the webhook's subscribed + event types in full (the same + + "set the list" behavior as create). It is not a merge or diff: include + every event type you want after + + the update. Sending a one-element array means the webhook will only + receive that one type afterward. + + Omit this field or send an empty array to leave event types unchanged. + Clearing all types with an empty + + list is not supported. Subscribing to `message.received.spam`, + `message.received.blocked`, or + + `message.received.unauthenticated` requires the matching label + permission on the API key. + webhooksCreateInboxWebhookRequest: + title: webhooksCreateInboxWebhookRequest type: object + description: >- + Create a webhook scoped to an inbox. The inbox comes from the path, so + `inbox_ids` and `pod_ids` + + are not accepted. properties: url: $ref: '#/components/schemas/webhooksUrl' event_types: - $ref: '#/components/schemas/EventTypes' - description: >- - Full list of event types this webhook should receive. At least one - type is required. Send every type you - - want in this array (not incremental). See [Webhooks - overview](https://docs.agentmail.to/webhooks-overview) - - for spam, blocked, and unauthenticated events and required - permissions. - pod_ids: - $ref: '#/components/schemas/PodIds' - nullable: true - inbox_ids: - $ref: '#/components/schemas/InboxIds' - nullable: true + $ref: '#/components/schemas/webhooksCreateWebhookEventTypes' client_id: $ref: '#/components/schemas/webhooksClientId' nullable: true required: - url - event_types - webhooksUpdateWebhookRequest: - title: webhooksUpdateWebhookRequest + webhooksCreatePodWebhookRequest: + title: webhooksCreatePodWebhookRequest + type: object + description: >- + Create a webhook scoped to a pod. The pod comes from the path, so + `pod_ids` is not accepted. + + Optionally pass `inbox_ids` to narrow the webhook to specific inboxes + within the pod; omit to + + receive events for the whole pod. + properties: + inbox_ids: + $ref: '#/components/schemas/InboxIds' + nullable: true + allOf: + - $ref: '#/components/schemas/webhooksCreateInboxWebhookRequest' + webhooksCreateWebhookRequest: + title: webhooksCreateWebhookRequest type: object + properties: + pod_ids: + $ref: '#/components/schemas/PodIds' + nullable: true + allOf: + - $ref: '#/components/schemas/webhooksCreatePodWebhookRequest' + webhooksUpdateInboxWebhookRequest: + title: webhooksUpdateInboxWebhookRequest + type: object + description: >- + Update an inbox-scoped webhook. It is fixed to its inbox, so only + `event_types` can change. + properties: + event_types: + $ref: '#/components/schemas/webhooksUpdateWebhookEventTypes' + nullable: true + webhooksUpdatePodWebhookRequest: + title: webhooksUpdatePodWebhookRequest + type: object + description: >- + Update a pod-scoped webhook. You can adjust which inboxes within the pod + it listens to and replace + + its `event_types`, but not the pod scope itself. properties: add_inbox_ids: $ref: '#/components/schemas/InboxIds' @@ -5917,6 +7040,12 @@ components: $ref: '#/components/schemas/InboxIds' nullable: true description: Inbox IDs to unsubscribe from the webhook. + allOf: + - $ref: '#/components/schemas/webhooksUpdateInboxWebhookRequest' + webhooksUpdateWebhookRequest: + title: webhooksUpdateWebhookRequest + type: object + properties: add_pod_ids: $ref: '#/components/schemas/PodIds' nullable: true @@ -5925,27 +7054,8 @@ components: $ref: '#/components/schemas/PodIds' nullable: true description: Pod IDs to unsubscribe from the webhook. - event_types: - $ref: '#/components/schemas/EventTypes' - nullable: true - description: >- - When you send a non-empty list, it replaces the webhook's subscribed - event types in full (the same - - "set the list" behavior as create). It is not a merge or diff: - include every event type you want after - - the update. Sending a one-element array means the webhook will only - receive that one type afterward. - - Omit this field or send an empty array to leave event types - unchanged. Clearing all types with an empty - - list is not supported. Subscribing to `message.received.spam`, - `message.received.blocked`, or - - `message.received.unauthenticated` requires the matching label - permission on the API key. + allOf: + - $ref: '#/components/schemas/webhooksUpdatePodWebhookRequest' AgentSignupRequest: title: AgentSignupRequest type: object @@ -6502,6 +7612,14 @@ components: title: FeedbackEnabled type: boolean description: Bounce and complaint notifications are sent to your inboxes. + SubdomainsEnabled: + title: SubdomainsEnabled + type: boolean + description: >- + Allow inboxes on any subdomain of this domain. Adds a required wildcard + MX + + record (`*.`) to `records`. ClientId: title: ClientId type: string @@ -6521,11 +7639,15 @@ components: $ref: '#/components/schemas/Status' feedback_enabled: $ref: '#/components/schemas/FeedbackEnabled' + subdomains_enabled: + $ref: '#/components/schemas/SubdomainsEnabled' records: type: array items: $ref: '#/components/schemas/VerificationRecord' - description: A list of DNS records required to verify the domain. + description: |- + A list of DNS records required to verify the domain. Includes a + wildcard MX record (`*.`) when `subdomains_enabled` is true. client_id: $ref: '#/components/schemas/ClientId' nullable: true @@ -6542,6 +7664,7 @@ components: - domain - status - feedback_enabled + - subdomains_enabled - records - updated_at - created_at @@ -6558,6 +7681,8 @@ components: $ref: '#/components/schemas/DomainName' feedback_enabled: $ref: '#/components/schemas/FeedbackEnabled' + subdomains_enabled: + $ref: '#/components/schemas/SubdomainsEnabled' client_id: $ref: '#/components/schemas/ClientId' nullable: true @@ -6573,6 +7698,7 @@ components: - domain_id - domain - feedback_enabled + - subdomains_enabled - updated_at - created_at ListDomainsResponse: @@ -6603,16 +7729,33 @@ components: $ref: '#/components/schemas/DomainName' feedback_enabled: $ref: '#/components/schemas/FeedbackEnabled' + nullable: true + subdomains_enabled: + $ref: '#/components/schemas/SubdomainsEnabled' + nullable: true required: - domain - - feedback_enabled UpdateDomainRequest: title: UpdateDomainRequest type: object + description: >- + Provide at least one of `feedback_enabled` or `subdomains_enabled`. + Omitted + + fields are left unchanged; an empty body is rejected. Enabling + + `subdomains_enabled` on a verified domain returns it to `PENDING` until + the + + newly-required wildcard MX record (`*.`) is published and + verified. properties: feedback_enabled: $ref: '#/components/schemas/FeedbackEnabled' nullable: true + subdomains_enabled: + $ref: '#/components/schemas/SubdomainsEnabled' + nullable: true DraftId: title: DraftId type: string @@ -6685,6 +7828,14 @@ components: title: DraftInReplyTo type: string description: ID of message being replied to. + DraftForwardOf: + title: DraftForwardOf + type: string + description: ID of message being forwarded. + DraftReplyAll: + title: DraftReplyAll + type: boolean + description: Reply to all recipients of the original message. DraftSendStatus: title: DraftSendStatus type: string @@ -6734,6 +7885,9 @@ components: in_reply_to: $ref: '#/components/schemas/DraftInReplyTo' nullable: true + forward_of: + $ref: '#/components/schemas/DraftForwardOf' + nullable: true send_status: $ref: '#/components/schemas/DraftSendStatus' nullable: true @@ -6790,6 +7944,9 @@ components: in_reply_to: $ref: '#/components/schemas/DraftInReplyTo' nullable: true + forward_of: + $ref: '#/components/schemas/DraftForwardOf' + nullable: true references: type: array items: @@ -6905,6 +8062,139 @@ components: send_at: $ref: '#/components/schemas/DraftSendAt' nullable: true + CreateDraftReplyRequest: + title: CreateDraftReplyRequest + type: object + description: |- + Body for creating a draft that replies to a message. `in_reply_to`, + `references`, and the subject are derived from the source message. Set + `reply_all` to address the whole thread (you cannot then also pass `to`, + `cc`, or `bcc`). + properties: + labels: + $ref: '#/components/schemas/DraftLabels' + nullable: true + reply_to: + $ref: '#/components/schemas/DraftReplyTo' + nullable: true + to: + $ref: '#/components/schemas/DraftTo' + nullable: true + cc: + $ref: '#/components/schemas/DraftCc' + nullable: true + bcc: + $ref: '#/components/schemas/DraftBcc' + nullable: true + reply_all: + $ref: '#/components/schemas/DraftReplyAll' + nullable: true + subject: + $ref: '#/components/schemas/DraftSubject' + nullable: true + text: + $ref: '#/components/schemas/DraftText' + nullable: true + html: + $ref: '#/components/schemas/DraftHtml' + nullable: true + attachments: + type: array + items: + $ref: '#/components/schemas/SendAttachment' + nullable: true + description: Attachments to include in draft. + send_at: + $ref: '#/components/schemas/DraftSendAt' + nullable: true + client_id: + $ref: '#/components/schemas/DraftClientId' + nullable: true + CreateDraftReplyAllRequest: + title: CreateDraftReplyAllRequest + type: object + description: |- + Body for creating a draft that replies to the whole thread. Recipients, + `in_reply_to`, `references`, and the subject are always derived from the + source message, so `to`, `cc`, and `bcc` are not accepted. + properties: + labels: + $ref: '#/components/schemas/DraftLabels' + nullable: true + reply_to: + $ref: '#/components/schemas/DraftReplyTo' + nullable: true + subject: + $ref: '#/components/schemas/DraftSubject' + nullable: true + text: + $ref: '#/components/schemas/DraftText' + nullable: true + html: + $ref: '#/components/schemas/DraftHtml' + nullable: true + attachments: + type: array + items: + $ref: '#/components/schemas/SendAttachment' + nullable: true + description: Attachments to include in draft. + send_at: + $ref: '#/components/schemas/DraftSendAt' + nullable: true + client_id: + $ref: '#/components/schemas/DraftClientId' + nullable: true + CreateDraftForwardRequest: + title: CreateDraftForwardRequest + type: object + description: >- + Body for creating a draft that forwards a message. The subject and + + threading are derived from the source message, whose body and + attachments + + are merged in at send time. Recipients are optional, so a forward draft + can + + be saved without an address and addressed later. + properties: + labels: + $ref: '#/components/schemas/DraftLabels' + nullable: true + reply_to: + $ref: '#/components/schemas/DraftReplyTo' + nullable: true + to: + $ref: '#/components/schemas/DraftTo' + nullable: true + cc: + $ref: '#/components/schemas/DraftCc' + nullable: true + bcc: + $ref: '#/components/schemas/DraftBcc' + nullable: true + subject: + $ref: '#/components/schemas/DraftSubject' + nullable: true + text: + $ref: '#/components/schemas/DraftText' + nullable: true + html: + $ref: '#/components/schemas/DraftHtml' + nullable: true + attachments: + type: array + items: + $ref: '#/components/schemas/SendAttachment' + nullable: true + description: Attachments to include in draft. + send_at: + $ref: '#/components/schemas/DraftSendAt' + nullable: true + client_id: + $ref: '#/components/schemas/DraftClientId' + nullable: true EventType: title: EventType type: string @@ -7811,6 +9101,55 @@ components: - limit - count - messages + BatchUpdateMessagesMessageIds: + title: BatchUpdateMessagesMessageIds + type: array + items: + $ref: '#/components/schemas/MessageId' + description: |- + IDs of messages to update. Maximum 50 ids per request. Duplicates are + rejected with a validation error. IDs not found in the inbox (including + cross-inbox or permission-restricted) are silently excluded from the + update; callers detect exclusions by comparing `count` against `limit`. + BatchUpdateMessagesRequest: + title: BatchUpdateMessagesRequest + type: object + properties: + message_ids: + $ref: '#/components/schemas/BatchUpdateMessagesMessageIds' + add_labels: + $ref: '#/components/schemas/UpdateMessageLabels' + nullable: true + description: Label or labels to add to every message. + remove_labels: + $ref: '#/components/schemas/UpdateMessageLabels' + nullable: true + description: Label or labels to remove from every message. + required: + - message_ids + BatchUpdateMessagesResponse: + title: BatchUpdateMessagesResponse + type: object + properties: + limit: + $ref: '#/components/schemas/Limit' + count: + $ref: '#/components/schemas/Count' + updates: + type: array + items: + $ref: '#/components/schemas/UpdateMessageResponse' + description: >- + Updated messages with their new labels. Order matches `message_ids` + + in the request. Excluded ids are omitted, so `count` may be less + than + + `limit`. + required: + - limit + - count + - updates RawMessageResponse: title: RawMessageResponse type: object @@ -8009,13 +9348,16 @@ components: title: MetricEventType type: string enum: + - message.received + - message.received.spam + - message.received.blocked + - message.received.unauthenticated - message.sent - message.delivered - message.bounced - - message.delayed - - message.rejected - message.complained - - message.received + - message.rejected + - domain.verified description: Type of metric event. MetricEventTypes: title: MetricEventTypes @@ -8035,8 +9377,10 @@ components: description: End timestamp for the query. Period: title: Period - type: string - description: Period in number of seconds for the query. + type: integer + description: >- + Size of each time bucket as a whole number of seconds, between 1 and + 86400. MetricLimit: title: MetricLimit type: integer @@ -8067,6 +9411,54 @@ components: items: $ref: '#/components/schemas/MetricBucket' description: Metrics grouped by event type. + UsageType: + title: UsageType + type: string + enum: + - storage_bytes + - message_count + - thread_count + - inbox_count + - pod_count + - domain_count + description: >- + Type of usage metric. Inbox-scoped queries carry `storage_bytes`, + + `message_count`, and `thread_count`; pod-scoped queries add + `inbox_count` + + and `domain_count`; organization-scoped queries add `pod_count`. + UsageTypes: + title: UsageTypes + type: array + items: + $ref: '#/components/schemas/UsageType' + description: >- + List of usage metric types to query. Omit to query every type valid for + the scope. + UsagePoint: + title: UsagePoint + type: object + properties: + timestamp: + type: string + format: date-time + description: Timestamp of the point. + value: + type: integer + format: int64 + description: Cumulative value of the usage metric at the timestamp. + required: + - timestamp + - value + QueryUsageResponse: + title: QueryUsageResponse + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/UsagePoint' + description: Cumulative usage series grouped by usage type. Organization: title: Organization type: object From 7a1dc898ea7d3eb909f3dc8b2e41634a44740e71 Mon Sep 17 00:00:00 2001 From: duharry0915 Date: Sun, 12 Jul 2026 18:51:56 -0700 Subject: [PATCH 17/18] chore(cli): annotate endpoints added since June regen Co-Authored-By: Claude Opus 4.8 (1M context) --- fern/apis/cli/openapi-overrides.yml | 112 ++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) diff --git a/fern/apis/cli/openapi-overrides.yml b/fern/apis/cli/openapi-overrides.yml index 463c932f..3e9874ab 100644 --- a/fern/apis/cli/openapi-overrides.yml +++ b/fern/apis/cli/openapi-overrides.yml @@ -565,3 +565,115 @@ paths: x-fern-sdk-group-name: - threads x-fern-sdk-method-name: get-attachment + /v0/inboxes/{inbox_id}/messages/batch-update: + post: + x-fern-sdk-group-name: + - inboxes + - messages + x-fern-sdk-method-name: batch-update + /v0/inboxes/{inbox_id}/messages/{message_id}/draft-reply: + post: + x-fern-sdk-group-name: + - inboxes + - messages + x-fern-sdk-method-name: draft-reply + /v0/inboxes/{inbox_id}/messages/{message_id}/draft-reply-all: + post: + x-fern-sdk-group-name: + - inboxes + - messages + x-fern-sdk-method-name: draft-reply-all + /v0/inboxes/{inbox_id}/messages/{message_id}/draft-forward: + post: + x-fern-sdk-group-name: + - inboxes + - messages + x-fern-sdk-method-name: draft-forward + /v0/inboxes/{inbox_id}/metrics/events: + get: + x-fern-sdk-group-name: + - inboxes + - metrics + x-fern-sdk-method-name: query-events + /v0/inboxes/{inbox_id}/metrics/usage: + get: + x-fern-sdk-group-name: + - inboxes + - metrics + x-fern-sdk-method-name: query-usage + /v0/inboxes/{inbox_id}/webhooks: + get: + x-fern-sdk-group-name: + - inboxes + - webhooks + x-fern-sdk-method-name: list + post: + x-fern-sdk-group-name: + - inboxes + - webhooks + x-fern-sdk-method-name: create + /v0/inboxes/{inbox_id}/webhooks/{webhook_id}: + get: + x-fern-sdk-group-name: + - inboxes + - webhooks + x-fern-sdk-method-name: get + patch: + x-fern-sdk-group-name: + - inboxes + - webhooks + x-fern-sdk-method-name: update + delete: + x-fern-sdk-group-name: + - inboxes + - webhooks + x-fern-sdk-method-name: delete + /v0/metrics/events: + get: + x-fern-sdk-group-name: + - metrics + x-fern-sdk-method-name: query-events + /v0/metrics/usage: + get: + x-fern-sdk-group-name: + - metrics + x-fern-sdk-method-name: query-usage + /v0/pods/{pod_id}/metrics/events: + get: + x-fern-sdk-group-name: + - pods + - metrics + x-fern-sdk-method-name: query-events + /v0/pods/{pod_id}/metrics/usage: + get: + x-fern-sdk-group-name: + - pods + - metrics + x-fern-sdk-method-name: query-usage + /v0/pods/{pod_id}/webhooks: + get: + x-fern-sdk-group-name: + - pods + - webhooks + x-fern-sdk-method-name: list + post: + x-fern-sdk-group-name: + - pods + - webhooks + x-fern-sdk-method-name: create + /v0/pods/{pod_id}/webhooks/{webhook_id}: + get: + x-fern-sdk-group-name: + - pods + - webhooks + x-fern-sdk-method-name: get + patch: + x-fern-sdk-group-name: + - pods + - webhooks + x-fern-sdk-method-name: update + delete: + x-fern-sdk-group-name: + - pods + - webhooks + x-fern-sdk-method-name: delete From 26f6e1702ae68dcfa75e0edb9fc1a3b0703834cc Mon Sep 17 00:00:00 2001 From: duharry0915 Date: Wed, 22 Jul 2026 19:39:42 -0700 Subject: [PATCH 18/18] chore(cli): point output at agentmail-to/agentmail-cli, prune orphaned metrics overrides --- fern/apis/cli/generators.yml | 4 ++-- fern/apis/cli/openapi-overrides.yml | 17 ----------------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/fern/apis/cli/generators.yml b/fern/apis/cli/generators.yml index d0bc1b3a..6429df38 100644 --- a/fern/apis/cli/generators.yml +++ b/fern/apis/cli/generators.yml @@ -14,8 +14,8 @@ groups: binaryName: agentmail output: location: npm - package-name: "@fern-demo/agentmail-cli" + package-name: agentmail-cli token: OIDC github: - repository: fern-demo/agentmail-cli + repository: agentmail-to/agentmail-cli mode: pull-request diff --git a/fern/apis/cli/openapi-overrides.yml b/fern/apis/cli/openapi-overrides.yml index 3e9874ab..fd7539d2 100644 --- a/fern/apis/cli/openapi-overrides.yml +++ b/fern/apis/cli/openapi-overrides.yml @@ -168,12 +168,6 @@ paths: - inboxes - messages x-fern-sdk-method-name: forward - /v0/inboxes/{inbox_id}/metrics: - get: - x-fern-sdk-group-name: - - inboxes - - metrics - x-fern-sdk-method-name: query /v0/inboxes/{inbox_id}/threads: get: x-fern-sdk-group-name: @@ -331,12 +325,6 @@ paths: - pods - lists x-fern-sdk-method-name: delete - /v0/pods/{pod_id}/metrics: - get: - x-fern-sdk-group-name: - - pods - - metrics - x-fern-sdk-method-name: query /v0/pods/{pod_id}/threads: get: x-fern-sdk-group-name: @@ -527,11 +515,6 @@ paths: x-fern-sdk-group-name: - lists x-fern-sdk-method-name: delete - /v0/metrics: - get: - x-fern-sdk-group-name: - - metrics - x-fern-sdk-method-name: query /v0/organizations: get: x-fern-sdk-group-name: