[SalesForce] MC REST API for starting Automation

I am looking for REST API to start Automation. I see following endpoint with POST it helps to create Automation. Is there any REST endpoint to start Automation?

I do see there are SOAP API available to interact with Automation Studio. I am looking for REST API to do the same.

https://{{mcp-subdomain}}.rest.marketingcloudapis.com/automation/v1/automations/

Best Answer

You can not start an automation using REST API. For the time being, you can use the undocumented REST endpoint below to schedule your automation, then you'll have to activate it manually from the UI.

Doing some investigation on the network tab of the browser, It appears that Automation Studio is using some beta REST endpoints that are available only for internal use.. Hope they'll make them public soon.

YOUR_DOMAIN/automation/v1/automations/YOUR_AUTOMATION_OBJECT_ID

The payload should be something like below and play the parameters to change the frequency, count,..

{
  "name": "AUTOMATION_NAME",
  "description": "DESC",
  "key": "YOUR_AUTOMATION_KEY",
  "steps": [],
  "startSource": {
    "typeId": 1,
    "schedule": {
      "iCalRecur": "FREQ=HOURLY;INTERVAL=1;COUNT=1",
      "startDate": "2019-12-06T14:00:00",
      "timeZoneId": 7
    }
  },
  "categoryId": 486
}

Keep in mind that even with SOAP API, I was not able to activate an automation if its already scheduled and in pause status. To activate an automation using SOAP API, you should create the schedule and activate it in the same call.

Related Topic