@robbieboy
Hi Rob,
I think you’ll have to do this with a couple of subsequent calls, as @dennisedson previously mentioned.
You could use the List associations of a contact by type endpoint of HubSpot’s CRM API. The request would be something like:
GET https://api.hubapi.com/crm/v3/objects/contact/{{CONTACT\_ID}} /associations/call?limit=500&hapikey={{HAPIKEY}}
This would return the first 500 call engagement records (ID only) associated with the given contact. You could then use the Get Engagement endpoint to request additional information about each of the call engagement records. I don’t think you can get engagement records in batches yet (hopefully this will be part of the Engagements API V3, currently marked as in development).
Using a workflow to loop over all existing Contacts and associated Calls in your HubSpot portal is possible, but I don’t think this can currently be configured to re-enroll the Contact record if a new call is logged against it. So that’d only be useful from an initial batch processing perspective, which you may prefer to do by interacting directly with HubSpot APIs.
Regardless, I’ve tested a custom code workflow action (a relatively new HubSpot feature), which returns [1] all call engagement record IDs (max 500) associated with the given contact (as stringified JSON), [2] the most recent call engagement record ID (from the first 500 max associated records) and [3] boolean indicator as to whether more than 500 calls are associated with the given contact. It doesn’t really solve your case, but you could build upon it (assuming your portal has access to custom code workflow actions).
/*
Returns engagement record IDs associated with a record of a different object type
Default fromObjectType is "contact"
Default toObjectType is "call"
These can be configured below
Assumptions / limitations
=========================
- Does not support pagination. Defaults to the maximum number of results per page (500)
You can configure this results limit below
If there are more than 500 associated engagement records of the relevant type, output variable paginationFlag will be true
- Assumes you have saved and enabled your hapikey as an environment secret called "HAPIKEY"
- Assumes you have configured data outputs with 3 variables:
1. associatedEngagements (string)
2. recentEngagementId (string)
3. paginationFlag (boolean)
*/
const request = require("request");
exports.main = (event, callback) => {
// SET THESE VARIABLES TO SUIT YOUR CASE
let fromObjectType = "contact";
let recordId = event.object.objectId;
let toObjectType = "call"
let responseLimit = "500"
// ======================
var options = {
method: "GET",
url: "https://api.hubapi.com/crm/v3/objects/" + fromObjectType + "/" + recordId + "/associations/" + toObjectType,
qs: {limit: responseLimit, hapikey: process.env.HAPIKEY},
headers: {accept: 'application/json'},
json: true
};
return new Promise(resolve => {
request(options, function (error, response, body) {
if(!error)
resolve(body);
})
}).then(results => {
// DEBUGGING
//console.log(results);
//console.log(typeof(results));
// =============
let paginationFlag = false;
if (results.results.length == responseLimit) {
paginationFlag = true;
console.log("Returned " + fromObjectType + " may have more than " + responseLimit + " associated engagement records. Consider adding support for pagination.")
}
callback({
outputFields: {
associatedEngagements: JSON.stringify(results),
recentEngagementId: results.results[results.results.length-1].id,
paginationFlag: paginationFlag
}
});
}).catch(err => {
console.error(err);
});
}
Hopefully, that’s helpful (or thought-provoking, at the very least). Shout with any follow up questions 
All the best,
Zach