APIs & Integrations

SCarmel
Participant

Can I get the Hubspot Activity logs via API?

SOLVE

Hubspot have a place to export activity logs: account login history, HubSpot employee access history, and security activity history. 

https://knowledge.hubspot.com/account/export-account-activity-history

 

Is there a way to get this data programmatically and not manually? 

1 Accepted solution
ASykes
Solution
HubSpot Product Team
HubSpot Product Team

Can I get the Hubspot Activity logs via API?

SOLVE

Hi @SCarmel ,

 

My name is Alice and I'm a Product Manager here in HubSpot.

 

We've just recently released two public APIs for these account activity exports (one for login activity and one security activity).

 

You can get the full details of the API here in the developer documentation.

 

Would love to know how you find implementing them and the use cases if you are able to give us any feedback it would be great to have; you can contact me directly, asykes@hubspot.com or reply on the thread here too 😊

View solution in original post

0 Upvotes
15 Replies 15
ASykes
Solution
HubSpot Product Team
HubSpot Product Team

Can I get the Hubspot Activity logs via API?

SOLVE

Hi @SCarmel ,

 

My name is Alice and I'm a Product Manager here in HubSpot.

 

We've just recently released two public APIs for these account activity exports (one for login activity and one security activity).

 

You can get the full details of the API here in the developer documentation.

 

Would love to know how you find implementing them and the use cases if you are able to give us any feedback it would be great to have; you can contact me directly, asykes@hubspot.com or reply on the thread here too 😊

0 Upvotes
abhishekmayee
Member

Can I get the Hubspot Activity logs via API?

SOLVE

Hi @ASykes ,

There is an API for account activities: GET/account-info/v3/activity/audit-logs (here)

This API is in BETA currently as per the documentation.

When will this API be available in GA publicly ?

0 Upvotes
MBhatt
Member

Can I get the Hubspot Activity logs via API?

SOLVE

Hi @ASykes ,

 

I am trying to programatically fetch list of all content that was exported from HubSpot within certain time range.   Which APIs should I use for that?    Does HubSpot store this exported content as files in any file storage ?  

0 Upvotes
ASykes
HubSpot Product Team
HubSpot Product Team

Can I get the Hubspot Activity logs via API?

SOLVE

Hi @MBhatt 👋

 

Just to clarify: do you mean 'content' as described here in the Content Activity History export? Currently, there isn't an API for this type of content data but my team is has it on our backlog. I would love to learn more about your use case for it and what information you would need. Would you be happy to email me with more detail to asykes@hubspot.com? 

 

0 Upvotes
MBhatt
Member

Can I get the Hubspot Activity logs via API?

SOLVE

Hi @ASykes , thank you for your response.   I am particularly interested in API for the below -  'Export Audit'.   

MBhatt_0-1673439029915.png

 

0 Upvotes
ASykes
HubSpot Product Team
HubSpot Product Team

Can I get the Hubspot Activity logs via API?

SOLVE

Thanks, MBhatt!

 

You would be able to get that information using the Security Activity API. The documentation here outlines the information included and the endpoints tab shows how to implement them. 

 

using this endpoint and the "type" would be "export":
GET/account-info/v3/activity/security

0 Upvotes
MBhatt
Member

Can I get the Hubspot Activity logs via API?

SOLVE

Hi @ASykes , appreciate your quick response.

I tried that API, however in the response, it does not provide me the actual file that got exported.

Here is my API response that I got:

 "results": [

        {

            "id": "141679146",

            "createdAt": "2023-01-13T12:01:08.112Z",

            "userId": 49120136,

            "type": "EXPORT",

            "actingUser": "harsha@z3star.online",

            "objectId": "48804460",

            "infoUrl": "app.hubspot.com/sales-products-settings/23761992/importexport",

            "location": null,

            "ipAddress": "103.35.134.109",

            "countryCode": "in",

            "regionCode": "mh"

        },

 

How do I get the actual file from the infoURL ?   

0 Upvotes
ASykes
HubSpot Product Team
HubSpot Product Team

Can I get the Hubspot Activity logs via API?

SOLVE

Hi again!

 

There was an API release this week from another team that might help in extracting the actual file which might be useful for your use case?

 

https://developers.hubspot.com/docs/api/crm/exports#retrieve-exports

0 Upvotes
ASykes
HubSpot Product Team
HubSpot Product Team

Can I get the Hubspot Activity logs via API?

SOLVE
Unfortunately we can't pull the exported file out via the API. The best workaround would be to use the infoURL to take you to the import/export page in-app and from there you could match up the "objectId" field from the API with the "exportID" when you click to 'View JSON data' on the import/export page. It would be manual but you could narrow it down by date/timestamp. https://app.hubspot.com/sales-products-settings/${PORTAL_ID}/importexport and they line up the objectId to the exportId shown in the “view JSON Data” link
0 Upvotes
yasiooy
Participant | Elite Partner
Participant | Elite Partner

Can I get the Hubspot Activity logs via API?

SOLVE

We have clients that would benefit from this. Exporting acivity logs to an external server when using multiple software is crucial.

BartVDK
Contributor

Can I get the Hubspot Activity logs via API?

SOLVE

I agree that this would be a good feature. We would like to use it to get warnings when superadmin-accounts access the system (and especially the exception-account that can access the system without going through the SSO-system).

MySec
Participant

Can I get the Hubspot Activity logs via API?

SOLVE

We are also looking for a way to monitor activity within our hubspot account, including user activity audit logs. This is really a basic enterprise feature. Ideally, to start with, the user audit logs should be available through the API or a to define external storage account?  

We have requirements around log retention, anomaly detection & response, non repudiation of those logs and so on ... 

 

Thank you! 

robsobers
Contributor

Can I get the Hubspot Activity logs via API?

SOLVE

Please implement this! 🙏

mgorman
Participant

Can I get the Hubspot Activity logs via API?

SOLVE

Is there any update on if this is planned or not?  Being able to push this kind of information to a SIEM is critical in today's security operations.

dennisedson
Community Manager
Community Manager

Can I get the Hubspot Activity logs via API?

SOLVE

Hi @SCarmel 

At this time, no.  I would not be surprised if this is available in the future though


HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Learn More.

0 Upvotes