Hi,
Is there a way to extract the lastest note left on a deal?
The only option I can see is the for the number of notes left on a deal. I’d like to see the contents of the latest notes eft on the account.
Hi,
Is there a way to extract the lastest note left on a deal?
The only option I can see is the for the number of notes left on a deal. I’d like to see the contents of the latest notes eft on the account.
There are multiple ways to do this depending on how you want to go about it.
Easiest and most direct is to use the Notes API to search for notes using the deal association filter:
{
"limit": 1,
"sorts": [
{
"propertyName": "hs_timestamp",
"direction": "DESCENDING"
}
],
"properties": [
"hs_object_id",
"hs_engagement_type",
"hs_note_body"
],
"filterGroups": [
{
"filters": [
{
"propertyName": "associations.deal",
"value": "23141507859", // Deal ID
"operator": "EQ"
}
]
}
]
}
If you’re pulling the Deal, you can include associations and it will provide you with the ID. So if your API request is:
https://api.hubapi.com/crm/v3/objects/deals/XYZ?associations=notes
It would return something like below with the Note IDs and then you can make a GET request for the Notes API with the ID.
{
"id": "11111111111111",
"properties": {
"hs_object_id": "11111111111111",
"pipeline": "1"
},
"createdAt": "2024-10-10T15:27:44.024Z",
"updatedAt": "2025-04-15T13:13:30.251Z",
"archived": false,
"associations": {
"notes": {
"results": [
{
"id": "22222222222",
"type": "deal_to_note"
},
{
"id": "33333333333",
"type": "deal_to_note"
}
]
}
}
}
Last alternative is to use GraphQL and you can make it a single request:
query test {
CRM {
deal(uniqueIdentifier: "id", uniqueIdentifierValue: "11111111111") {
hs_object_id
associations {
note_collection__deal_to_note(limit: 1, orderBy: hs_timestamp__desc) {
items {
hs_note_body
}
}
}
}
}
}
great stuff here!
Thank you @MichaelMa
— Jaycee