canonical: https://jentic.com/apis/mailtrap.io

# Mailtrap APIs

Mailtrap is a transactional email platform. Its APIs cover the full send-and-manage loop: delivering single or batched transactional messages, and managing the operational surface around them such as sending domains, suppression lists, account sending statistics, and per-message delivery logs. Together they let an agent send email and keep deliverability healthy without switching to the Mailtrap dashboard.

## For AI agents

An agent can send single or batched transactional emails through Mailtrap and manage the deliverability surface around them: registering sending domains and reading their DNS records, cleaning suppression lists, pulling account sending statistics, and looking up the delivery log for a specific message.

## Scope

Use for: Sending transactional email through Mailtrap and managing the deliverability surface around it: sending domains, suppression lists, account statistics, and message delivery logs.

Not supported:
- inbox email testing
- marketing contact lists
- campaign automation
- inbound email parsing
- real-time webhooks

## APIs

| API | Category | Endpoints | Description |
| --- | --- | --- | --- |
| Mailtrap Email Sending API | communications | 9 | Manage Mailtrap sending domains, suppressions, and email logs. |
| Mailtrap API | communications | 2 | Send a single transactional email or a batch of messages through Mailtrap. |

## Which API to use

| Need | API | Why |
| --- | --- | --- |
| Deliver a single or batched transactional email | main | The send surface with POST /send and POST /batch for one message or many personalised messages in one call. |
| Register sending domains, clean suppressions, read stats, or inspect delivery logs | mailtrap-api | The management surface for the operational work around sending, including domain DNS records and per-message log lookup. |

## Cross-API use cases

### Send then verify delivery

An agent sends a transactional email and immediately confirms its fate. It calls the send endpoint, captures the returned message ID, then queries the delivery log for that message to report status, recipient, and timestamps back to the user.

Example prompt: POST /send with the message, capture the returned sending message ID, then call GET /api/accounts/{account_id}/email_logs/{sending_message_id} and summarise the delivery status.

### Onboard a domain then send from it

An agent brings a new sending domain online and starts using it. It registers the domain, surfaces the SPF and DKIM records for the user to publish, polls for verification, then sends a first transactional message once the domain is verified.

Example prompt: POST /api/accounts/{account_id}/sending_domains, return the DNS records, confirm verification via the domain GET endpoint, then POST /send from the verified domain.

### Bounce cleanup then resend

An agent remediates a recipient who was suppressed in error and completes the delivery. It finds the suppression entry, deletes it to re-enable sending, then sends the pending message to that recipient.

Example prompt: List suppressions, DELETE the entry matching the address, then POST /send to deliver the pending message to that recipient.

## Why Jentic

- **Setup:** Wiring Mailtrap by hand means tracking two hosts and their send, domain, suppression, stats, and log endpoints, and passing your token on every call. Through Jentic you install Jentic One once, add Mailtrap from the Jentic directory, store the token once, and your agent calls both surfaces.
- **Permission scoping:** The account and object IDs sit in the management API URL paths, so a rule can pin your agent to one account, and you choose which operations it may call. Sending stays separate from destructive management calls like deleting a domain or suppression unless you add them.
- **Credential handling:** Your Mailtrap API token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search the Jentic directory by intent such as send a transactional email or read email logs, and Jentic returns the matching Mailtrap operation with its input schema so the agent calls the right endpoint across both APIs.

## Related vendors

- **SendGrid** — Transactional email provider with comparable sending, suppression, and stats surfaces.
- **Postmark** — Transactional email API with a similar domain, suppression, and message-event model.
- **Brevo** — Covers transactional sending alongside marketing contact and campaign management.
- **Mailsac** — Disposable inboxes for asserting that Mailtrap sends actually arrive in QA.

## FAQ

### What can an agent do across the Mailtrap APIs?

An agent can send single or batched transactional emails, register and audit sending domains, clean suppression lists, pull account sending statistics, and look up the delivery log for any message it has sent, all on the same Mailtrap account.

### How do the two Mailtrap APIs fit together?

The send API delivers messages and returns a message ID for each one. The management API handles the operational work around that: onboarding sending domains, removing suppressions, reporting stats, and resolving a message ID into a full delivery log.

### Do I need separate credentials for each Mailtrap API?

No. A single Mailtrap API token works across both the send and management surfaces, so an agent configured with one credential can both deliver mail and manage deliverability.

### Can an agent send an email and then confirm it was delivered?

Yes. It sends through the send API, captures the returned sending message ID, then queries that ID against the management API email-logs endpoint to read delivery status, recipient, and event timestamps.

### Does Mailtrap handle marketing campaigns or contact lists?

These APIs are scoped to transactional email and its deliverability surface. They do not manage marketing contact lists or campaign automation, so pair Mailtrap with a marketing platform if you need those.

### How does an agent pick the right Mailtrap operation?

Through Jentic the agent searches by intent, such as send a transactional email or list sending domains, and Jentic returns the matching Mailtrap operation with its input schema so the agent calls the correct endpoint without reading the reference docs.
