> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to Mailtrap

The Mailtrap connector lets your AI agent act in each user's Mailtrap account. Each user connects their own Mailtrap access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 92 tools.

**Authentication:** Bearer Token
**Categories:** Communication, Developer Tools
**Tools:** 92: 44 read, 35 write, 13 destructive
**Users sign in with:** Access token
**Built by:** Scalekit connector
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=MAILTRAP)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the Mailtrap connection

   In **AgentKit > Connections**, create a Mailtrap connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

   **Console steps with screenshots:**

   Register your Mailtrap API token with Scalekit so it can authenticate and proxy email requests on behalf of your users. Mailtrap uses Bearer Token authentication.

   1. ### Get a Mailtrap API token

      - Sign in to [mailtrap.io](https://mailtrap.io) and go to **Settings** → **API Tokens**.
      - Click **Add Token** and give it a name (for example, `Agent Connect`).
      - Copy the generated token.

      > Image: Mailtrap API Tokens settings page showing an existing token and the Add Token button

   2. ### Create a connection in Scalekit

      - In the [Scalekit dashboard](https://app.scalekit.com), go to **AgentKit** → **Connections** → **Create Connection**.
      - Search for **Mailtrap** and click **Create**.
      - Note the **Connection name** — use this as `connection_name` in your code (e.g., `mailtrap`).

   3. ### Add a connected account

      Connected accounts link a specific user identifier in your system to a Mailtrap API token. Add one in the dashboard to test. In production, each user adds their own through the authorization link: they enter their credentials on the page it opens.

      **In the dashboard, to test**

      - Open the connection and click the **Connected Accounts** tab → **Add account**.
      - Fill in **Your User's ID** and **API Token**, then click **Save**.

      **From your backend, if your app already has the credentials**

      For example, when users enter them on a settings page in your app:

        **Node.js**

        ```ts
        import { ConnectorStatus } from '@scalekit-sdk/node'

        const authorizationDetails = {
          details: {
            case: 'staticAuth',
            value: { details: { token: 'your-mailtrap-api-token' } },
          },
        }

        let { connectedAccount } = await scalekit.actions.upsertConnectedAccount({
          connectionName: 'mailtrap',
          identifier: 'user_123',
          authorizationDetails,
        })

        // Make sure the account is ACTIVE before the first tool call.
        if (connectedAccount?.status !== ConnectorStatus.ACTIVE) {
          ;({ connectedAccount } = await scalekit.actions.upsertConnectedAccount({
            connectionName: 'mailtrap',
            identifier: 'user_123',
            authorizationDetails,
          }))
        }
        ```

        **Python**

        ```python
        authorization_details = {"static_auth": {"token": "your-mailtrap-api-token"}}

        response = scalekit_client.actions.upsert_connected_account(
            connection_name="mailtrap",
            identifier="user_123",
            authorization_details=authorization_details,
        )

        # Make sure the account is ACTIVE before the first tool call.
        if response.connected_account.status != "ACTIVE":
            response = scalekit_client.actions.upsert_connected_account(
                connection_name="mailtrap",
                identifier="user_123",
                authorization_details=authorization_details,
            )
        ```

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   import { ScalekitClient } from '@scalekit-sdk/node'
   import 'dotenv/config'
   import { createInterface } from 'node:readline/promises'

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   )
   const actions = scalekit.actions

   const connector = 'mailtrap'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize Mailtrap:', link)
   const rl = createInterface({ input: process.stdin, output: process.stdout })
   await rl.question('Press Enter after authorizing...')
   rl.close()

   // Make your first call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'mailtrap_get_accounts',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "mailtrap"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize Mailtrap:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="mailtrap_get_accounts",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user opens the link once and enters their Mailtrap credentials there. If your app already has a user's credentials, add the account from your backend instead, as the console steps above show. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'mailtrap_get_accounts',
  toolInput: {},
  connector: 'mailtrap',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="mailtrap_get_accounts",
    tool_input={},
    connection_name="mailtrap",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `mailtrap_get_accounts`

Get Accounts · Read-only

List all Mailtrap accounts the API token has access to.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `mailtrap_get_api_token`

Get API Token · Read-only

Retrieve a single API token by ID, including its name and resource permissions. Does not return the token's secret value.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `token_id` (`integer`, required): ID of the API token to retrieve.

Example input: `{"token_id":1}`

### `mailtrap_get_billing_usage`

Get Billing Usage · Read-only

Get current billing cycle usage for Sandbox, Email API, and Email Marketing quotas.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `mailtrap_get_contact`

Get Contact · Read-only

Retrieve a contact by UUID or email address, including their subscription status and custom fields.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `contact_identifier` (`string`, required): UUID or email address of the contact to retrieve. Example: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890' or 'alice@example.com'.

Example input: `{"contact_identifier":"a1b2c3d4-e5f6-7890-abcd-ef1234567890"}`

### `mailtrap_get_contact_export`

Get Contact Export · Read-only

Check the status of a contact export job by its ID. Returns a download URL once the export has finished.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `export_id` (`integer`, required): The unique numeric ID of the contact export job to check.

Example input: `{"export_id":1}`

### `mailtrap_get_contact_import`

Get Contact Import · Read-only

Check the status and results of an asynchronous contact import job by its ID.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `import_id` (`integer`, required): The unique numeric ID of the contact import job to check.

Example input: `{"import_id":1}`

### `mailtrap_get_contact_list`

Get Contact List · Read-only

Get details of a specific contact list by ID, including its name and contact count.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `list_id` (`integer`, required): Numeric ID of the contact list to retrieve. Example: 42.

Example input: `{"list_id":42}`

### `mailtrap_get_domain`

Get Domain · Read-only

Get details for a specific sending domain including DNS records, DKIM keys, and verification status.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `domain_id` (`integer`, required): ID of the sending domain to retrieve.

Example input: `{"domain_id":1}`

### `mailtrap_get_email_campaign`

Get Email Campaign · Read-only

Retrieve a single email campaign by ID, including its state, audience, and template attributes.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `email_campaign_id` (`integer`, required): Unique identifier of the email campaign.

Example input: `{"email_campaign_id":1}`

### `mailtrap_get_email_campaign_stats`

Get Email Campaign Stats · Read-only

Get aggregated performance metrics for a campaign: counts and rates for deliveries, opens, clicks, bounces, spam complaints, and unsubscriptions. Returns all-zero counts if the campaign has never been started. Optionally narrow the aggregation window with start_date/end_date.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `email_campaign_id` (`integer`, required): Unique identifier of the email campaign.
- `end_date` (`string`, optional): End of the aggregation window, as a date (YYYY-MM-DD).
- `start_date` (`string`, optional): Start of the aggregation window, as a date (YYYY-MM-DD).

Example input: `{"email_campaign_id":1}`

### `mailtrap_get_email_log`

Get Email Log · Read-only

Retrieve detailed information for a specific sent message by its ID, including delivery events and timestamps.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `sending_message_id` (`string`, required): The unique ID of the sent message to retrieve. Obtained from the List Email Logs response.

Example input: `{"sending_message_id":"<sending_message_id>"}`

### `mailtrap_get_inbound_message`

Get Inbound Message · Read-only

Retrieve full details of a single inbound email message, including decoded HTML/text bodies, headers, attachments with download URLs, and a link to the raw .eml file.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `inbox_id` (`integer`, required): The numeric ID of the inbound inbox containing the message.
- `message_id` (`string`, required): The ID of the inbound message to retrieve.

Example input: `{"inbox_id":1,"message_id":"<message_id>"}`

### `mailtrap_get_inbox`

Get Inbox · Read-only

Retrieve a single inbound email inbox by ID, including its receiving address and attached domain.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `folder_id` (`integer`, required): The numeric ID of the inbound folder that contains the inbox.
- `inbox_id` (`integer`, required): The numeric ID of the inbox to retrieve.

Example input: `{"folder_id":1,"inbox_id":1}`

### `mailtrap_get_message_attachment`

Get Message Attachment · Read-only

Get metadata for a single attachment captured on a sandbox test message, including filename, content type, and size.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `attachment_id` (`integer`, required): The numeric ID of the attachment to retrieve.
- `message_id` (`integer`, required): The numeric ID of the sandbox message that owns the attachment.
- `sandbox_id` (`integer`, required): The numeric ID of the sandbox inbox containing the message.

Example input: `{"attachment_id":1,"message_id":1,"sandbox_id":1}`

### `mailtrap_get_message_body_html`

Get Message HTML Body · Read-only

Get the rendered HTML body content of a captured sandbox test message.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `message_id` (`integer`, required): The numeric ID of the sandbox message whose HTML body will be retrieved.
- `sandbox_id` (`integer`, required): The numeric ID of the sandbox inbox containing the message.

Example input: `{"message_id":1,"sandbox_id":1}`

### `mailtrap_get_message_body_text`

Get Message Text Body · Read-only

Get the plain-text body content of a captured sandbox test message.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `message_id` (`integer`, required): The numeric ID of the sandbox message whose text body will be retrieved.
- `sandbox_id` (`integer`, required): The numeric ID of the sandbox inbox containing the message.

Example input: `{"message_id":1,"sandbox_id":1}`

### `mailtrap_get_message_spam_report`

Get Message Spam Report · Read-only

Get spam analysis score and detailed spam rule report for a captured sandbox email.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `message_id` (`integer`, required): The numeric ID of the sandbox message to analyze for spam.
- `sandbox_id` (`integer`, required): The numeric ID of the sandbox inbox containing the message.

Example input: `{"message_id":1,"sandbox_id":1}`

### `mailtrap_get_project`

Get Project · Read-only

Get details of a single sandbox project by ID, including its sandbox inboxes.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `project_id` (`integer`, required): The unique numeric ID of the project to retrieve.

Example input: `{"project_id":1}`

### `mailtrap_get_sandbox`

Get Sandbox · Read-only

Get details of a single sandbox inbox by ID, including its email address and credentials info.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `sandbox_id` (`integer`, required): The numeric ID of the sandbox inbox to retrieve.

Example input: `{"sandbox_id":1}`

### `mailtrap_get_sandbox_message`

Get Sandbox Message · Read-only

Show full details of a specific captured test email including headers, HTML body, and text body.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `message_id` (`integer`, required): The numeric ID of the sandbox message to retrieve.
- `sandbox_id` (`integer`, required): The numeric ID of the sandbox inbox containing the message.

Example input: `{"message_id":1,"sandbox_id":1}`

### `mailtrap_get_sending_stats`

Get Sending Stats · Read-only

Get overall email sending statistics including sent, delivered, opened, clicked, bounced, and spam counts.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `end_date` (`string`, required): ISO date string for the end of the stats period.
- `start_date` (`string`, required): ISO date string for the start of the stats period.

Example input: `{"end_date":"<end_date>","start_date":"<start_date>"}`

### `mailtrap_get_stats_by_category`

Get Stats by Category · Read-only

Get email sending statistics grouped by email category tag.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `end_date` (`string`, required): The end date for the statistics range in ISO 8601 date format (YYYY-MM-DD).
- `start_date` (`string`, required): The start date for the statistics range in ISO 8601 date format (YYYY-MM-DD).
- `domain_id` (`integer`, optional): Filter statistics to a specific sending domain by its numeric ID.

Example input: `{"end_date":"<end_date>","start_date":"<start_date>"}`

### `mailtrap_get_stats_by_date`

Get Stats by Date · Read-only

Get email sending statistics grouped by date for trend analysis over a time period.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `domain_id` (`integer`, optional): Filter statistics to a specific sending domain by its numeric ID.
- `end_date` (`string`, optional): The end date for the statistics range in ISO 8601 date format (YYYY-MM-DD).
- `start_date` (`string`, optional): The start date for the statistics range in ISO 8601 date format (YYYY-MM-DD).

Example input: `{}`

### `mailtrap_get_stats_by_domain`

Get Stats by Domain · Read-only

Get email sending statistics grouped by sending domain for the specified date range.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `end_date` (`string`, required): The end date for the statistics range in ISO 8601 date format (YYYY-MM-DD).
- `start_date` (`string`, required): The start date for the statistics range in ISO 8601 date format (YYYY-MM-DD).

Example input: `{"end_date":"<end_date>","start_date":"<start_date>"}`

### `mailtrap_get_stats_by_esp`

Get Stats by ESP · Read-only

Get email sending statistics grouped by recipient email service provider (Gmail, Outlook, etc.).

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `end_date` (`string`, required): The end date for the statistics range in ISO 8601 date format (YYYY-MM-DD).
- `start_date` (`string`, required): The start date for the statistics range in ISO 8601 date format (YYYY-MM-DD).
- `domain_id` (`integer`, optional): Filter statistics to a specific sending domain by its numeric ID.

Example input: `{"end_date":"<end_date>","start_date":"<start_date>"}`

### `mailtrap_get_template`

Get Template · Read-only

Get a single email template by ID including its name, subject, and HTML/text body content.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `email_template_id` (`integer`, required): The numeric ID of the email template to retrieve.

Example input: `{"email_template_id":1}`

### `mailtrap_get_webhook`

Get Webhook · Read-only

Retrieve a single webhook by its ID, including its URL, type, active state, and subscribed event types.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `webhook_id` (`integer`, required): The numeric ID of the webhook to retrieve.

Example input: `{"webhook_id":1}`

### `mailtrap_list_account_accesses`

List Account Accesses · Read-only

List all user and invite account accesses with optional resource type filtering.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `resource_id` (`integer`, optional): Filter accesses by the numeric ID of the target resource.
- `resource_type` (`string`, optional): Filter accesses by the type of resource they apply to.

Example input: `{}`

### `mailtrap_list_api_tokens`

List API Tokens · Read-only

List all API tokens visible to the current API token.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `mailtrap_list_contact_fields`

List Contact Fields · Read-only

List all custom contact fields defined for the account (maximum 40 fields).

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `mailtrap_list_contact_lists`

List Contact Lists · Read-only

List all contact lists in the Mailtrap account, with optional search filtering and pagination.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `limit` (`integer`, optional): Number of contact lists to return per page.
- `page` (`integer`, optional): Page number for pagination. Starts at 1.
- `search` (`string`, optional): Search term to filter contact lists by name. Case-insensitive substring match.

Example input: `{}`

### `mailtrap_list_domains`

List Domains · Read-only

List all sending domains with their verification, DKIM, SPF, and compliance status.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `limit` (`integer`, optional): Maximum number of domain records to return per page.
- `page` (`integer`, optional): Page number for paginated results.

Example input: `{}`

### `mailtrap_list_email_campaigns`

List Email Campaigns · Read-only

Returns a paginated list of the account's email marketing campaigns, newest first. Supports searching by name.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `per_page` (`integer`, optional): Number of campaigns per page. Defaults to 50, maximum 100.
- `search` (`string`, optional): Search string to filter campaigns by name.
- `token` (`integer`, optional): Page number to retrieve (page-token pagination). Defaults to 1.

Example input: `{}`

### `mailtrap_list_email_logs`

List Email Logs · Read-only

List email logs with filtering by status, date range, domain, and search. Returns sent message records with delivery status.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `domain_id` (`integer`, optional): Filter logs by sending domain ID.
- `end_date` (`string`, optional): Filter logs sent on or before this date.
- `limit` (`integer`, optional): Number of log records to return per page.
- `page` (`integer`, optional): Page number for paginated results.
- `search` (`string`, optional): Search term to filter email logs by subject, recipient, or message ID.
- `start_date` (`string`, optional): Filter logs sent on or after this date.
- `status` (`string`, optional): Filter logs by delivery status. One of: `sent`, `delivered`, `bounced`, `spam`, `rejected`, `opened`, `clicked`.

Example input: `{}`

### `mailtrap_list_inbound_messages`

List Inbound Messages · Read-only

List real inbound email messages received by an inbox, newest first, within the account's retention window. Supports cursor-based pagination via last_id.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `inbox_id` (`integer`, required): The numeric ID of the inbound inbox to list messages from.
- `last_id` (`string`, optional): Cursor for pagination. Pass the previous response's last_id value to fetch the next page.

Example input: `{"inbox_id":1}`

### `mailtrap_list_inboxes`

List Inboxes · Read-only

List all inbound email inboxes in a folder. Inbound inboxes receive real email at a generated or custom-domain address, distinct from the Email Testing sandboxes used for capturing outgoing test messages.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `folder_id` (`integer`, required): The numeric ID of the inbound folder that contains the inboxes.

Example input: `{"folder_id":1}`

### `mailtrap_list_message_attachments`

List Message Attachments · Read-only

List the attachments captured on a sandbox test message, including filename, content type, and size.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `message_id` (`integer`, required): The numeric ID of the sandbox message whose attachments will be listed.
- `sandbox_id` (`integer`, required): The numeric ID of the sandbox inbox containing the message.

Example input: `{"message_id":1,"sandbox_id":1}`

### `mailtrap_list_projects`

List Projects · Read-only

List all sandbox projects in the account. Projects are containers for organizing sandbox inboxes.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `mailtrap_list_sandbox_messages`

List Sandbox Messages · Read-only

Get captured test emails in a sandbox inbox with optional filtering by subject or sender.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `sandbox_id` (`integer`, required): The numeric ID of the sandbox inbox to list messages from.
- `limit` (`integer`, optional): Maximum number of messages to return per page.
- `page` (`integer`, optional): Page number for paginating through sandbox messages.
- `search` (`string`, optional): Search string to filter messages by subject or sender.

Example input: `{"sandbox_id":1}`

### `mailtrap_list_sandboxes`

List Sandboxes · Read-only

List all testing sandbox inboxes available for capturing test emails in development.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `limit` (`integer`, optional): Maximum number of sandboxes to return per page.
- `page` (`integer`, optional): Page number for paginated results.

Example input: `{}`

### `mailtrap_list_sub_accounts`

List Sub Accounts · Read-only

List all sub accounts belonging to a specified organization.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `organization_id` (`integer`, required): ID of the organization whose sub accounts should be listed.

Example input: `{"organization_id":1}`

### `mailtrap_list_suppressions`

List Suppressions · Read-only

List suppressed email addresses including bounces, unsubscribes, and spam complaints.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `email` (`string`, optional): Filter suppressions by email address.
- `limit` (`integer`, optional): Maximum number of suppression records to return per page.
- `page` (`integer`, optional): Page number for paginated results.

Example input: `{}`

### `mailtrap_list_templates`

List Templates · Read-only

List all email templates in the Mailtrap account.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `limit` (`integer`, optional): Number of templates to return per page.
- `page` (`integer`, optional): Page number for paginated results.

Example input: `{}`

### `mailtrap_list_webhooks`

List Webhooks · Read-only

List all webhooks configured for the account, including their URL, type, active state, and subscribed event types.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `mailtrap_batch_send_bulk_email`

Batch Send Bulk Emails · Write

Send up to 500 marketing/bulk emails in a single API call via the Bulk Sending stream, each with its own recipients and content, optionally sharing base properties. Returns HTTP 200 even if individual messages fail -- check the per-message results for status.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `requests_json` (`string`, required): JSON array of individual email configurations (max 500), each with the same fields as a single send (from, to, subject, text/html, etc.).
- `base_json` (`string`, optional): JSON object of base properties shared by all emails in the batch (from, subject, text, html, category, template_uuid, etc.), used as defaults when not overridden per-request.

Example input: `{"requests_json":"<requests_json>"}`

### `mailtrap_batch_send_email`

Batch Send Emails · Write

Send up to 500 transactional emails in a single API call, each with its own recipients and content, optionally sharing base properties. Returns HTTP 200 even if individual messages fail -- check the per-message results for status.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `requests_json` (`string`, required): JSON array of individual email configurations (max 500), each with the same fields as a single send (from, to, subject, text/html, etc.).
- `base_json` (`string`, optional): JSON object of base properties shared by all emails in the batch (from, subject, text, html, category, template_uuid, etc.), used as defaults when not overridden per-request.

Example input: `{"requests_json":"<requests_json>"}`

### `mailtrap_create_api_token`

Create API Token · Write

Create a new API token with a specified name and optional resource permissions.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `name` (`string`, required): Name for the new API token.
- `permissions_json` (`string`, required): JSON array string of permission objects. The Mailtrap API requires at least one permission.

Example input: `{"name":"Monthly Newsletter Subscribers","permissions_json":"<permissions_json>"}`

### `mailtrap_create_contact`

Create Contact · Write

Create a new marketing contact with email address, custom fields, and contact list assignments.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `email` (`string`, required): Email address of the contact. Must be a valid email address.
- `first_name` (`string`, optional): First name of the contact.
- `last_name` (`string`, optional): Last name of the contact.
- `list_ids` (`string`, optional): Comma-separated list IDs to add this contact to upon creation, e.g. '123,456'.
- `status` (`string`, optional): Subscription status of the contact. Valid values: subscribed, unsubscribed. One of: `subscribed`, `unsubscribed`.

Example input: `{"email":"<email>"}`

### `mailtrap_create_contact_field`

Create Contact Field · Write

Create a custom contact field with a name and data type (text, integer, float, boolean, or date).

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `data_type` (`string`, required): The data type of the contact field. One of: `text`, `integer`, `float`, `boolean`, `date`.
- `merge_tag` (`string`, required): Lowercase short identifier with underscores used as a merge tag in email templates (e.g. company_size).
- `name` (`string`, required): The display name for the custom contact field.

Example input: `{"data_type":"text","merge_tag":"<merge_tag>","name":"Monthly Newsletter Subscribers"}`

### `mailtrap_create_contact_list`

Create Contact List · Write

Create a new contact list for segmenting marketing email recipients.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `name` (`string`, required): Name for the new contact list, e.g. 'Monthly Newsletter Subscribers'.

Example input: `{"name":"Monthly Newsletter Subscribers"}`

### `mailtrap_create_domain`

Create Domain · Write

Create a new sending domain and receive DNS configuration records for DKIM and SPF setup.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `name` (`string`, required): The domain name to add as a sending domain.

Example input: `{"name":"Monthly Newsletter Subscribers"}`

### `mailtrap_create_email_campaign`

Create Email Campaign · Write

Create a new email marketing campaign as a draft. Requires an existing verified sending domain (domain_id), a From local part, and a template subject. Scheduling and starting are separate actions.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `domain_id` (`integer`, required): ID of the verified sending domain used for the campaign.
- `from_local_part` (`string`, required): Local part (before the @) of the From address.
- `name` (`string`, required): Campaign name.
- `subject` (`string`, required): Email subject line. Supports merge tags, e.g. 'Hi {{first_name}}'.
- `body_html` (`string`, optional): HTML body of the email (the design). Optional for a draft; required before the campaign can be scheduled or started. Include an unsubscribe link via an anchor whose href contains the __unsubscribe_url__ placeholder.
- `body_text` (`string`, optional): Optional plain-text alternative of the email body.
- `contact_list_ids` (`string`, optional): Comma-separated IDs of contact lists to send to.
- `contact_segment_ids` (`string`, optional): Comma-separated IDs of contact segments to send to.
- `delivery_mode` (`string`, optional): How the campaign is delivered. 'rapid' sends as fast as possible; 'gradual' throttles sending to emails_per_hour. One of: `rapid`, `gradual`.
- `emails_per_hour` (`integer`, optional): Delivery throttle. Applies only when delivery_mode is 'gradual'.
- `from_display_name` (`string`, optional): Display name shown in the From header.
- `reply_to_display_name` (`string`, optional): Display name for the Reply-To address.
- `reply_to_domain` (`string`, optional): Domain of the Reply-To address.
- `reply_to_local_part` (`string`, optional): Local part (before the @) of the Reply-To address.

Example input: `{"domain_id":1,"from_local_part":"<from_local_part>","name":"Monthly Newsletter Subscribers","subject":"Hi {{first_name}}"}`

### `mailtrap_create_inbox`

Create Inbox · Write

Create a new inbound email inbox inside a folder. A standard inbox gets a unique generated receiving address; attaching a verified custom sending domain (with inbound enabled) instead creates a catch-all inbox that receives mail for any address on that domain.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `folder_id` (`integer`, required): The numeric ID of the inbound folder to create the inbox in.
- `name` (`string`, required): Name for the new inbox.
- `domain_id` (`integer`, optional): Attach the inbox to a verified custom sending domain (with inbound enabled), creating a catch-all inbox for any address on that domain. Omit to create a standard Mailtrap-hosted inbox. Requires the custom domains feature.

Example input: `{"folder_id":1,"name":"Monthly Newsletter Subscribers"}`

### `mailtrap_create_project`

Create Project · Write

Create a new sandbox project to organize testing inboxes by team or application.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `name` (`string`, required): The name of the new sandbox project.

Example input: `{"name":"Monthly Newsletter Subscribers"}`

### `mailtrap_create_sandbox`

Create Sandbox · Write

Create a new sandbox inbox within a specific project for capturing test emails.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `name` (`string`, required): Name for the new sandbox inbox.
- `project_id` (`integer`, required): ID of the project in which to create the sandbox inbox.

Example input: `{"name":"Monthly Newsletter Subscribers","project_id":1}`

### `mailtrap_create_sub_account`

Create Sub-Account · Write

Create a new sub-account under a Mailtrap organization.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `name` (`string`, required): Name of the new sub-account.
- `organization_id` (`integer`, required): The numeric ID of the organization to create the sub-account under.

Example input: `{"name":"Monthly Newsletter Subscribers","organization_id":1}`

### `mailtrap_create_suppression`

Create Suppression · Write

Add an email address to the suppression list to prevent future email deliveries.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `domain_id` (`integer`, required): Numeric ID of the verified sending domain this suppression applies to.
- `email` (`string`, required): Email address to add to the suppression list.
- `sending_stream` (`string`, required): Sending stream to suppress the email address on. One of: `transactional`, `bulk`.
- `type` (`string`, optional): Suppression type indicating the reason for suppression. One of: `hard bounce`, `unsubscription`, `spam complaint`, `manual import`.

Example input: `{"domain_id":1,"email":"<email>","sending_stream":"transactional"}`

### `mailtrap_create_template`

Create Template · Write

Create a new reusable email template with name, subject, and HTML/text body content.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `category` (`string`, required): Category to organize the template.
- `name` (`string`, required): Name of the email template.
- `subject` (`string`, required): Subject line for the email template.
- `html_body` (`string`, optional): HTML body content of the email template.
- `text_body` (`string`, optional): Plain text body content of the email template.

Example input: `{"category":"<category>","name":"Monthly Newsletter Subscribers","subject":"Hi {{first_name}}"}`

### `mailtrap_create_webhook`

Create Webhook · Write

Create a webhook subscription that receives real-time HTTP notifications for account events (email sending, campaigns, audit log, or inbound receiving). The response includes a signing_secret returned only once — store it securely to verify payload signatures.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): The URL that will receive webhook payloads.
- `webhook_type` (`string`, required): The type of webhook. Determines which events the webhook can subscribe to. One of: `email_sending`, `campaigns`, `audit_log`, `inbound_receiving`.
- `active` (`boolean`, optional): Whether the webhook is active. Defaults to true. Default: `true`.
- `domain_id` (`integer`, optional): Scopes the webhook to a specific sending domain ID, or all domains if omitted. Applicable only for email_sending and campaigns webhooks.
- `event_types` (`string`, optional): Comma-separated list of event types to subscribe to. Required for email_sending and campaigns webhook types. Valid values: delivery, soft_bounce, bounce, suspension, unsubscribe, open, spam_complaint, click, reject.
- `inbound_inbox_id` (`integer`, optional): ID of the inbound inbox the webhook is linked to. Optional for inbound_receiving webhooks — omit to apply to all inboxes in the account. Not applicable to any other webhook type.
- `payload_format` (`string`, optional): Format of the webhook payload. Valid values: json, jsonlines. One of: `json`, `jsonlines`. Default: `json`.
- `sending_stream` (`string`, optional): Sending stream the webhook subscribes to. Required for the email_sending webhook type. Valid values: transactional, bulk. One of: `transactional`, `bulk`.

