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.
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.
Successful Response (Example)
Get a Specific Transport
Fetches the details of a single mail transport using its unique ID.
Path Parameters
{id}
(integer, required): The ID of the transport you want to retrieve.
Successful Response (Example)
Create a Transport
Allows you to add a new mail transport to your Mautic instance.
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 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.
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.
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.
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.
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.
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: