Salesforce Agentforce Voice Audio Files

Salesforce Agentforce Voice Audio Files

Learn exactly where Agentforce and Salesforce Service Cloud Voice store conversation audio files. Discover the SOQL queries and objects needed to access call recordings for your analytics pipelines.


Locating Agentforce Voice Session Audio Files for Analytics in Salesforce

As organizations increasingly adopt AI-driven solutions like Salesforce Agentforce to handle customer service, the ability to analyze voice conversations becomes critical. For technical teams—whether you are a Developer building integrations, an Architect designing data flows, or an Analyst running conversational intelligence—you need to know exactly where these audio files live.

If you are wondering, “Where does Agentforce voice store session (conversation) audio files for analytics purposes?”, the answer lies within the architecture of Salesforce Service Cloud Voice.

In this post, we will explore the underlying data model, the exact SOQL query you need, and how to programmatically locate the physical audio files for your analytics tools.

The Architecture: Service Cloud Voice and Call Storage

Agentforce relies on the robust infrastructure of Salesforce Service Cloud Voice to handle telephony and voice data. When a voice session or conversation occurs, Salesforce doesn’t just store the audio file in a void; it meticulously links the file to the context of the interaction using standard objects.

The crucial object bridging your call data and the actual audio file is VoiceCallRecording.

What is the VoiceCallRecording Object?

VoiceCallRecording represents the metadata and the relational link for a call recording within Salesforce Service Cloud Voice. It acts as the bridge between the transactional VoiceCall record and the physical audio file stored in Salesforce Files.

How to Query Agentforce Voice Conversation Audio Files

To extract this data for your analytics engine, you need to query the VoiceCallRecording object to find the specific file identifier.

Here is the SOQL query you can use to locate the recording linked to a specific voice call:

SELECT Id, Name, VoiceCall.Name, VoiceCallId,
UploadDateTime, DurationInSeconds, MediaContentId
FROM VoiceCallRecording
WHERE VoiceCallId = '<Your Voice Call Record Id>'

Accessing the Physical Audio File

Once you run the query above, pay close attention to the MediaContentId field.

The MediaContentId is actually the Content Document Id (the unique identifier for the voice recording file stored in Salesforce Files).

To view, download, or pipe this audio file into your analytics platform, you can access the file directly via the Salesforce UI or API using the following URL structure:

https://<Your Salesforce Org URL>/lightning/r/ContentDocument/<Content document Id>/view

Note: Simply replace <Content document Id> in the URL above with the MediaContentId value returned from your SOQL query.


Best Practices & Recommendations

When working with the VoiceCallRecording object and extracting media for analytics, keep the following architectural and development best practices in mind:

  • Handle Permissions Carefully: Ensure that the integration user or the analyst executing the query has the appropriate read permissions for both the VoiceCallRecording object and the underlying ContentDocument. Without visibility into Salesforce Files, the MediaContentId will be useless.
  • Bulkify Your Queries: If you are building an automated pipeline to extract audio files nightly for an external analytics engine, do not query one VoiceCallId at a time. Modify your SOQL to filter by UploadDateTime (e.g., WHERE UploadDateTime = YESTERDAY) to retrieve records in bulk.
  • Monitor File Storage Limits: Audio files are large and consume your Salesforce File Storage limits quickly. If you are doing heavy analytics, consider implementing an archiving strategy where older ContentDocument files are exported to external storage (like AWS S3) and deleted from Salesforce.
  • Leverage the API for Downloads: While the URL provided above is perfect for an Admin or Analyst viewing the file in the browser, Developers should use the Salesforce REST API to query the ContentVersion object (linked to the ContentDocument) to programmatically download the binary audio file data into your analytics systems.
  • Data Masking & Compliance: Voice recordings often contain PII (Personally Identifiable Information) or PCI data. Ensure your downstream analytics platforms are compliant with regional privacy laws before exporting unredacted audio files out of the Salesforce environment.

Leave a Reply