Example input: `{"url":"<url>","webhook_type":"email_sending"}`

### `mailtrap_export_contacts`

Export Contacts · Write

Start an asynchronous export of the account's contacts to a downloadable file, optionally filtered by contact list membership or subscription status. Use the returned export ID with Get Contact Export to poll for the download URL.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `filters` (`string`, optional): JSON array of filter objects to scope the export. Supported filters: {"name":"list_id","operator":"equal","value":[1,2]} and {"name":"subscription_status","operator":"equal","value":"subscribed"}. Omit to export all contacts.

Example input: `{}`

### `mailtrap_forward_sandbox_message`

Forward Sandbox Message · Write

Forward a captured sandbox test email to a real recipient email address for live testing.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `email` (`string`, required): The real recipient email address to forward the sandbox message to.
- `message_id` (`integer`, required): The numeric ID of the sandbox message to forward.
- `sandbox_id` (`integer`, required): The numeric ID of the sandbox inbox containing the message.

Example input: `{"email":"<email>","message_id":1,"sandbox_id":1}`

### `mailtrap_import_contacts`

Import Contacts · Write

Bulk import up to 50,000 contacts in a single request, with support for custom fields and list assignment. Contacts with matching email addresses are updated automatically. The import runs asynchronously — use the returned import ID with Get Contact Import to check status and results.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `contacts` (`string`, required): JSON array of contact objects to import (up to 50,000). Each needs email, and may include fields (custom field key-value map), list_ids_included, and list_ids_excluded.

