Skip to main content
Mailtrap logo
  • Category: developer tools
  • Auth: BEARER_TOKEN
  • Composio-managed OAuth available? N/A
  • Tools: 49
  • Triggers: 0
  • Slug: MAILTRAP
  • Version: 20261101_00

Tools

Slug: MAILTRAP_CLEAN_INBOXTool to clean an inbox in Mailtrap by deleting all messages. Use when you need to remove all emails from an inbox while keeping the inbox itself.

Input Parameters

integer
required
Unique inbox ID to identify the specific inbox to clean.
integer
required
Unique account ID to identify the Mailtrap account.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_CREATE_CONTACTCreate a contact in a Mailtrap account with an email address, optional first and last name fields, and optional contact list assignments.

Input Parameters

object
required
Contact details to create
integer
required
Unique account ID for the Mailtrap account

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_CREATE_CONTACT_EVENTTool to create a contact event in Mailtrap. Use when you need to track custom events associated with a contact for segmentation or automation triggers.

Input Parameters

string
required
Event name (max 255 characters)
object
A hash of string keys and scalar JSON values (string, number, boolean, or null)
integer
required
Unique account ID. You can obtain this from your Mailtrap account settings.
string
required
Contact UUID or Email

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_CREATE_CONTACT_EXPORTTool to create a contact export job for a Mailtrap account. Use when you need to export contacts with filters. The export is processed asynchronously - the response includes a job ID and status. Check the status field; when it becomes ‘finished’, the url field will contain the download link for the exported contacts file. Filters are required - you must specify at least one filter such as subscription_status (subscribed/unsubscribed) or list_id (array of list IDs).

Input Parameters

array
required
Array of filters to apply when exporting contacts. Each filter specifies a field name, operator, and value. Required - must contain at least one filter. Common filters: ‘subscription_status’ (values: ‘subscribed’, ‘unsubscribed’) or ‘list_id’ (array of list IDs).
integer
required
Unique account ID to create the contact export for

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_CREATE_CONTACT_FIELDTool to create a custom contact field in Mailtrap. Use when you need to add new contact attributes for personalization and segmentation in email campaigns.

Input Parameters

string
required
Name of the contact field (max 80 characters)
string ("text" | "integer" | "float" | "boolean" | "date")
required
Data type for the contact field. Choose from: text, integer, float, boolean, or date
string
required
Personalize your campaigns by adding a merge tag. This field will be replaced with unique contact details for each recipient (max 80 characters)
integer
required
Unique account ID

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_CREATE_CONTACT_LISTTool to create a new contact list in Mailtrap. Use when you need to organize contacts into groups or segments. Each contact list has a unique ID and name that can be used to add contacts to it later.

Input Parameters

string
required
Name of the contact list to create. Maximum length is 255 characters.
integer
required
Unique account ID

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_CREATE_EMAIL_TEMPLATETool to create a new email template in Mailtrap account. Use when you need to create a reusable email template with HTML/text content, subject, and category. The template can be used for sending promotional, transactional, or newsletter emails.

Input Parameters

integer
required
Account ID where the email template will be created
object
required
Email template data containing name, subject, category, and optional HTML/text body content. Name, subject, and category are required fields.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_CREATE_SENDING_DOMAINTool to create a new sending domain in Mailtrap. Use when you need to register a domain for sending transactional emails. After creation, DNS records must be configured before the domain can be used for sending.

Input Parameters

integer
required
Account ID where the sending domain will be created
object
required
Object containing the domain configuration

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_DELETE_CONTACTTool to delete a contact from a Mailtrap account. Use when you need to permanently remove a contact by their UUID or email address. The deletion is permanent and cannot be undone.

Input Parameters

integer
required
Unique account ID for the Mailtrap account.
string
required
Contact UUID or email address to identify the contact to delete.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_DELETE_CONTACT_FIELDTool to delete a contact field by its ID. Use when you need to remove a custom contact field from an account.

Input Parameters

integer
required
Unique Contact Field ID to delete
integer
required
Unique account ID where the contact field exists

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_DELETE_CONTACT_LISTDelete a contact list by ID from a Mailtrap account. A 404 response is reported as success, so success does not confirm that a list was deleted.

Input Parameters

integer
required
Unique list ID to delete
integer
required
Unique account ID

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_DELETE_EMAIL_TEMPLATETool to delete an email template from a Mailtrap account. Use when you need to remove an existing email template.

Input Parameters

