Multiple Transport API
Use the Mautic API to manage your Multiple Transports for advanced email routing and delivery.
The Multiple Transport plugin extends the Mautic API, allowing you to manage your custom mail transports programmatically. This is useful for automation, integration with other systems, or bulk operations.
Base URL
All API endpoints should be prefixed with your Mautic instance URL:
Authentication
All requests require authentication using one of these methods:
- OAuth2: Include the access token in the Authorization header:
Authorization: Bearer YOUR_ACCESS_TOKEN
- Basic Auth: Use your Mautic username and password (if enabled in Configuration > API Settings)
Ensure you have enabled and configured API access in your Mautic settings and have the necessary permissions for multipleTransports
.
Get List of Transports
Retrieves a collection of all configured mail transports.
Full URL
Example cURL Request
Successful Response (Example)
Get a Specific Transport
Fetches the details of a single mail transport using its unique ID.
Full URL
Path Parameters
{id}
(integer, required): The ID of the transport you want to retrieve.
Example cURL Request
Successful Response (Example)
Create a Transport
Allows you to add a new mail transport to your Mautic instance.
Full URL
Request Body Parameters
name
(string, required): The name for the new transport.description
(string, optional): A brief description of the transport’s purpose.mailerDsn
(string, required): The DSN string for the mailer.testedEmailFrom
(string, optional): Email address used for testing.isPublished
(boolean, optional): Whether the transport is enabled.
Example cURL Request
Example Request Body
Successful Response
Returns the newly created transport object, similar to the response for GET /api/multipleTransports/{id}
.
Edit a Transport
Updates an existing mail transport identified by its ID. You only need to send the fields you want to change.
Full URL
Path Parameters
{id}
(integer, required): The ID of the transport to edit.
Request Body Parameters
name
(string, optional): The updated name for the transport.description
(string, optional): The updated description.mailerDsn
(string, optional): The updated DSN string.testedEmailFrom
(string, optional): The updated test email address.isPublished
(boolean, optional): Whether the transport is enabled.
Example Request Body (Updating only the name)
The documentation states that if the transport doesn’t exist, it might create a new one. Please verify this behavior in your Mautic version.
Successful Response Returns the updated transport object.
Delete a Transport
Permanently removes a mail transport from Mautic based on its ID.
Full URL
Path Parameters
{id}
(integer, required): The ID of the transport to delete.
Successful Response Typically returns a success status code (e.g., 200 OK or 204 No Content) and potentially a confirmation message in the response body.
Assign Transport to Email
Assigns a transport to a specific email.
Full URL
Path Parameters
{emailId}
(integer, required): The ID of the email to assign the transport to.
Request Body Parameters
transportId
(integer, required): The ID of the transport to assign.useOwnerTransport
(boolean, optional): Whether to use the owner’s transport.
Example Request Body
Assign Transport to User
Assigns a transport to a specific user.
Full URL
Path Parameters
{userId}
(integer, required): The ID of the user to assign the transport to.
Request Body Parameters
transportId
(integer, required): The ID of the transport to assign.
Example Request Body
Test a Transport
Sends a test email using the specified transport.
Full URL
Path Parameters
{id}
(integer, required): The ID of the transport to test.
Successful Response (Example)
Error Responses
If you use an invalid ID or missing parameters, you may get an error like:
Complete API Examples
Example 1: Create a new transport and assign it to an email
Example 2: Test a transport before using it
Example 3: Update a transport’s DSN
API Path Summary
Operation | Method | Path |
---|---|---|
List all transports | GET | /api/multipleTransports |
Get specific transport | GET | /api/multipleTransports/{id} |
Create transport | POST | /api/multipleTransports/new |
Update transport | PATCH | /api/multipleTransports/{id}/edit |
Delete transport | DELETE | /api/multipleTransports/{id}/delete |
Assign to email | POST | /api/multipleTransport/transportEmail/{emailId} |
Assign to user | POST | /api/multipleTransport/transportUser/{userId} |
Test transport | POST | /api/multipleTransports/send/test/{id} |
Notice that some endpoints use multipleTransport
(singular) while others use multipleTransports
(plural). This is the actual API implementation.