Example input: `{"contacts":"<contacts>"}`

### `mailtrap_manage_permissions`

Manage Permissions · Write

Bulk create, update, or delete resource permissions for a user or API token account access.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `account_access_id` (`integer`, required): ID of the account access record whose permissions will be updated.
- `permissions_json` (`string`, required): JSON string representing the full permissions payload to apply. Structure as required by the Mailtrap bulk permissions API.

Example input: `{"account_access_id":1,"permissions_json":"<permissions_json>"}`

### `mailtrap_reply_inbound_message`

Reply To Inbound Message · Write

Send a reply to a received inbound email message. Must include text and/or html. Recipients default to the original sender's reply-to/from address when to_json is omitted. The from address is rejected for standard Mailtrap-hosted inboxes and required only for custom-domain inboxes.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `inbox_id` (`integer`, required): The numeric ID of the inbound inbox containing the message.
- `message_id` (`string`, required): The ID of the inbound message to reply to.
- `attachments_json` (`string`, optional): JSON array of attachment objects, e.g. '[{"filename":"invoice.pdf","content":"<base64>","type":"application/pdf"}]'. content must be base64-encoded.
- `bcc_json` (`string`, optional): JSON array of BCC recipient objects, same format as to_json.
- `category` (`string`, optional): Email API category label for the sent reply, used for grouping in delivery statistics.
- `cc_json` (`string`, optional): JSON array of CC recipient objects, same format as to_json.
- `custom_variables_json` (`string`, optional): JSON object of custom key-value metadata to attach to the reply, e.g. '{"ticket_id":"12345"}'.
- `from_email` (`string`, optional): Sender email address. Rejected for standard Mailtrap-hosted inboxes; required for custom-domain inboxes, where it must belong to the inbox's domain.
- `from_name` (`string`, optional): Sender display name. Only used together with from_email.
- `headers_json` (`string`, optional): JSON object of additional email headers to send, e.g. '{"X-Priority":"1"}'.
- `html` (`string`, optional): HTML reply body. At least one of text or html is required.
- `text` (`string`, optional): Plain-text reply body. At least one of text or html is required.
- `to_json` (`string`, optional): JSON array of recipient objects, e.g. '[{"email":"jane@example.com","name":"Jane"}]'. Defaults to the original sender's reply-to/from address if omitted.

