---
title: "Connect Flexmail to ChatGPT: Manage Delivery and Domains"
slug: connect-flexmail-to-chatgpt-manage-delivery-and-domains
date: 2026-10-01
author: Riya Sethi
categories: ["AI & Agents"]
excerpt: "Learn how to connect Flexmail to ChatGPT using Truto's managed MCP server. Automate domain verification, trace email delivery, and manage sender identities."
tldr: "Connect Flexmail to ChatGPT in minutes using Truto's auto-generated MCP server. Give your AI agents secure, authenticated access to manage sending domains, trace bounced emails, and orchestrate transactional messaging without writing custom JSON-RPC boilerplate."
canonical: https://truto.one/blog/connect-flexmail-to-chatgpt-manage-delivery-and-domains/
---

# Connect Flexmail to ChatGPT: Manage Delivery and Domains

**Flexmail in ChatGPT, in about a minute.** The best way to connect Flexmail to ChatGPT is Elaichi: connect Flexmail to Elaichi once, then add Elaichi to ChatGPT as a connector. Two steps, about a minute, with a 14-day free trial and no credit card required.

1. **Start your free trial.** Create your Elaichi account. 14 days free, no credit card required.
2. **Connect Flexmail.** Connect Flexmail once in Elaichi. ChatGPT never gets more access than you have.
3. **Add Elaichi to ChatGPT.** In ChatGPT, open Plugins, press +, and paste https://api.elaichi.ai/mcp into Server URL. Sign in and approve.

