[API] How to retreiving automation status with contact ID + automation ID?

What would be the best approach to get the automation status of a specific contact.
The automation ID and contact ID are known in my case.

I tried the following endpoint:

But it will list all contactAutomations, which means that I have to loop through all of them. Is there a smarter way?

Just for my confirmation, an contactAutomation is the route a contact has walked through?

1 Like

When you GET to /contactAutomations you will be getting a list of every time the contact has gone through an automation. The contact ID is used in the call url, but you will have to use the automation id to find the automation you’re looking for in your code, because as far as I know there is no way to limit the search to a single automation id. It also may have the automation listed several times, you should use your code to find/display the most recent. The last item in the list of all automations will be the most recent automation this contact has gone through.

You can also try getting “Contact Automation Entry Count” by making a GET call to

https://{{yourAccountName}}.api-us1.com/api/3/contacts/{{contactID}}/automationEntryCounts

You will get back a list of the automations, and the amount of times that contact has been processed through that automation:

For example, a GET call for contact with id of 13 would be to: https://{{yourAccountName}}.api-us1.com/api/3/contacts/13/automationEntryCounts

{
    "automationEntryCounts": [
        {
            "id": "10",
            "name": "Test Automation",
            "status": "1",
            "hidden": "0",
            "contactEntryCount": "1"
        },
        {
            "id": "13",
            "name": "Website Order",
            "status": "1",
            "hidden": "0",
            "contactEntryCount": "5"
        }
    ]
}

The status is if the automation is switched on/active, and the contactEntryCount is the numbers of times contact with id 13 has been processed through. They’ve gone through “test automation” once, and gone through “Website Order” five times.

1 Like

The automationEntryCounts looks like the most compact way to verify if a contact has entered a specific automation.

Many thanks for the detailed information and clear explanation @gsvoboda !

1 Like