Example input: `{"inbox_id":1,"message_id":"<message_id>"}`

### `mailtrap_sandbox_batch_send_email`

Batch Send Test Emails to Sandbox · Write

Send up to 500 test emails into a Mailtrap sandbox inbox in a single API call, each with its own recipients and content, optionally sharing base properties. Returns HTTP 200 even if individual messages fail -- check the per-message results for status.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `requests_json` (`string`, required): JSON array of individual email configurations (max 500), each with the same fields as a single send (from, to, subject, text/html, etc.).
- `sandbox_id` (`integer`, required): The numeric ID of the sandbox inbox to deliver the test emails into.
- `base_json` (`string`, optional): JSON object of base properties shared by all emails in the batch (from, subject, text, html, template_uuid, etc.), used as defaults when not overridden per-request.

Example input: `{"requests_json":"<requests_json>","sandbox_id":1}`

### `mailtrap_sandbox_send_email`

Send Test Email to Sandbox · Write

Send a test email directly into a Mailtrap sandbox inbox via the Sandbox Sending API, for testing your email content without delivering to a real recipient. Provide text and/or html content, or a template_uuid.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `from_email` (`string`, required): Sender email address for the test email.
- `sandbox_id` (`integer`, required): The numeric ID of the sandbox inbox to deliver the test email into.
- `to_json` (`string`, required): JSON array of recipient objects, e.g. '[{"email":"user@example.com","name":"Test User"}]'.
- `attachments_json` (`string`, optional): JSON array of attachment objects. content must be base64-encoded.
- `from_name` (`string`, optional): Sender display name.
- `html` (`string`, optional): HTML email body. At least one of text or html is required unless template_uuid is set.
- `subject` (`string`, optional): Email subject line. Required unless sending from a template that provides its own subject.
- `template_uuid` (`string`, optional): UUID of a saved Mailtrap template to send from, instead of subject/text/html.
- `template_variables_json` (`string`, optional): JSON object of variable values to substitute into the template.
- `text` (`string`, optional): Plain-text email body. At least one of text or html is required unless template_uuid is set.

