API to export account activity history

Is there a way we can export account activity history using API?

Hey, @ks20900 :waving_hand: Thanks for your question. You can find the available endpoints here — HubSpot API | Account Activity.

Have fun building! — Jaycee

Hi @ks20900

Yes, there is a way to export account activity history using the HubSpot API. Here are the steps involved:
Create a HubSpot developer account. If you don’t already have a HubSpot developer account, you can create one here: https://developer.hubspot.com/.
Generate an access token. Once you have created a developer account, you will need to generate an access token. You can do this by following these steps:
Go to the API Keys page in your HubSpot account.
Click the Create New Key button.
Select the API checkbox and click the Create Key button.
Copy the access token. You will need it in the next step.
Make an API call. To export account activity history, you will need to make an API call to the /activities/export endpoint. The request body for this endpoint is as follows:
Code snippet
{
“filters”: {
“accountIds”: [1234567890]
},
“format”: “csv”
}

The filters object allows you to specify the accounts that you want to export activity history for. The format property specifies the format of the exported data. The supported values are csv and json.
To make the API call, you can use the HubSpot API Explorer or a third-party API client.
Download the exported file. Once the API call has been made, you will receive a response that contains a link to the exported file. Click the link to download the file.
The exported file will contain a list of all activities that have been performed on the specified accounts. The format of the file will depend on the value of the format property that you specified in the request body.

Hope this will helps you out. Please mark it as Solution Accepted to help other Community member.
Thanks!