integer
required
Account ID where the email template is located
integer
required
Email template ID to delete

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_DELETE_PROJECTTool to delete a project from Mailtrap. Use when you need to permanently remove a project and its associated resources. Returns the ID of the deleted project.

Input Parameters

integer
required
Unique account ID to identify the Mailtrap account.
integer
required
Unique project ID to identify the specific project to delete.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_DELETE_SENDING_DOMAINTool to delete a sending domain from a Mailtrap account. Use when you need to remove a domain permanently.

Input Parameters

integer
required
Account ID where the sending domain belongs
integer
required
Sending domain ID to delete

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_GET_BILLING_USAGETool to retrieve current billing cycle usage for an account. Use when you need to check billing information, usage limits, or consumption for Email Sandbox and Email Sending services.

Input Parameters

integer
required
Unique account ID

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_GET_CONTACTTool to retrieve a contact by UUID or email address from Mailtrap. Use when you need to fetch details of a specific contact including their subscription status, lists, and custom fields.

Input Parameters

integer
required
Unique account ID for the Mailtrap account
string
required
Contact UUID or Email address to identify the contact

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_GET_CONTACT_EXPORTRetrieve the status of a contact export and its download URL when available.

Input Parameters

integer
required
Unique Contact Export ID to retrieve.
integer
required
Unique account ID for the Mailtrap account.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_GET_CONTACT_FIELDTool to retrieve contact field details by field ID. Use when you need to get information about a specific custom field in your contacts.

Input Parameters

integer
required
Unique Contact Field ID
integer
required
Unique account ID

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_GET_CONTACT_IMPORTTool to retrieve the status of a contact import operation. Use when you need to check the progress or completion status of a contact import. Use after initiating a contact import to monitor its status and retrieve statistics once finished.

Input Parameters

integer
required
Unique Contact Import ID for the import operation to retrieve.
integer
required
Unique account ID for the Mailtrap account.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_GET_CONTACT_LISTTool to retrieve a specific contact list by its ID. Use when you need to fetch details about a contact list in a Mailtrap account.

Input Parameters

integer
required
Unique list ID
integer
required
Unique account ID

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_GET_EMAIL_TEMPLATETool to retrieve details of a specific email template by ID. Use when you need to fetch template content, metadata, or configuration for an existing email template.

Input Parameters

integer
required
Account ID
integer
required
Email template ID

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_GET_INBOXTool to retrieve inbox attributes from Mailtrap. Use when you need to get details about a specific inbox including its configuration, statistics, and permissions.

Input Parameters

integer
required
Unique inbox ID to identify the specific inbox.
integer
required
Unique account ID to identify the Mailtrap account.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_GET_MESSAGE_HTMLTool to retrieve the HTML body of a message from Mailtrap. Use when you need to get the formatted HTML content of a specific email message.

Input Parameters

integer
required
Unique inbox ID to identify the specific inbox
integer
required
Unique account ID to identify the Mailtrap account
integer
required
Unique message ID to identify the specific message

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_GET_PERMISSION_RESOURCESTool to retrieve all resources in account for permission management. Use when you need to see the hierarchical structure of projects, inboxes, and other resources with their access levels for the current authentication token.

Input Parameters

integer
required
Unique account ID for which to retrieve permission resources.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_GET_PROJECTTool to retrieve project details from Mailtrap by project ID. Use when you need to get information about a specific project including its inboxes, permissions, and share links.

Input Parameters

integer
required
Unique account ID to identify the Mailtrap account.
integer
required
Unique project ID to identify the specific project.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_GET_SENDING_DOMAINTool to retrieve sending domain details from Mailtrap. Use when you need to check domain configuration, DNS verification status, or tracking settings.

Input Parameters

integer
required
Account ID
integer
required
Sending domain ID

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_GET_SENDING_STATSTool to retrieve email sending statistics from Mailtrap for a specific account. Use when you need metrics like delivery rate, bounce rate, open rate, click rate, and spam rate for a date range.

Input Parameters

string
required
End date for which to include the results, in YYYY-MM-DD format.
integer
required
Account ID for which to retrieve sending statistics.
array
Categories for which to include the results. If not provided, results for all categories will be included.
string
required
Start date for which to include the results, in YYYY-MM-DD format.
array
Sending streams for which to include the results. If not provided, results for all sending streams will be included.
array
IDs of the sending domains for which to include the results. If not provided, results for all sending domains will be included.
array
Email service providers for which to include the results. If not provided, results for all ESPs will be included.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_GET_SENDING_STATS_BY_CATEGORIESTool to retrieve email sending statistics grouped by categories. Use when you need to analyze email performance metrics (delivery, bounce, open, click, spam rates) segmented by email categories within a date range.

