Skip to content
Changelog

Report a bug

Mailtrap integration: operations for AI agents

Mailtrap connects to Type.com as an integration. This page lists the 138 operations documented for Claude and Codex in Type.com: 62 read, 53 write, 23 destructive.

About Mailtrap

Email Delivery Platform for testing and sending transactional emails

Categories: Developer Tools & IT

How to connect Mailtrap to Type.com

Access
Organization connection: one shared account for the workspace.

To add the connection, follow the steps in Space connections.

Documented operations

138 operations. Your connection's permissions determine which operations are available. API references describe the vendor surface; they do not expand your connection's credentials or access.

138 operations listed.

Accounts

  • Read

    List account(s) you have access to

    This endpoint returns account details for the authenticated user. If you are using Organizations and Sub-Accounts and the API token was created at the organization level, the response will include all accounts within the organization.

Account Accesses

  • Read

    List User & Invite account accesses

    Get list of account accesses for which specifiertype is User or Invite. You have to have account admin/owner permissions for this endpoint to work. If you specify projectids, sandboxids or domainids, the endpoint will return account accesses for these resources.

  • Destructive

    Remove account access

    If specifier type is User, it removes user permissions. If specifier type is Invite or ApiToken, it removes specifier along with permissions. You have to be an account admin/owner for this endpoint to work.

Permissions

  • Read

    Get resources

    Get all resources in your account (Sandboxes, Projects, Domains, Email Campaigns, Billing and Account itself) to which the token has admin access.

  • Destructive

    Manage user or token permissions

    Manage user or token permissions. For this endpoint, you should send an array of objects (in JSON format) as the body of the request. If you send a combination of resourcetype and resourceid that already exists, the permission is updated.

API Tokens

  • Read

    List API tokens

    Returns all API tokens visible to the current API token.

  • Read

    Get API token

    Returns a single API token by id.

  • Write

    Create API token

    Creates a new API token for the account with the given name and resource permissions. Unless expiresat is provided, the token expires 1 year after creation. Pass "expiresat": null to create a token that never expires.

  • Write

    Reset API token

    Expires the requested token and creates a new token with the same permissions. The old token stops working after a short grace period. The response includes the new token value (store it securely; it is only returned once).

  • Destructive

    Delete API token

    Permanently deletes an API token.

Billing

  • Read

    Get current billing cycle usage

    Get current billing cycle usage for Email Sandbox, Email Sending (Email API/SMTP), and Email Marketing.

Organizations

  • Read

    Get organization sub accounts

    Get a list of sub accounts for the specified organization. You must have sub account management permissions for this organization.

  • Write

    Create organization sub account

    Create a new sub account under the specified organization. You must have sub account management permissions for this organization.

Contacts

  • Read

    Get a list of contacts

    Returns a paginated list of the account's contacts. Pagination is cursor based. Every response carries a pagination object; pass its nexttoken value back as the token query parameter to fetch the next page, and stop when nexttoken is null.

  • Read

    Get contact

    Get contact using UUID or email (URL encoded)

  • Write

    Create a new Contact

    Create a new contact

  • Write

    Update contact

    Update contact using UUID or email (URL encoded)

  • Destructive

    Delete contact

    Delete contact using UUID or email (URL encoded)

Contact Events

  • Write

    Create contact event

    Submit custom event for contact

Export Contacts

  • Read

    Get Contact Export

    Get Contact Export

  • Write

    Create Contact Export

    Create a new Contact Export

Bulk Import

  • Read

    Get Contact Import

    Get Contact Import

  • Write

    Import contacts

    Import contacts in bulk with support for custom fields and list management. Existing contacts with matching email addresses will be updated automatically. You can import up to 50,000 contacts per request.

Contact Lists

  • Read

    Get all Contact Lists

    Get all contact lists existing in your account

  • Read

    Get Contact List

    Get a contact list by ID

  • Write

    Create Contact List

    Create new Contact Lists

  • Write

    Update Contact List

    Update existing Contact List

  • Destructive

    Delete Contact List

    Delete existing Contact List

