Here is an example PR for adding a new destination:

In this guide, we’ll build a sample destination called SampleDest. When you’re building your own destination, you can swap out the SampleDest name for the real name of your new destination.

  1. Create a directory for the new destination
  2. Define custom destination class
  3. Add main function
  4. Add your destination to the UI (optional)
  5. Test your destination

1. Create a directory for the new destination

In the mage_integrations/destinations/ directory, add a new directory named after your destination. Use snake case and lowercase for your directory name: mage_integrations/destinations/sample_dest/.

In this new directory, create the following subdirectories and files:

  • mage_integrations/destinations/sample_dest/templates/config.json
  • mage_integrations/destinations/sample_dest/
  • mage_integrations/destinations/sample_dest/

The directory structure should look like this:

|   destinations/
|   |   sample_dest/
|   |   |   templates/
|   |   |   |   config.json
|   |   |
|   |   |

Templates folder

This folder contains a sample configuration JSON file that’s displayed to the user when they are setting up a synchronization using this destination.

The config.json file contains keys and values that are used to configure the behavior of the destination as well as credentials to authenticate requests to the destination.

Naming convention

You must use the exact filename config.json.


  "api_key": "",
  "secret_key": ""

This is where majority of the destination logic will exist.



Document how to configure and use your destination in the file.

2. Define custom destination class

In the mage_integrations/destinations/sample_dest/, create a new class named after your destination and subclass the base destination class.

If you’re adding a destination for a SQL data warehouse or database, you can subclass the base sql destination class

from mage_integrations.destinations.base import Destination

class SampleDest(Destination):

Override the export_batch_data method

The base Destination class has an instance method called export_batch_data. Here is the interface:

def export_batch_data(self, record_data: List[Dict], stream: str) -> None:

Override this method to contain the logic for exporting data that is specific to your destination.

3. Add main function

In the file mage_integrations/destinations/sample_dest/, add the main function to the bottom of the file like below:

if __name__ == '__main__':
    destination = SampleDest(

4. Add your destination to the UI (optional)

Add the new destination to the DESTINATIONS list constant in this file:

5. Test your desination

Follow this doc to test your new destination.

To test the destination in the UI, you can install your updated mage_integrations module by running the following commands in Mage terminal:

pip uninstall -y mage_integrations
pip install "git+"