Listing Notes By Deal ID

Hi,
i am able to list notes from the hubspot api along with the deal associationhttps://api.hubapi.com/crm/v3/objects/notes?properties=hs_note_body,hs_body_preview_html,hs_created_by&associations=deals. However, we’re trying to build an internal tool where we want to list a deal along with the notes associated with it.
I’ve tried to do this by fetching the notes & filtering the deal section by the latest deal id, however, it isn’t scalable.
Is there a way to properly filter notes by deal id in Hubspot ? I’m not finding that in the documentation

Hi, @moshoodsikiru :waving_hand: Thanks for the question. Have you looked into using the Search API? It allows for pseudo—associations.

The example from the documentation shows how to search for Tickets associated to a Contact, but Notes > to a specific Deal could work as well

curl https://api.hubapi.com/crm/v3/objects/tickets/search \
 --request POST \ 
 --header "Content-Type: application/json" \
 --data '{
 "filters": [
 {
 "propertyName": "associations.contact",
 "operator": "EQ",
 "value": "123"
 }
 ]
 }'

Have fun building!

Jaycee