Contact Fields

  • Read

    Get all Contact Fields

    Get all Contact Fields existing in your account

  • Read

    Get Contact Field

    Get a contact Field by ID

  • Write

    Create Contact Field

    Create new Contact Fields. Please note, you can have up to 40 fields.

  • Write

    Update Contact Field

    Update existing Contact Field. Please note, you cannot change datatype of the field.

  • Destructive

    Delete Contact Field

    Delete existing Contact Field Please, note, you cannot delete a Contact Field which is used in Automations, Email Campaigns (started or scheduled), and in conditions of Contact Segments (you'll see the corresponding error)

Email Campaigns

  • Read

    Get a list of email campaigns

    Returns a paginated list of the account's email campaigns, newest first. Pagination is page-token based. Use the token query parameter together with the token, nexttoken, and prevtoken values returned in the pagination object to navigate between pages.

  • Read

    Get an email campaign by ID

    Returns a single email campaign.

  • Write

    Create an email campaign

    Creates a new email campaign. The campaign must reference an existing sending domain via domainid, and include a template subject within templateattributes.

  • Write

    Update an email campaign

    Updates an existing draft campaign. Only the provided attributes are changed.

  • Write

    Start an email campaign

    Starts sending a draft campaign immediately. Runs full sending validation (the template must have a bodyhtml design, the audience and verified sending domain must be set, billing within limits); on failure the request returns 422 and the campaign stays a draft.

  • Write

    Schedule an email campaign

    Schedules a draft campaign to start sending at a future time. Runs full sending validation (the template must have a bodyhtml design, the audience and verified sending domain must be set, billing within limits); on failure the request returns 422 and the campaign stays a draft.

  • Write

    Terminate a sending email campaign

    Terminates a campaign that is currently sending, aborting the in-flight send. The campaign must be in a sending state (started, queued, or paused) — terminating from any other state returns 422.

  • Write

    Reset an email campaign to draft

    Resets a campaign back to the draft state. Allowed only from the scheduled state; resetting from any other state (e.g. a sending or terminal state) returns 422.

  • Destructive

    Delete an email campaign

    Soft-deletes an email campaign. Returns 204 No Content on success. Only draft campaigns can be deleted — deleting a campaign that is already scheduled/sending returns 422. A campaign that has been started never returns to draft, so it can no longer be deleted.

  • Destructive

    Cancel a scheduled email campaign

    Cancels a scheduled campaign, removing the pending send job and returning the campaign to the draft state. The campaign must be in the scheduled state — cancelling from any other state returns 422 ("Campaign is not scheduled").

Campaign Stats

  • Read

    Get email campaign statistics

    Returns aggregated performance metrics for a single campaign: counts and rates for deliveries, opens, clicks, bounces, spam complaints, and unsubscriptions. If the campaign has never been started, all counts and rates are returned as 0.

Domains

  • Read

    List domains

    Get all domains and their verification status

  • Read

    Get domain

    Get details and verification status of a specific domain

  • Read

    Get company info

    Get company information associated with a domain / account.

  • Write

    Create domain

    Create a domain for email authentication. After creation, verify the domain by adding DNS records. Process: 1. Create the domain 2. Add DNS records (SPF, DKIM, DMARC) 3. Verify the records 4. Start sending emails

  • Write

    Update domain

    Update configuration settings for a domain.

  • Write

    Send setup instructions

    Email DNS configuration instructions for the domain

  • Write

    Create company info

    Create company information for a domain / account. Company info is required for domain compliance verification.

  • Write

    Update company info

    Update company information for a domain / account. All fields are optional; only the fields provided in the request will be updated.

  • Destructive

    Delete domain

    Remove a domain from your account

Suppressions

  • Read

    List suppressions

    List and search suppressed email addresses. Returns up to 1000 suppressions per request. Use lastid for cursor-based pagination through large lists. Suppressed addresses will not receive any emails from your account. Rate limit: 10 requests per minute per account.

  • Write

    Create suppression

    Add an email address to the suppression list. Suppressed addresses will not receive any emails from your account. {% hint style="warning" %} This endpoint requires admin-level access. {% endhint %} Rate limit: 10 requests per minute per account.

  • Destructive

    Delete suppression

    Remove an email from the suppression list to allow sending again. {% hint style="warning" %} This endpoint requires admin-level access. {% endhint %}

Tracking opt outs

  • Read

    List tracking opt-outs

    List email addresses that have opted out of open and click tracking for your sending domains. Each record includes the domain it applies to. Returns up to 1000 records per request.

  • Write

    Create tracking opt-out

    Add an email address to the tracking opt-out list for a sending domain. Opted-out addresses are excluded from open and click tracking on that domain. {% hint style="warning" %} This endpoint requires admin-level access.

  • Destructive

    Delete tracking opt-out

    Remove an email address from the tracking opt-out list so open and click tracking can apply again. {% hint style="warning" %} This endpoint requires admin-level access. {% endhint %}

Stats

  • Read

    Get Sending Stats

    Get account sending stats. Use filters to get specific stats.

  • Read

    Get Sending Stats by Domains

    Get account sending stats by domains. Use filters to get specific stats.

  • Read

    Get Sending Stats by Categories

    Get account sending stats by categories. Use filters to get specific stats.

  • Read

    Get Sending Stats by Email Service Providers

    Get account sending stats by email service providers. Use filters to get specific stats.

  • Read

    Get Sending Stats by Date

    Get account sending stats by date. Use filters to get specific stats.

Email logs

  • Read

    List email logs

    Returns a paginated list of email logs (messages) for the account. Results are restricted to domains the authenticated token has access to. Invalid or unknown filters are ignored. Results are ordered by sentat descending.

  • Read

    Get an email log message by ID

    Returns a single message by message UUID. Message must belong to the account and a domain the token can access.

Webhooks

  • Read

    List webhooks

    Returns all webhooks for the account.

  • Read

    Get a webhook

    Returns a single webhook by ID.

  • Write

    Create a webhook

    Create a new webhook for the account. The response includes a signingsecret that is used to verify webhook signatures.

  • Write

    Update a webhook

    Update an existing webhook.

  • Destructive

    Delete a webhook

    Permanently delete a webhook.

Send email

  • Write

    Send bulk email

    Send marketing emails and newsletters through the bulk stream optimized for high-volume sending. Use cases: - Marketing campaigns - Newsletters - Announcements - Promotional emails

Test Emails

  • Write

    Batch send email (including templates)

    Batch send email (text, html, text&html, templates). Please note that the endpoint will return a 200-level http status, even when sending for individual messages may fail.

  • Write

    Send email (including templates)

    Send email message to the specified sandbox.

Folders

  • Read

    List folders

    Returns the inbound folders in the account that the API token has access to, oldest first. Folders the token can reach only through an inbox-level permission are not included. The list is not paginated.

  • Read

    Get a folder

    Returns a single inbound folder.

  • Write

    Create a folder

    Create a new inbound folder.

  • Write

    Update a folder

    Update an inbound folder.

  • Destructive

    Delete a folder

    Permanently delete an inbound folder along with all of its inboxes, including their inboundreceiving webhooks and forward rules. Requires admin access to the folder.

Inboxes

  • Read

    List inboxes

    Returns the inboxes in a folder that the API token has access to, oldest first. The list is not paginated. Returns 404 when the token has no access to the folder itself.

  • Read

    Get an inbox

    Returns a single inbox.

  • Write

    Create an inbox

    Create a new inbox in a folder. Requires admin access to the folder. An account can have at most 300 inboxes. By default Mailtrap generates the inbox address automatically based on the name.

  • Write

    Update an inbox

    Rename an inbox. Only name can be changed: address and domainid are fixed at creation, and a domainid sent here is ignored.

  • Destructive

    Delete an inbox

    Permanently delete an inbox and all its received messages.

Messages

  • Read

    List messages

    Returns inbound messages received by the inbox within your account's log retention window, ordered by receivedat descending, up to 100 per page. List responses use cursor pagination.

  • Read

    Get a message

    Returns a single inbound message together with URLs for the raw .eml file and for each attachment, plus the decoded HTML and plain-text bodies. URLs expire after one hour.

  • Read

    Show email message

    Get email message by ID.

  • Read

    Get messages

    Get all messages in the sandbox. The response contains up to 30 messages. Use lastid or page to retrieve more.

  • Read

    Get message spam score

    Get a brief spam report by message ID.

  • Read

    Get message HTML analysis

    Get a brief HTML report by message ID.

  • Read

    Get text message

    Get text email body, if it exists.

  • Read

    Get raw message

    Get raw email body.

  • Read

    Get message source

    Get the HTML body of an email as it was sent. Not applicable for plain text emails.

  • Read

    Get HTML message

    Get the HTML body of an email, sanitized for preview. Not applicable for plain text emails. The response is not the email as it was sent. Mailtrap changes it as follows: - The response is always a full HTML document with html, head and body elements.

  • Read

    Get message as .eml

    Get email message in .eml format.

  • Read

    Get mail headers

    Get mail headers of a message

  • Write

    Reply to a message

    Send a reply to an inbound message. The reply is threaded to the original and its subject is prefixed with Re: (unless it already starts with one). By default the reply is addressed to the original sender (its Reply-To, or From when absent).

  • Write

    Reply all to a message

    Send a reply to an inbound message and copy the original's other recipients. Behaves exactly like the Reply to a message operation, except cc defaults to the original's To + Cc — minus the inbox's own addresses and the sender (already in To).

  • Write

    Forward a message

    Forward an inbound message to new recipients. The subject is prefixed with Fwd: (unless it already starts with one).

  • Write

    Update message

    Update message attributes (right now only the isread attribute is available for modification).

  • Write

    Forward message

    Forward message to an email address. The email address must be confirmed by the recipient in advance.

  • Destructive

    Delete a message

    Permanently delete an inbound message and its stored body and attachments.

  • Destructive

    Delete message

    Delete message from sandbox.

Threads

  • Read

    List threads

    Returns the inbox's conversation threads, ordered by most recent activity first.

  • Read

    Get a thread

    Returns a single thread with its messages embedded, ordered oldest first. Each message carries a visibilitystatus: - available — the message is within your plan's retention window. The full envelope, subject, RFC headers, decoded bodies, and attachment download URLs are included.

  • Destructive

    Delete a thread

    Delete a thread. The thread stops appearing in list and get responses immediately; the inbound messages it contains are then deleted in the background. Sent messages are not deleted.

Forward rules

  • Read

    List forward rules

    Returns the inbox's forward rules, ordered by creation (oldest first). The list is not paginated; an inbox holds at most 5 rules.

  • Read

    Get a forward rule

    Returns a single forward rule with its conditions and destinations.

  • Write

    Create a forward rule

    Create a forward rule on the inbox. The rule, its conditions, and its destinations are validated and saved together: if any part is invalid, nothing is created. An inbox can have at most 5 forward rules; each rule can have at most 5 conditions and 5 destinations.

  • Write

    Update a forward rule

    Partially update a forward rule. Only the fields present in the request are changed: - name renames the rule. - conditions, when present, replaces the whole condition set. An empty array removes every condition, so the rule matches all messages.

  • Destructive

    Delete a forward rule

    Permanently delete a forward rule along with its conditions and destinations. Messages already forwarded are not affected.

Sandboxes

  • Read

    Get a list of sandboxes

    Get a list of sandboxes.

  • Read

    Get sandbox attributes

    Get sandbox attributes by sandbox id. See the list of attributes in the example

  • Write

    Create a sandbox

    Create a sandbox in a project.

  • Write

    Update a sandbox

    Update sandbox name, sandbox email username.

  • Write

    Mark as read

    Mark all messages in the sandbox as read.

  • Write

    Reset credentials

    Reset SMTP credentials of the sandbox.

  • Write

    Enable email address

    Turn the email address of the sandbox on/off.

  • Write

    Reset email address

    Reset username of email address per sandbox.

  • Destructive

    Delete a sandbox

    Delete a sandbox with all its emails.

  • Destructive

    Clean sandbox

    Delete all messages (emails) from sandbox.

Projects

  • Read

    Get a list of projects

    List projects and their sandboxes to which the API token has access.

  • Read

    Get project by ID

    Get the project and its sandboxes.

  • Write

    Create project

    The project name is min 2 characters and max 100 characters long.

  • Write

    Update project

    Update project name. The project name is min 2 characters and max 100 characters long.

  • Destructive

    Delete project

    Delete project and its sandboxes.

Attachments

  • Read

    Get attachments

    Get message attachments by sandboxid and messageid.

  • Read

    Get single attachment

    Get message single attachment by id.

Templates

  • Read

    Get all Email Templates

    Get all email templates existing in your account, as a single unpaginated array. If your account holds enough templates for the response size to matter, see the experimental GET /api/templates, which returns the same templates one page at a time.

  • Read

    Get Email Template

    Get an email template by ID

  • Read

    Get a paginated list of Email Templates (Experimental)

    Returns a paginated list of the email templates in your account. {% hint style="warning" %} This endpoint is experimental. Its parameters and response shape may change before it is generally available. GET /api/emailtemplates remains the stable way to list templates.

  • Read

    Get Email Template (Experimental)

    Returns a single email template in a data envelope. {% hint style="warning" %} This endpoint is experimental. Its parameters and response shape may change before it is generally available. GET /api/emailtemplates/{emailtemplateid} remains the stable way to read a template.

  • Write

    Create Email Template

    Create a new email template

  • Write

    Update Email Template

    Update an email template

  • Write

    Create Email Template (Experimental)

    Creates an email template and returns it in a data envelope. {% hint style="warning" %} This endpoint is experimental. Its request and response shapes may change before it is generally available. POST /api/emailtemplates remains the stable way to create a template.

  • Write

    Update Email Template (Experimental)

    Updates an email template and returns it in a data envelope. PUT is accepted on the same path and behaves identically. {% hint style="warning" %} This endpoint is experimental. Its request and response shapes may change before it is generally available.

  • Destructive

    Delete Email Template

    Delete an email template

  • Destructive

    Delete Email Template (Experimental)

    Deletes an email template. {% hint style="warning" %} This endpoint is experimental. DELETE /api/emailtemplates/{emailtemplateid} remains the stable way to delete a template. {% endhint %}

See How connections work for access and permissions, or browse all integrations.