Input Parameters

string
required
End date for the statistics period in YYYY-MM-DD format
integer
required
Account ID for which to retrieve statistics
array
Email categories to filter results. If not provided, results for all categories will be included.
string
required
Start date for the statistics period in YYYY-MM-DD format
array
Sending streams to filter results (e.g., transactional, bulk). If not provided, results for all sending streams will be included.
array
IDs of the sending domains to filter results. If not provided, results for all sending domains will be included.
array
Email service providers to filter results (e.g., Google, Yahoo). If not provided, results for all ESPs will be included.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_GET_SENDING_STATS_BY_DATETool to retrieve email sending statistics aggregated by date. Use when you need to analyze email delivery performance, bounce rates, open rates, click rates, and spam rates for a specific date range.

Input Parameters

string
required
End date for which to include the results in YYYY-MM-DD format
integer
required
Account ID for which to retrieve sending statistics
array
Categories for which to include the results. If not provided, results for all categories will be included.
string
required
Start date for which to include the results in YYYY-MM-DD format
array
Sending streams for which to include the results. If not provided, results for all sending streams will be included.
array
IDs of the sending domains for which to include the results. If not provided, results for all sending domains will be included.
array
Email service providers for which to include the results. If not provided, results for all ESPs will be included.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_GET_SENDING_STATS_BY_DOMAINSTool to retrieve sending statistics grouped by domains for a Mailtrap account. Use when you need email delivery, bounce, open, click, and spam metrics broken down by sending domain for a specific date range. Supports filtering by domain IDs, sending streams, categories, and email service providers.

Input Parameters

string
required
End date for which to include the results in YYYY-MM-DD format.
integer
required
Account ID for which to retrieve sending stats.
array
Categories for which to include the results. If not provided, results for all categories will be included.
string
required
Start date for which to include the results in YYYY-MM-DD format.
array
Sending streams for which to include the results. If not provided, results for all sending streams will be included. Common values: transactional, bulk.
array
IDs of the sending domains for which to include the results. If not provided, results for all sending domains will be included.
array
Email service providers for which to include the results. If not provided, results for all ESPs will be included. Common values: Google, Yahoo, Microsoft, etc.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_GET_SENDING_STATS_BY_ESPTool to retrieve email sending statistics grouped by email service providers (ESPs) for a specified date range. Returns delivery, bounce, open, click, and spam metrics for each ESP. Use when you need to analyze email performance across different email providers like Google, Yahoo, Microsoft, etc.

Input Parameters

string
required
End date for which to include the results in YYYY-MM-DD format
integer
required
Account ID for which to retrieve statistics
array
Categories for which to include the results. If not provided, results for all categories will be included.
string
required
Start date for which to include the results in YYYY-MM-DD format
array
Sending streams for which to include the results. If not provided, results for all sending streams will be included.
array
IDs of the sending domains for which to include the results. If not provided, results for all sending domains will be included.
array
Email service providers for which to include the results. If not provided, results for all ESPs will be included.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_IMPORT_CONTACTSTool to import contacts in bulk to Mailtrap. Use when you need to add or update multiple contacts at once. The import operation is asynchronous and returns a job ID that can be used to check the status later.

Input Parameters

array
required
List of contacts to import. Each contact must have an email address and can have optional custom fields and list associations.
integer
required
Unique account ID for the Mailtrap account.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_LIST_ACCOUNTSTool to list all Mailtrap accounts you have access to. Use when you need to retrieve account information or get account IDs for other operations. Returns account ID, name, and access levels (1000=owner, 100=admin, 10=viewer).

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_LIST_CONTACT_FIELDSTool to get all contact fields for a Mailtrap account. Use when you need to retrieve custom field definitions for contacts.

Input Parameters

integer
required
Unique account ID for the Mailtrap account.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_LIST_CONTACT_LISTSTool to retrieve all contact lists for a Mailtrap account. Use when you need to view available contact lists or obtain contact list IDs for other operations.

Input Parameters

integer
required
Unique account ID. You can obtain this from your Mailtrap account settings.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_LIST_EMAIL_TEMPLATESTool to retrieve all email templates for a Mailtrap account. Use when you need to list available templates, browse template configurations, or find a specific template by name or attributes.

Input Parameters

