APIs & Integrations

JamiesonC
Participant

[SOLVED] Does the "versions" array on Deal properties contain the whole history?

I’m looking at output from “Get Recently Modified Deals” (/deals/v1/deal/recent/modified). I notice that every Deal property has a “versions” array, but it seems to only include the most recent value/timestamp for the property.

For instance, I would like to be able to retrieve the entire history of the “dealstage” property to analyze the average time to transition from one stage to the next. Unfortunately, the “versions” array is only showing me the most recent value of “dealstage”.

Example:

"dealstage": {
    "value": "fafa19d9-3171-4a27-a761-f67a0afdb47a",
    "timestamp": 1471881872927,
    "source": "CRM_UI",
    "sourceId": "Some.User@domain.com",
    "versions": [{
        "name": "dealstage",
        "value": "fafa19d9-3171-4a27-a761-f67a0afdb47a",
        "timestamp": 1471881872927,
        "sourceId": "Some.User@domain.com",
        "source": "CRM_UI",
        "sourceVid": []
    }]
},

This deal was originally created by a workflow. I should be able to see at least 2 entries here: the original dealstage set by the workflow, and the change to the dealstage that was made by a user via the UI. As shown above, I can only see the latest version of dealstage that was set by the user.

This phenomenon also applies to “Get a Deal” calls (/deals/v1/deal/:dealId). Even when retrieving a single Deal, the “versions” array only seems to include the most recent value of a property.

Am I thinking about the “versions” array incorrectly? Or retrieving the Deal info incorrectly, perhaps?

Thanks in advance for any help you can provide.

0 Upvotes
6 Replies 6
Not applicable

[SOLVED] Does the "versions" array on Deal properties contain the whole history?

We're having the same issue on the companies API as @Danny_King mentioned. I wonder if it's possible to add the includePropertyVersions parameter to the companies API as well.

courtenaysfs
Participant

[SOLVED] Does the "versions" array on Deal properties contain the whole history?

Is this saying there isn't currently a way to see company property versions?? 😮

0 Upvotes
Not applicable

[SOLVED] Does the "versions" array on Deal properties contain the whole history?

Please and thank you, this would be invaluable.

0 Upvotes
JamiesonC
Participant

[SOLVED] Does the "versions" array on Deal properties contain the whole history?

Hello @dadams

I added that parameter to my API calls, and it works perfectly — I can see the full version history now.

Thanks very much! Also thanks for updating the documentation.

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

[SOLVED] Does the "versions" array on Deal properties contain the whole history?

Hi @Bistream630

By default, the versions data will only contain the most recent version property. You can include the data for all previous versions by adding &includePropertyVersions=true to the request URL. I’ll get that parameter added to the documentation pages.

Danny_King
Member

[SOLVED] Does the "versions" array on Deal properties contain the whole history?

@dadams would it be possible for you to add &includePropertyVersions=true to the Companies properties API call too? I can’t seem to get it to return more than the most recent version of a custom property I’ve added to a company.

0 Upvotes