Recordings and transcripts (BETA)

Access and test APIs in beta. 

Please note: This functionality and requires your account to be ungated. Please note that this functionality is currently under development and is subject to change based on testing and feedback. on testing and feedback. By using these endpoints you agree to adhere to HubSpot's Developer TermsDeveloper BetaTerms. 

If you want to make call recordings playable in your HubSpot account, or you want to build on top of HubSpot's Conversation Intelligence functionality, you can use the engagements API to automatically transcribe calls and log them within HubSpot. 

Requirements

  • HubSpot will only transcribe calls associated with users with a paid Sales or Services hub seat.
  • Only .WAV, .FLAC, and .MP4 audio files will be transcribed.
  • In the transcription system, HubSpot splits the audio file into its different channels and treats each channel as a separate speaker. If all of the speakers are on the same audio channel, or if the caller or recipient are on an unexpected channel, HubSpot will not be able to transcribe the audio recording. Therefore, each speaker in an audio file should be on a separate channel. For calls with two channels, the caller should be on channel 1, and the call recipient should be on channel 2, regardless of whether the call is inbound or outbound. 

Create an endpoint to provide an authenticated recording URL for a call

To list and transcribe calls on a record's timeline in HubSpot, create an endpoint that will be invoked to retrieve the authenticated call URLs associated with each engagement.

Your endpoint should accept the following parameters:

  • externalId: the unique ID associated with a call URL, provided as a path parameter. This will correspond to the same parameter you include in the metadata of your POST request to the engagements API, which you can then use in your app's backend to associate with the recording URL.
  • externalAccountId: a unique ID associated with the HubSpot account that made the call engagement, provided as a query parameter. You can use this parameter along with the externalId to identify the call recording.
  • appId: the ID of your app, provided as a query parameter.

Your endpoint should return a JSON response with a authenticatedUrl field that provides the recording URL.

// Response to GET request to your app's endpoint { "authenticatedUrl": "https://app-test.com/retrieve/authenticated/recordings/test-call-01" }

Register your app's endpoint with HubSpot using the calling settings API

Once your endpoint is ready, make a POST request using your app's ID to /crm/v3/extensions/calling/{appId}/settings/recording and provide the URL of your endpoint with the urlToRetrieveAuthedRecording parameter in the body of your request.

  • Your endpoint's URL must contain the %s character sequence, which HubSpot will substitute with the externalId of the engagement when calling your endpoint. The %s character sequence can be located anywhere in your URL.
  • Provide the full path of your endpoint URL in your POST request, including the https:// prefix.

For example:

// Example POST request to configure your app's endpoint { "urlToRetrieveAuthedRecording": "https://app-test.com/retrieve/authenticated/recordings/%s" }

If you change the location of your endpoint, you can make a PATCH request to the same HubSpot endpoint above and provide an updated value for urlToRetrieveAuthedRecording.

Log a call with your app's endpoint using the engagements API

After you've registered your calling app's endpoint with HubSpot, you can log a call by making a POST request to the /crm/v3/objects/calls endpoint, and including the engagement data within the properties field in the body of your request.

 The hs_call_external_id, hs_call_external_account_id, hs_call_app_id, and hs_call_source properties are required to ensure that HubSpot can fetch the authenticated recording URL.

The body of an example request is shown below:

// POST request to https://api.hubapi.com/crm/v3/objects/calls { "properties": { "hs_timestamp": "2021-03-17T01:32:44.872Z", "hs_call_title": "Test v3 API", "hubspot_owner_id": "11526487", "hs_call_body": "Decision maker out, will call back tomorrow", "hs_call_duration": "3800", "hs_call_from_number": "(555) 555 5555", "hs_call_to_number": "(555) 555 5555", "hs_call_recording_url": "https://api.example.com/2022-04-01/Accounts/0001/Recordings/0001", "hs_call_source" : "INTEGRATIONS_PLATFORM", // this has to be INTEGRATIONS_PLATFORM "hs_call_status": "COMPLETED", "hs_call_app_id": "test-app-01", "hs_call_external_id": "test-call-01", "hs_call_external_account_id": "test-account-01" } }

Next, you'll need to associate the call with a record type to ensure the transcript appears on the record timeline.

  • To make this association, make a PUT request to /crm/v3/objects/calls/{callId}/associations/{toObjectType}/{toObjectId}/{associationType}.
  • For example, if the ID of the logged call you created above is 17591596434, the ID of the contact you wanted to associate it with is 104901, and the ID of the associationType is 194, your request URL would be:

https://api.hubspot.com/crm/v3/objects/calls/17591596434/associations/contacts/104901/194

When one of your app's users navigates to the associated record timeline to view the engagement, HubSpot will call the endpoint you configured to serve the authenticated recording URL. For example, to retrieve the recording URL associated with the example engagement above, HubSpot would make a GET request to:

https://app-test.com/retrieve/authenticated/recordings/test-call-01?appId=app-101&externalAccountId=test-account-01

Log call recordings without registering your app's endpoint

If you're unable to create and host an endpoint to provide HubSpot with authenticated recording URLs, you can also directly log a call using the v3 engagements API by including a hs_call_recording_url in the properties field, but omitting the hs_external_id, hs_external_account_id, and hs_call_source parameters. The recording URL will appear on the contact record timeline but the recording will be publicly accessible to anyone with the URL.

Please note: if you're using the legacy approach of logging call recordings without authentication, it's recommended that you update to the authenticated approach as soon as possible. The unauthenticated approach will no longer be actively supported moving forward.

Was this article helpful?
This form is used for documentation feedback only. Learn how to get help with HubSpot.