Example input: `{"from_email":"<from_email>","sandbox_id":1,"to_json":"[{\"email\":\"user@example.com\",\"name\":\"Test User\"}]"}`

### `mailtrap_send_bulk_email`

Send Bulk Email · Write

Send a marketing or newsletter email via the Mailtrap Bulk Sending stream, optimized for high-volume, non-transactional sends. Provide text and/or html content, or a template_uuid to send from a saved template.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `from_email` (`string`, required): Sender email address. Must be on a verified sending domain.
- `to_json` (`string`, required): JSON array of recipient objects, e.g. '[{"email":"jane@example.com","name":"Jane"}]'.
- `attachments_json` (`string`, optional): JSON array of attachment objects, e.g. '[{"filename":"flyer.pdf","content":"<base64>","type":"application/pdf"}]'. content must be base64-encoded.
- `bcc_json` (`string`, optional): JSON array of BCC recipient objects, same format as to_json.
- `category` (`string`, optional): Category label for grouping this email in Mailtrap statistics.
- `cc_json` (`string`, optional): JSON array of CC recipient objects, same format as to_json.
- `custom_variables_json` (`string`, optional): JSON object of custom key-value metadata to attach to the email, e.g. '{"campaign_id":"42"}'.
- `from_name` (`string`, optional): Sender display name.
- `headers_json` (`string`, optional): JSON object of additional email headers to send, e.g. '{"List-Unsubscribe":"<mailto:unsub@example.com>"}'.
- `html` (`string`, optional): HTML email body. At least one of text or html is required unless template_uuid is set.
- `reply_to_email` (`string`, optional): Reply-to email address.
- `subject` (`string`, optional): Email subject line. Required unless sending from a template that provides its own subject.
- `template_uuid` (`string`, optional): UUID of a saved Mailtrap template to send from, instead of subject/text/html.
- `template_variables_json` (`string`, optional): JSON object of variable values to substitute into the template, e.g. '{"first_name":"Jane"}'.
- `text` (`string`, optional): Plain-text email body. At least one of text or html is required unless template_uuid is set.

