Skip to content
Mailtrap logo

Connectors / Communication · HTTP Connector

Mailtrap integration and API

Send a transactional email, create a domain and create a contact in Mailtrap, and start a workflow when Mailtrap sends “Email delivered”.

What can you do with Mailtrap on Tray.ai?

Mailtrap is an email delivery platform with transactional and bulk sending, a sandbox for testing emails before release, and tools for marketing campaigns. Tray.ai connects to Mailtrap through the HTTP Connector, so your workflows can call the Mailtrap API alongside the rest of your stack.

  • Send a transactional email when a customer resets their password in your app.
  • When Mailtrap sends “Email bounced”, mark the address as invalid in your CRM.
  • When Mailtrap sends “Spam complaint”, mark the contact as opted out in your CRM.
  • Create a contact when someone starts a trial in your product.
Connects through
HTTP Connector
Authentication
An API key in a request header or a bearer token
Base URL
https://send.api.mailtrap.io/api

Set it up

Connect Mailtrap to Tray.ai

Each step uses Mailtrap's own API details, from its documentation.

Save Mailtrap's API key

Save the key as a Tray.ai authentication. The HTTP Client puts it in the request header, read from $.auth. The key stays out of the workflow and out of the logs.

Point the HTTP Client at the API

Add an HTTP Client step and use https://send.api.mailtrap.io/api as the base URL. Or paste a cURL example from Mailtrap's API docs, and Tray.ai fills in the method, URL, and headers.

Start with “List domains”

It's one of 23 documented actions, under Sending domains. The response comes back as data the next step can map into your other apps.

Start workflows from Mailtrap events

Give Mailtrap the URL of a Tray.ai webhook trigger. “Email delivered” can then start a workflow, and so can 7 other events.

Workflows to build with Mailtrap

Connect Mailtrap with Shopify, HubSpot and Slack

Each one uses actions and events from Mailtrap's own API documentation.

Send Shopify order emails through Mailtrap

When

An order is placed in Shopify

Then

  1. Send a transactional email with the order confirmation
  2. Add a note with the send time to the order in Shopify

With Shopify

Add new HubSpot contacts to a Mailtrap contact list

When

A new contact is created in HubSpot

Then

  1. List contacts to check for an existing record
  2. Create a contact in the newsletter list

With HubSpot

Alert support in Slack when Mailtrap rejects an email

When

Email rejected

Then

  1. Post the recipient and reason to the support channel in Slack
  2. Update a contact to flag the address

With Slack

Apps you can build on Mailtrap data

Internal tools your team can build with an AI assistant, each one using Mailtrap calls from its API documentation.

Pre-release email review

Lists sandbox test emails with their spam score so QA can review each one before release.

Campaign launch board

Lists email campaigns and contact lists so a marketer can schedule or start each campaign.

Deliverability issue feed

Collects bounces, rejections and spam complaints so the team can find the contact and update or delete it.

Mailtrap MCP server for AI agents

Build an MCP server on Mailtrap in Agent Gateway and choose which actions your agents can call. Every call runs with access control and an audit trail. How Agent Gateway works

  • Send a transactional email
  • List domains
  • List contacts
  • List contact lists
  • List email campaigns
  • Get messages
  • Send a bulk email
  • Batch send emails

What the Mailtrap API covers

6 resources and 23 documented actions, each one a call the HTTP Connector can make from a Tray.ai workflow. Connecting it takes a few clicks: here's how.

Emails

  • Send a transactional email
  • Send a bulk email
  • Batch send emails

Sending domains

  • List domains
  • Create a domain
  • Get a domain
  • Delete a domain

Contacts

  • List contacts
  • Create a contact
  • Update a contact
  • Delete a contact

Contact lists

  • List contact lists
  • Create a contact list
  • Update a contact list
  • Delete a contact list

Email campaigns

  • List email campaigns
  • Create an email campaign
  • Start an email campaign
  • Schedule an email campaign

Sandbox messages

  • Get messages
  • Show an email message
  • Forward a message
  • Get message spam score

Events Mailtrap can send to a Tray.ai webhook trigger

  • Email delivered
  • Email opened
  • Link clicked
  • Email bounced
  • Soft bounce
  • Spam complaint
  • Recipient unsubscribed
  • Email rejected

Checked against Mailtrap's own documentation on 2026-10-22

docs.mailtrap.io/developers

Frequently asked questions

What can a Tray.ai workflow do in Mailtrap?

The Mailtrap API documents 23 actions across 6 resources (Emails, Sending domains, Contacts, Contact lists, Email campaigns, Sandbox messages). For example: Send a transactional email; List domains; List contacts. A workflow can make any documented call through the HTTP Connector.

How does Tray.ai authenticate with Mailtrap?

The Mailtrap API uses an API key in a request header and a bearer token. You save it once as a Tray.ai authentication, and the HTTP Connector adds it to every request.

Which Mailtrap events can start a Tray.ai workflow?

Mailtrap sends 8 events to a webhook URL, for example: Email delivered; Email opened; Link clicked; Email bounced; Soft bounce; Spam complaint; Recipient unsubscribed; Email rejected. A Tray.ai webhook trigger receives them and starts a workflow.

See Mailtrap working against your stack.

We'll walk through a tailored demo with your systems plugged in.

Great, a couple more details

This helps us connect you with the right person. Optional, and you can skip it.