Hello,
I’m trying to modify a contact’s deals by the API, I don’t know if that’s possible.
I thought that maybe I could achieve it by an automation. What would be the best option of doing this?
Hello,
I’m trying to modify a contact’s deals by the API, I don’t know if that’s possible.
I thought that maybe I could achieve it by an automation. What would be the best option of doing this?
Hi, are you using the v3 or v2 API?
I believe that the contacts endpoint in the v3 API still hasn’t been finished.
Vote on my idea to finish/provide an update on it here:
https://ideas.activecampaign.com/ideas/AC-I-11589
Hi there, Amy from ActiveCampaign’s Customer Experience Team. We’re just refreshing our forum page and I wanted to add some help here for anyone who comes across this page/question/post.
Modifying a contact’s deals via the API is indeed possible with ActiveCampaign. You can use the Deals API to create, update, or delete deals associated with a contact.
Here’s what you’d need to do:
Here’s an example using Python and the requests library:
import requests
url = "https://your-account.api-us1.com/api/3/contacts/123/deals"
headers = {
"Api-Token": "your-api-key"
}
response = requests.get(url, headers=headers)
deals = response.json()
print(deals)
Here’s an example of how you might use the Update a Deal API call to modify a contact’s deal:
import requests
url = "https://your-account.api-us1.com/api/3/deals/{dealId}"
headers = {
"Api-Token": "your-api-key",
"Content-Type": "application/json"
}
payload = {
"deal": {
"id": "123", # Specify the ID of the deal you want to update
"contact_id": "456", # Specify the ID of the contact associated with the deal
"title": "Updated Deal Name",
"value": 1000, # Updated deal value
"stage": 2 # Updated deal stage ID
}
}
response = requests.put(url, headers=headers, json=payload)
print(response.json())
Replace "your-account.api-us1.com"
, "your-api-key"
, {dealId}
, "123"
, "456"
, "Updated Deal Name"
, 1000
, and 2
with your actual data.
This example updates the name, value, and stage of a specific deal associated with a contact.
If API isn’t your thing and you prefer a more automated approach, you can utilise automations. You can create a custom automation that triggers based on certain conditions (e.g., when a contact submits a form or has a tag applied - whichever ‘milestone’ you want them to achieve) and then performs actions to modify the contact’s deals accordingly. To do this you will need to set up:
Using the automation approach can provide more flexibility and scalability, especially if you have multiple milestones or conditions that trigger updates to the contact’s deals. Additionally, in my opinion, it’s just way more user-friendly
Here’s a summary of the steps involved:
Any questions or additional ideas, thread them below!