Example input: `{"from_email":"<from_email>","to_json":"[{\"email\":\"jane@example.com\",\"name\":\"Jane\"}]"}`

### `mailtrap_send_domain_setup_instructions`

Send Domain Setup Instructions · Write

Email DNS setup instructions for a domain to a specified recipient address.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `domain_id` (`integer`, required): The unique numeric ID of the domain whose setup instructions will be sent.
- `email` (`string`, required): The recipient email address to send the DNS setup instructions to.

Example input: `{"domain_id":1,"email":"<email>"}`

### `mailtrap_send_email`

Send Email · Write

Send a single transactional email via the Mailtrap Sending API (order confirmations, password resets, notifications). Provide text and/or html content, or a template_uuid to send from a saved template.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `from_email` (`string`, required): Sender email address. Must be on a verified sending domain.
- `to_json` (`string`, required): JSON array of recipient objects, e.g. '[{"email":"jane@example.com","name":"Jane"}]'.
- `attachments_json` (`string`, optional): JSON array of attachment objects, e.g. '[{"filename":"invoice.pdf","content":"<base64>","type":"application/pdf"}]'. content must be base64-encoded.
- `bcc_json` (`string`, optional): JSON array of BCC recipient objects, same format as to_json.
- `category` (`string`, optional): Category label for grouping this email in Mailtrap statistics.
- `cc_json` (`string`, optional): JSON array of CC recipient objects, same format as to_json.
- `custom_variables_json` (`string`, optional): JSON object of custom key-value metadata to attach to the email, e.g. '{"user_id":"42"}'.
- `from_name` (`string`, optional): Sender display name.
- `headers_json` (`string`, optional): JSON object of additional email headers to send, e.g. '{"X-Priority":"1"}'.
- `html` (`string`, optional): HTML email body. At least one of text or html is required unless template_uuid is set.
- `reply_to_email` (`string`, optional): Reply-to email address.
- `subject` (`string`, optional): Email subject line. Required unless sending from a template that provides its own subject.
- `template_uuid` (`string`, optional): UUID of a saved Mailtrap template to send from, instead of subject/text/html.
- `template_variables_json` (`string`, optional): JSON object of variable values to substitute into the template, e.g. '{"order_id":"1234"}'.
- `text` (`string`, optional): Plain-text email body. At least one of text or html is required unless template_uuid is set.

