The first step is to create a Hightouch API key in your Hightouch workspace settings.
From the API keys tab on the Settings page, select Add API key.
Enter a descriptive Name for your key.
Copy your API key and store it in a safe location. The key will only be displayed once.
Click Create API key.
Your API key provides read/write access to sensitive Hightouch resources and should be kept secure. If you believe your API key may have been compromised, revoke it immediately.
For the Mage extension to trigger syncs via the Hightouch API, you must set the syncs' schedules to Manual.
You can do this by going to the Syncs overview page, selecting the particular sync you want to trigger with Mage, and opening the Schedule tab. Here, make sure the Schedule type is set to Manual. You should do this for each sync you want to trigger with Mage.
You can also find the sync ID on this page, which you need for scheduling syncs in the next step.
You can then trigger a sync with Mage's HightouchClient:
from mage_ai.services.hightouch.hightouch import HightouchClient
client = HightouchClient(config=dict(api_key='api_key'))
syncs = client.list_syncs() # Get all the syncs
sync_id = syncs['data'][0]['id'] # Get sync id
client.sync_and_poll(sync_id) # Trigger sync and poll status