Knowledge Base > Marketing automation > An external system event triggers automation
Let’s say you want to create a sales automation for contacts who signed up for a service with your company, or target contacts with a series of marketing emails after they decide to downgrade their account. With the Custom Event trigger, you can log those events from your system and then use them to trigger an automation through the API interference.
Step 1 – Create automation in inwise
Log in to you inwise account and create new automation (1).
Trigger
Edit the trigger (2), in the field “Trigger type” choose “Custom trigger” (3).
In the field “Identifier” – enter the identification string (text or number). This ID will be used to create a read in your system, for example: Customer_onboarding (4).
Action
Edit the action you wish to take (send SMS/send email/update contact information/update administrator, etc’).
You can edit the delay – sending after X minutes/days – and the filters as well.
You can find more information in this guide about editing automation.
Step 2 – Activate the automation with an API call
Call the POST /automations/customTrigger method from the API interference
Update the automation ID in the parameters as you defined it in the previous step (Customer_onboarding).
In order to include personal fields of contacts in the campaign, you need to update the method as follows:
{
“identifier”:”Customer_onboarding”,
“contact_data”: {
“fields”:[
{“name”:”0″,”content”:””},
{“name”:”1″,”content”:”Michal”},
{“name”:”2″,”content”:”123abc567″}
],
“email”:”TestPackageSentAutomation1@yopmail.com”,
“mobile_number”:”972541111111″,
“external_id”:”00368000009KSWAAA4″}
}
In this guide, you’ll learn how to use the API.
You can also activate API interference through Salesforce and Zapier