integer
required
Account ID

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_LIST_INBOXESTool to get a list of inboxes for a Mailtrap account. Use when you need to retrieve all inboxes associated with an account ID. Returns the list of inboxes with their configuration, permissions, and statistics.

Input Parameters

integer
required
Unique account ID to list inboxes for

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_LIST_MESSAGESTool to get messages from a Mailtrap inbox. Use when you need to retrieve emails from a specific inbox, with support for search filtering and pagination. Returns up to 30 messages per request.

Input Parameters

integer
Page number for pagination (30 messages per page). Use this for offset-based pagination.
Filter emails by subject, to_email, or to_name (case insensitive). Use this to search for specific messages.
integer
Get messages with ID less than this value for cursor-based pagination. Alternative to page parameter.
integer
required
Unique inbox ID to identify the specific inbox
integer
required
Unique account ID to identify the Mailtrap account

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_LIST_PROJECTSTool to get a list of projects for a Mailtrap account. Use when you need to retrieve all projects and their associated inboxes for a specific account. Returns project attributes, permissions, and nested inbox information.

Input Parameters

integer
required
Unique account ID to list projects for

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_LIST_SENDING_DOMAINSTool to list all sending domains for a Mailtrap account. Use when you need to retrieve configured domains for email sending.

Input Parameters

integer
required
Account ID to list sending domains for

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_LIST_SUPPRESSIONSTool to list suppressed email addresses for a Mailtrap account. Use when you need to view which emails are blocked from receiving messages due to bounces, complaints, unsubscribes, or manual suppression.

Input Parameters

string
Search for a specific email address. Use this to check if a particular email is suppressed.
string
Search emails suppressed before this timestamp in ISO 8601 format (e.g., 2025-12-31T23:59:59Z).
integer
required
Account ID to list suppressions for. This is your Mailtrap account identifier.
string
Search emails suppressed after this timestamp in ISO 8601 format (e.g., 2025-01-01T00:00:00Z).

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_MARK_INBOX_AS_READTool to mark all messages in a Mailtrap inbox as read. Use when you need to mark all unread messages as read in a specific inbox.

Input Parameters

integer
required
Unique inbox ID to identify the specific inbox
integer
required
Unique account ID to identify the Mailtrap account

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_RESET_INBOX_CREDENTIALSTool to reset SMTP credentials for a Mailtrap inbox. Use when you need to regenerate the username and password for inbox access.

Input Parameters

integer
required
Unique inbox ID to identify the specific inbox.
integer
required
Unique account ID to identify the Mailtrap account.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_UPDATE_CONTACTTool to update an existing contact in Mailtrap. Use when you need to modify contact details such as email, custom fields, list memberships, or subscription status. If the contact doesn’t exist, it will be created.

Input Parameters

object
required
Contact data to update. At least one field must be provided
integer
required
Unique account ID
string
required
Contact UUID or Email address

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_UPDATE_CONTACT_FIELDTool to update a contact field in Mailtrap. Use when you need to modify the name or merge tag of an existing contact field.

Input Parameters

string
Name of the contact field
integer
required
Unique Contact Field ID
string
Personalize your campaigns by adding a merge tag. This field will be replaced with unique contact details for each recipient.
integer
required
Unique account ID

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_UPDATE_CONTACT_LISTTool to update a contact list’s name in Mailtrap. Use when you need to rename an existing contact list.

Input Parameters

string
required
New name for the contact list. Maximum length is 255 characters.
integer
required
Unique list ID
integer
required
Unique account ID

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_UPDATE_EMAIL_TEMPLATETool to update an existing email template in Mailtrap account. Use when you need to modify template properties such as name, subject, category, HTML body, or plain text body. All fields in the email_template object are optional - only provide the fields you want to update.

Input Parameters

integer
required
Account ID to which the email template belongs
object
required
Email template data containing fields to update. At least name, subject, and category are required.
integer
required
Email template ID to update

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_UPDATE_INBOXTool to update an inbox’s settings in Mailtrap. Use when you need to change the inbox name or email username.

Input Parameters

object
required
Inbox data to update. Provide at least one field (name or email_username) to update.
integer
required
Unique inbox ID
integer
required
Unique account ID

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: MAILTRAP_UPDATE_PROJECTTool to update a project’s name in Mailtrap. Use when you need to rename an existing project.

Input Parameters

object
required
Project data to update. Must provide the new project name.
integer
required
Unique account ID
integer
required
Unique project ID

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not