Example input: `{"from_email":"<from_email>","to_json":"[{\"email\":\"jane@example.com\",\"name\":\"Jane\"}]"}`

### `mailtrap_start_email_campaign`

Start Email Campaign · Write

Start sending a draft campaign immediately. Runs full sending validation (template design, audience, verified domain, billing limits); on failure the campaign stays a draft and the request fails. The campaign must be in the draft state.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `email_campaign_id` (`integer`, required): Unique identifier of the draft email campaign to start sending.

Example input: `{"email_campaign_id":1}`

### `mailtrap_track_contact_event`

Track Contact Event · Write

Submit a custom interaction event for a contact to track engagement and trigger automations.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `contact_identifier` (`string`, required): UUID or email address of the contact for whom the event is being tracked.
- `name` (`string`, required): Name of the custom event to record, e.g. 'purchase', 'page_view', 'trial_started'.
- `occurred_at` (`string`, optional): ISO 8601 datetime when the event occurred. Defaults to now if omitted.
- `value` (`string`, optional): Optional value associated with the event, e.g. a purchase amount or product ID.

Example input: `{"contact_identifier":"a1b2c3d4-e5f6-7890-abcd-ef1234567890","name":"purchase"}`

### `mailtrap_update_contact`

Update Contact · Write

Update a contact's custom fields, subscription status, or contact list memberships by UUID or email address.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `contact_identifier` (`string`, required): UUID or email address of the contact to update. Example: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890' or 'alice@example.com'.
- `first_name` (`string`, optional): New first name for the contact.
- `last_name` (`string`, optional): New last name for the contact.
- `status` (`string`, optional): New subscription status. Valid values: subscribed, unsubscribed. One of: `subscribed`, `unsubscribed`.

Example input: `{"contact_identifier":"a1b2c3d4-e5f6-7890-abcd-ef1234567890"}`

### `mailtrap_update_contact_list`

Update Contact List · Write

Update the name of an existing contact list by its ID.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `list_id` (`integer`, required): Numeric ID of the contact list to update. Example: 42.
- `name` (`string`, required): New name for the contact list.

Example input: `{"list_id":42,"name":"Monthly Newsletter Subscribers"}`

### `mailtrap_update_domain`

Update Domain · Write

Update domain settings such as open tracking, click tracking, and unsubscribe tracking configuration.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `domain_id` (`integer`, required): The unique numeric ID of the domain to update.
- `click_tracking` (`boolean`, optional): Enable or disable click tracking for links in emails sent from this domain.
- `open_tracking` (`boolean`, optional): Enable or disable open tracking for emails sent from this domain.
- `unsubscribe_tracking` (`boolean`, optional): Enable or disable unsubscribe tracking for emails sent from this domain.

Example input: `{"domain_id":1}`

### `mailtrap_update_email_campaign`

Update Email Campaign · Write

Update an existing draft email campaign. Only the provided attributes are changed; the template (subject/design) is always edited in place. Only draft campaigns can be updated — editing a scheduled or sending campaign fails.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `email_campaign_id` (`integer`, required): Unique identifier of the draft email campaign to update.
- `body_html` (`string`, optional): HTML body of the email (the design). Required before the campaign can be scheduled or started.
- `body_text` (`string`, optional): Plain-text alternative of the email body.
- `contact_list_ids` (`string`, optional): Comma-separated IDs of contact lists to send to. Replaces the campaign's full set of included lists.
- `contact_segment_ids` (`string`, optional): Comma-separated IDs of contact segments to send to. Replaces the campaign's full set of included segments.
- `delivery_mode` (`string`, optional): How the campaign is delivered. 'rapid' sends as fast as possible; 'gradual' throttles sending to emails_per_hour. One of: `rapid`, `gradual`.
- `domain_id` (`integer`, optional): ID of the verified sending domain used for the campaign.
- `emails_per_hour` (`integer`, optional): Delivery throttle. Applies only when delivery_mode is 'gradual'.
- `from_display_name` (`string`, optional): Display name shown in the From header.
- `from_local_part` (`string`, optional): Local part (before the @) of the From address.
- `name` (`string`, optional): New campaign name.
- `reply_to_display_name` (`string`, optional): Display name for the Reply-To address.
- `reply_to_domain` (`string`, optional): Domain of the Reply-To address.
- `reply_to_local_part` (`string`, optional): Local part (before the @) of the Reply-To address.
- `subject` (`string`, optional): Email subject line. Supports merge tags, e.g. 'Hi {{first_name}}'.

Example input: `{"email_campaign_id":1}`

### `mailtrap_update_project`

Update Project · Write