[Start free on Elaichi, 14 days, no credit card required](https://app.elaichi.ai/signup?utm_source=truto.one&utm_medium=referral&utm_campaign=launchpad&utm_content=post_markdown&utm_term=flexmail) · [Flexmail on Elaichi](https://elaichi.ai/connectors/flexmail/?utm_source=truto.one&utm_medium=referral&utm_campaign=launchpad&utm_content=post_markdown&utm_term=flexmail)

*Building Flexmail into your own product? The guide below is for you.*

---

If you want to connect Flexmail to ChatGPT so your AI agents can provision sending domains, audit SPF/DMARC alignment, trace email bounces, and orchestrate transactional messaging, you need a [Model Context Protocol (MCP) server](https://truto.one/blog/what-is-mcp-model-context-protocol-the-2026-guide-for-saas-pms/). If your team uses Claude, check out our guide on [connecting Flexmail to Claude](https://truto.one/connect-flexmail-to-claude-send-emails-and-track-performance/) or explore our broader architectural overview on [connecting Flexmail to AI Agents](https://truto.one/connect-flexmail-to-ai-agents-automate-email-lifecycles/).

Giving a Large Language Model (LLM) read and write access to an email delivery infrastructure platform like Flexmail is a high-stakes engineering challenge. You either spend weeks [building, hosting, and maintaining a custom MCP server](https://truto.one/blog/how-to-build-mcp-servers-for-ai-agents-2026-hands-on-architecture-guide/) to translate LLM JSON arguments into Flexmail's specific payload structures, or you use a managed infrastructure layer.

This guide breaks down exactly how to use Truto to generate a secure, authenticated MCP server for Flexmail, connect it natively to ChatGPT, and execute complex domain administration and message tracking workflows using natural language.

> Stop writing boilerplate API integration code. Let Truto generate secure, managed MCP servers for your AI agents in seconds.
>
> [Talk to us](https://truto.one/book-a-demo/)

## The Engineering Reality of the Flexmail API

A custom MCP server is a self-hosted integration layer. While the [open MCP standard](https://truto.one/blog/what-is-mcp-model-context-protocol-the-2026-guide-for-saas-pms/) provides a predictable way for models to discover tools, implementing it against Flexmail's API requires dealing with several domain-specific integration hurdles. 

If you decide to build a custom MCP server for Flexmail, you own the entire API lifecycle. Here are the specific integration challenges that break standard CRUD assumptions when working with Flexmail:

### Asynchronous Verification States
Unlike standard SaaS APIs where creating a resource makes it immediately available, Flexmail's domain and sender resources rely on asynchronous, out-of-band verification. When you create a sender identity, the API returns a `201 Created` with a new ID. However, this sender is completely unusable until a human clicks the verification link emailed to that address. Your MCP tools must be designed to poll and verify the `verified` boolean status before allowing an AI agent to attempt to send messages using that identity, otherwise the agent will encounter confusing runtime errors.

### Strict Message Payload Composition
Flexmail enforces strict composition rules for its `/messages` endpoint. HTML content is strictly mandatory, while plain-text is optional. When agents decide to attach files, they must handle raw Base64 encoding. Because Base64 encoding inflates file sizes by approximately 33%, an AI agent attempting to attach 16MB of raw binary data will breach Flexmail's strict 20MB total payload limit, resulting in a `413 Payload Too Large` error. Custom MCP servers must implement logic to accurately calculate Base64 overhead before passing the payload upstream.

### Brittle Webhook Lifecycles
Webhook management in Flexmail is unforgiving. If a webhook destination URL fails 10 consecutive times, Flexmail hard-disables the webhook. If you expose webhook management to ChatGPT, the agent needs to explicitly audit the `enabled` status of webhooks periodically, rather than assuming a previously created webhook is still active.

### Explicit 429 Rate Limit Pass-Through
When orchestrating high-volume email workflows, rate limits are a mathematical certainty. It is crucial to understand that **Truto does not retry, throttle, or apply backoff on rate limit errors.** When the upstream Flexmail API returns an HTTP 429 (Too Many Requests), Truto passes that exact error back to the caller. Truto normalizes the upstream rate limit information into standardized headers (`ratelimit-limit`, `ratelimit-remaining`, `ratelimit-reset`) per the IETF specification. The caller (whether that is ChatGPT or a custom agent orchestrator) is strictly responsible for interpreting these headers and executing retry and backoff logic.

## How to Generate a Flexmail MCP Server

Truto derives MCP tools dynamically from the underlying Flexmail API documentation and integration configurations. Tools are never cached or pre-built. A tool only appears in the MCP server if it has a corresponding documentation entry in Truto, ensuring that LLMs only see well-documented, curated endpoints.

There are two ways to generate a Flexmail MCP server in Truto: via the UI, or programmatically via the API.

### Option 1: Via the Truto UI

For IT admins and operators who need to provision access quickly without writing code:

1. Log into your Truto dashboard.
2. Navigate to the **Integrated Accounts** page and select your connected Flexmail account.
3. Click the **MCP Servers** tab.
4. Click **Create MCP Server**.
5. Select your desired configuration (e.g., restrict to `read` methods, filter by specific tags like `domains` or `messages`, and set an expiration date).
6. Click **Create** and immediately copy the generated MCP server URL. (You will only see the raw URL once).

### Option 2: Via the Truto API

For platform engineers who want to dynamically provision MCP servers for their own end-users, you can create a server via a single API call. This provisions a dedicated JSON-RPC endpoint backed by a highly available distributed key-value store.

```bash
curl -X POST https://api.truto.one/integrated-account/<flexmail_integrated_account_id>/mcp \
  -H "Authorization: Bearer $TRUTO_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "ChatGPT Delivery Admin Server",
    "config": {
      "methods": ["read", "write"],
      "tags": ["domains", "messages", "stats"]
    },
    "expires_at": "2026-12-31T23:59:59Z"
  }'
```

The Truto API will evaluate the underlying Flexmail integration. If the integration is AI-ready, it generates a cryptographic token, hashes it, stores the metadata, and returns a self-contained URL:

```json
{
  "id": "mcp_8a9b0c1d",
  "name": "ChatGPT Delivery Admin Server",
  "config": { "methods": ["read", "write"], "tags": ["domains", "messages", "stats"] },
  "expires_at": "2026-12-31T23:59:59.000Z",
  "url": "https://api.truto.one/mcp/t_5f7g8h9i0j1k2l3m4n5o6p"
}
```

This URL is all you need. It contains the routing logic and authentication required to execute Flexmail tools.

## How to Connect the Flexmail MCP Server to ChatGPT

Once you have your Truto MCP server URL, you must register it with your ChatGPT environment. You can do this through the ChatGPT user interface, or if you are running local agents or testing with an open-source MCP host, via a standard configuration file.

### Option A: Via the ChatGPT UI

If you have a ChatGPT Pro, Plus, Business, Enterprise, or Education account, you can add custom connectors directly in the browser.

1. Open ChatGPT and click your profile picture in the bottom left, then select **Settings**.
2. Navigate to **Apps** -> **Advanced settings**.
3. Toggle on **Developer mode** (MCP support requires this feature flag).
4. Under the newly visible **MCP servers / Custom connectors** section, click to add a new server.
5. Set the **Name** to something descriptive (e.g., "Flexmail (Truto)").
6. Paste your Truto MCP URL into the **Server URL** field.
7. Click **Save**.

ChatGPT will immediately ping the server's `initialize` endpoint, perform the JSON-RPC handshake, and populate its internal context window with the available Flexmail tools.

### Option B: Via Manual Config File (Local/SSE)

If you are wrapping ChatGPT in a custom local agent environment (or using an MCP inspector), you can connect to the Truto remote MCP server using the official Server-Sent Events (SSE) transport adapter.

Create an `mcp_config.json` file:

```json
{
  "mcpServers": {
    "flexmail_truto": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-sse",
        "--url",
        "https://api.truto.one/mcp/t_5f7g8h9i0j1k2l3m4n5o6p"
      ]
    }
  }
}
```

This instructs the standard MCP host architecture to route local JSON-RPC calls over HTTP SSE to Truto's proxy execution layer.

## Hero Tools for Flexmail

When ChatGPT issues a `tools/list` request, Truto dynamically derives tool schemas from the Flexmail integration documentation. The LLM sees a flattened input namespace, combining both query and body parameters. 

Here are the highest-leverage Flexmail tools your agents will use.

### `create_a_flexmail_sending_domain`

Registers a new sending domain in Flexmail. This is the first step in setting up infrastructure for a new brand or geographic region. It can also configure a custom return-path for strict SPF alignment.

*Contextual Note:* This tool returns a domain ID, but the domain will not be fully authenticated until DNS records are verified.

> "Register a new sending domain for 'eu.acmecorp.com' in Flexmail. Enable a custom return path using 'bounces.eu.acmecorp.com'."

### `get_single_flexmail_sending_domain_by_id`

Fetches the complete details of a sending domain, including the critical validation status and exact DNS records required for SPF, DKIM, and DMARC passing.

*Contextual Note:* Use this tool to retrieve the exact TXT and CNAME values that need to be handed off to your DNS administrator or AWS Route 53 agent.

> "Check the status of domain ID 84729. Are the SPF and DKIM records authenticated? If not, extract the required DNS TXT records so I can send them to IT."

### `create_a_flexmail_sender`

Adds a specific sender identity (the "From" email address recipients will see) to a verified sending domain.

*Contextual Note:* The email address must belong to an already registered sending domain. Remind users that they must click the confirmation link sent to this inbox before the sender can be utilized.

> "Create a new sender identity for 'support@eu.acmecorp.com'. Once created, remind me to check that inbox for the Flexmail verification link."

### `create_a_flexmail_message`

Sends a transactional email message to a single recipient. Supports metadata tagging, open/link tracking, and attachment handling.

*Contextual Note:* HTML content is mandatory. The API expects the `from` field to contain the verified sender details.

> "Draft and send a welcome email to 'newuser@example.com'. Use the sender 'welcome@acmecorp.com'. The subject should be 'Welcome Aboard!', and generate a friendly HTML body introducing our service."

### `get_single_flexmail_message_by_id`

Retrieves full lifecycle details for a single message, returning every registered event (delivery, soft bounce, hard bounce, opens, clicks).

*Contextual Note:* This is the ultimate debugging tool for transactional email. It reveals exactly where a message failed in the delivery chain.

> "Look up the status of message ID 'msg_99482'. Did it hard bounce? If so, tell me the exact timestamp and any rejection metadata provided."

### `list_all_flexmail_stats`

Fetches global, aggregated message statistics for the account, providing a macro view of sends, deliveries, rejections, unique opens, and unique clicks.

*Contextual Note:* These statistics update at regular intervals rather than in real-time. For real-time data, webhook events are required.

> "Pull the global Flexmail stats for this month. Calculate our delivery rate and unique open rate, and let me know if our bounce rate exceeds 2%."

Explore the complete tool inventory and JSON schema definitions on the [Flexmail integration page](https://truto.one/integrations/detail/flexmail).

## Workflows in Action

Exposing individual endpoints to an LLM is useful, but the real power of the MCP server lies in [autonomous, multi-step orchestration](https://truto.one/blog/connect-flexmail-to-ai-agents-automate-email-lifecycles/). Because Truto's MCP router dynamically maps flat JSON arguments to the correct query and body schemas, ChatGPT can chain complex Flexmail operations effortlessly.

### Scenario 1: Auditing Domain Authentication and DNS Records

A DevOps engineer needs to verify why emails from a newly provisioned domain are landing in spam.

> "Find the sending domain for 'marketing.acmecorp.com'. Check its authentication status. If SPF or DKIM is failing, give me the exact DNS records that need to be updated."

**How the agent executes this:**

1. **`list_all_flexmail_sending_domains`**: The agent calls this tool to retrieve a list of all domains and scans the array for the `id` matching `marketing.acmecorp.com`.
2. **`get_single_flexmail_sending_domain_by_id`**: Using the extracted ID, the agent requests the deep domain payload.
3. **Analysis**: The agent parses the `authenticated` and `aligned` booleans. Seeing that DKIM is unverified, it reads the expected DNS configuration from the JSON response and formats it into a clear, copy-pasteable markdown table for the engineer.

```mermaid
sequenceDiagram
    participant User as User
    participant ChatGPT as ChatGPT (Client)
    participant Truto as Truto MCP Server
    participant Flexmail as Flexmail API
    
    User->>ChatGPT: "Audit marketing.acmecorp.com DNS"
    ChatGPT->>Truto: call tools/call (list_all_flexmail_sending_domains)
    Truto->>Flexmail: GET /sending-domains
    Flexmail-->>Truto: JSON Array of Domains
    Truto-->>ChatGPT: Domain list
    ChatGPT->>Truto: call tools/call (get_single_flexmail_sending_domain_by_id)<br>id: "10482"
    Truto->>Flexmail: GET /sending-domains/10482
    Flexmail-->>Truto: Domain details with DNS records
    Truto-->>ChatGPT: Domain payload
    ChatGPT-->>User: "DKIM is failing. Please add this CNAME..."
```

### Scenario 2: Tracing Deliverability Failures

A support agent is investigating a customer complaint that a password reset email was never received.

> "Find all messages sent to 'jane.doe@example.com' over the last 24 hours. Check if any of them bounced. If they did, pull the full details of the most recent bounced message so we can see the exact error code."

**How the agent executes this:**

1. **`list_all_flexmail_messages`**: The agent queries the message log, filtering by `recipient: jane.doe@example.com` and sorting by recent dates.
2. **Analysis**: The agent scans the response for the `hard_bounced_at` or `soft_bounced_at` timestamps on the returned message objects.
3. **`get_single_flexmail_message_by_id`**: The agent takes the `message_id` of the failed email and pulls the deep lifecycle record, reading the `events` array to find the exact SMTP diagnostic code returned by the receiving mail server.
4. **Response**: The agent informs the support team that the user's mail server rejected the message with a `550 User Unknown` error, indicating a typo in the customer's email address.

## Security and Access Control

When connecting ChatGPT to a production Flexmail environment, security is paramount. The Truto MCP architecture provides four layers of strict access control, ensuring your LLM only touches what you explicitly permit.

*   **Method Filtering:** During MCP server creation, you can strictly limit the server to `read` operations (e.g., `list`, `get`), completely preventing the LLM from creating messages, webhooks, or deleting sender identities.
*   **Tag Filtering:** Restrict the server to specific functional areas. By passing `tags: ["messages"]`, you ensure the LLM can audit emails but cannot touch global account settings or domain DNS records.
*   **Expiration Controls (`expires_at`):** You can set a Unix timestamp for server expiration. Once expired, a distributed alarm automatically purges the cryptographic token from the KV store, instantly terminating ChatGPT's access.
*   **API Token Authentication (`require_api_token_auth`):** For zero-trust environments, you can enable this flag. It forces the MCP client to pass a valid Truto API token in the Authorization header. Possession of the MCP URL alone is no longer sufficient to execute tools.

## Stop Writing Boilerplate Integration Code

Connecting Flexmail to ChatGPT manually means writing thousands of lines of TypeScript to manage JSON-RPC handshakes, mapping LLM arguments into Flexmail's specific query and body schemas, and handling the infrastructure to parse dynamic responses. Every time you need a new tool, you have to redeploy your custom server.

Truto's documentation-driven MCP architecture eliminates this entire class of engineering debt. By dynamically generating tools directly from integration schemas and handling the protocol translation at the edge, you can connect your AI agents to Flexmail in minutes, not weeks. 

Build the workflows, not the plumbing.