Rename an existing sandbox project.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `name` (`string`, required): New name for the project.
- `project_id` (`integer`, required): The unique numeric ID of the project to update.

Example input: `{"name":"Monthly Newsletter Subscribers","project_id":1}`

### `mailtrap_update_sandbox`

Update Sandbox · Write

Rename a sandbox inbox or change its email username.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `sandbox_id` (`integer`, required): The numeric ID of the sandbox inbox to update.
- `email_username` (`string`, optional): New local-part username for the sandbox inbox's email address.
- `name` (`string`, optional): New display name for the sandbox inbox.

Example input: `{"sandbox_id":1}`

### `mailtrap_update_template`

Update Template · Write

Update an existing email template's name, subject, or body content.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `email_template_id` (`integer`, required): ID of the email template to update.
- `category` (`string`, optional): New category for the template.
- `html_body` (`string`, optional): New HTML body content for the email template.
- `name` (`string`, optional): New name for the email template.
- `subject` (`string`, optional): New subject line for the email template.
- `text_body` (`string`, optional): New plain text body content for the email template.

Example input: `{"email_template_id":1}`

### `mailtrap_update_webhook`

Update Webhook · Write

Update an existing webhook's URL, active state, payload format, event types, or inbound inbox scope. Only the fields provided are changed.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `webhook_id` (`integer`, required): The numeric ID of the webhook to update.
- `active` (`boolean`, optional): Whether the webhook is active.
- `event_types` (`string`, optional): Comma-separated list of event types to subscribe to. Applicable only for email_sending and campaigns webhooks. Valid values: delivery, soft_bounce, bounce, suspension, unsubscribe, open, spam_complaint, click, reject.
- `inbound_inbox_id` (`integer`, optional): ID of the inbound inbox the webhook is linked to. Applicable only for inbound_receiving webhooks.
- `payload_format` (`string`, optional): Format of the webhook payload. Valid values: json, jsonlines. One of: `json`, `jsonlines`.
- `url` (`string`, optional): New URL that will receive webhook payloads.

Example input: `{"webhook_id":1}`

### `mailtrap_clean_sandbox`

Clean Sandbox · Destructive

Delete all captured messages from a sandbox inbox, clearing it for fresh test runs.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `sandbox_id` (`integer`, required): ID of the sandbox inbox to clean.

Example input: `{"sandbox_id":1}`

### `mailtrap_delete_api_token`

Delete API Token · Destructive

Permanently delete an API token by ID. This action cannot be undone.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `token_id` (`integer`, required): ID of the API token to permanently delete.

Example input: `{"token_id":1}`

### `mailtrap_delete_contact`

Delete Contact · Destructive

Permanently remove a contact by UUID or email address from the Mailtrap account. This action cannot be undone.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `contact_identifier` (`string`, required): UUID or email address of the contact to permanently delete. Example: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890' or 'alice@example.com'.

Example input: `{"contact_identifier":"a1b2c3d4-e5f6-7890-abcd-ef1234567890"}`

### `mailtrap_delete_contact_list`

Delete Contact List · Destructive

Delete a contact list by ID. This does not delete the contacts within the list.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `list_id` (`integer`, required): The numeric ID of the contact list to delete.

Example input: `{"list_id":42}`

### `mailtrap_delete_domain`

Delete Domain · Destructive

Delete a sending domain from the Mailtrap account. This action is permanent and cannot be undone.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `domain_id` (`integer`, required): The unique numeric ID of the domain to delete.

Example input: `{"domain_id":1}`

### `mailtrap_delete_email_campaign`

Delete Email Campaign · Destructive

Soft-delete an email campaign by ID. The campaign must not be in a sending state. This action cannot be undone.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `email_campaign_id` (`integer`, required): Unique identifier of the email campaign to permanently delete.

Example input: `{"email_campaign_id":1}`

### `mailtrap_delete_project`

Delete Project · Destructive

Permanently delete a sandbox project and all of its sandbox inboxes. This action cannot be undone.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `project_id` (`integer`, required): The unique numeric ID of the project to delete.

Example input: `{"project_id":1}`

### `mailtrap_delete_sandbox`

Delete Sandbox · Destructive

Permanently delete a sandbox inbox and all of its captured test messages. This action cannot be undone.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `sandbox_id` (`integer`, required): The numeric ID of the sandbox inbox to delete.

Example input: `{"sandbox_id":1}`

### `mailtrap_delete_sandbox_message`

Delete Sandbox Message · Destructive

Permanently delete a single captured message from a sandbox inbox. This action cannot be undone.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `message_id` (`integer`, required): The numeric ID of the sandbox message to delete.
- `sandbox_id` (`integer`, required): The numeric ID of the sandbox inbox containing the message.

Example input: `{"message_id":1,"sandbox_id":1}`

### `mailtrap_delete_suppression`

Delete Suppression · Destructive

Remove an email address from the suppression list to re-enable email deliveries.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `suppression_id` (`integer`, required): ID of the suppression record to remove.

Example input: `{"suppression_id":1}`

### `mailtrap_delete_template`

Delete Template · Destructive

Permanently delete an email template by ID.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `email_template_id` (`integer`, required): ID of the email template to delete.

Example input: `{"email_template_id":1}`

### `mailtrap_delete_webhook`

Delete Webhook · Destructive

Permanently delete a webhook by ID. This action cannot be undone.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `webhook_id` (`integer`, required): The numeric ID of the webhook to permanently delete.

Example input: `{"webhook_id":1}`

### `mailtrap_reset_api_token`

Reset API Token · Destructive

Expire an API token and generate a new token with the same permissions in its place. The old token keeps working for a short grace period. The response includes the new secret value once — store it securely. Only tokens that have not already been reset can be reset.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `token_id` (`integer`, required): ID of the API token to reset.

Example input: `{"token_id":1}`

## Related

Other Communication connectors ([all 78](/agentkit/connectors/?category=communication)):

- [Crisp](/agentkit/connectors/crisp/): Scalekit connector, API key, 50 tools
- [Gmail](/agentkit/connectors/gmail/): Scalekit connector, OAuth, 48 tools
- [Google Calendar](/agentkit/connectors/googlecalendar/): Scalekit connector, OAuth, 30 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
