Salesforce Dictionary — Free Salesforce GlossarySalesforce Dictionary
DictionaryCContent Version
Core CRMIntermediate

Content Version

A Content Version in Salesforce (ContentVersion in the API) is the standard child object in the Salesforce Files framework that holds the actual binary content for one specific version of a Content Document.

§ 01

Definition

A Content Version in Salesforce (ContentVersion in the API) is the standard child object in the Salesforce Files framework that holds the actual binary content for one specific version of a Content Document. Each Content Version record contains the file's binary data in the VersionData field (stored base64-encoded over the API), along with metadata like Title, FileType, FileExtension, ContentSize, VersionNumber, IsLatest flag, ReasonForChange (free-text explanation of what changed in this version), and a parent ContentDocumentId. When a file is first uploaded, Salesforce creates one Content Version record (the initial version, with VersionNumber = 1 and IsLatest = true) plus its parent Content Document. Subsequent file replacements insert new Content Version records under the same Content Document, each incrementing VersionNumber and flipping IsLatest on the prior version. Apex and API code that uploads files always inserts Content Version (not Content Document) — the platform automatically creates the parent Content Document and the initial Content Document Link to the inserting user.

§ 02

In plain English

👋 Study buddy

A Content Version is one version of a file in Salesforce. When you upload a contract PDF, that's version 1 (one Content Version record). When you upload a revised PDF six months later, that's version 2 (a second Content Version record under the same parent Content Document). The actual binary bytes live on Content Version records — the parent Content Document just identifies the file as a whole.

§ 03

Worked example

scenario · real-world use

A solutions consultant uploads a 4MB pricing PDF named "2026_pricing.pdf" through the Files tab in Lightning. Salesforce inserts one Content Version record with VersionData containing the base64-encoded PDF binary, Title "2026_pricing", FileType PDF, ContentSize 4194304, VersionNumber 1, IsLatest true, plus an auto-generated parent Content Document. A month later she uploads a revised PDF "2026_pricing_v2.pdf" through the existing file's "Upload New Version" button, providing the optional ReasonForChange text "Updated Q2 pricing tables". Salesforce inserts a second Content Version under the same parent Content Document with VersionNumber 2, IsLatest true, and flips the prior version's IsLatest to false. Both Content Versions remain queryable forever — anyone with access to the parent Content Document can browse the version history and download any prior version, but the Lightning UI defaults to showing only the latest.

§ 04

Why Content Version matters

Content Version is the only file-related object you should insert directly through API or Apex. The platform automatically derives the parent Content Document Id and creates an initial Content Document Link to the inserting User on first insert. Subsequent versions of the same file are inserted by setting ContentDocumentId to the existing parent's Id rather than letting Salesforce generate a new one — this keeps the version chain intact rather than creating an unrelated new file. Bulk uploads via the Bulk API support chunked uploads for files over the standard REST limit (up to 2 GB depending on edition).

VersionData is base64-encoded in API responses, which inflates the apparent size by roughly 33% — a 1MB raw file becomes ~1.33MB over the wire. Plan governor limits and heap sizes accordingly when bulk-uploading files via Apex, and prefer the Bulk API or chunked upload patterns for files over a few megabytes. Querying VersionData through SOQL is allowed but expensive; for analytics that don't need the actual binary, exclude VersionData from the SELECT to avoid inflating query response sizes.

The IsLatest flag is auto-maintained by Salesforce — every time a new Content Version is inserted under an existing Content Document, the prior IsLatest version flips to false and the new one becomes IsLatest = true. Don't manually update IsLatest, since the platform also maintains LatestPublishedVersionId on the parent Content Document and the two must stay in sync. Direct manipulation breaks the version-history UI and can cause unpredictable file-display behavior.

§ 05

How organizations use Content Version

Sales operations team uploading collateral via API

Uses the Bulk API to load hundreds of sales-collateral PDFs as Content Version records, each becoming the initial version of a new Content Document. The PathOnClient field provides the original filename for end-user display, while Title can be set to a cleaner display name.

Compliance-sensitive document management

Inserts Content Versions under existing Content Documents whenever a contract or disclosure is updated, preserving every prior version indefinitely for regulatory audit. ReasonForChange captures the business justification for each version, providing a self-documenting audit trail without separate logging.

Migration team moving Attachments to Files

Bulk-creates Content Version records from legacy Attachment binaries, preserving original CreatedDate and CreatedById through the audit-fields permission. Each migrated Attachment becomes one Content Version under a new Content Document, with the resulting Content Document Link wiring the file back to its original parent record.

§

Trust & references

Official documentation

Straight from the source — Salesforce's reference material on Content Version.

Was this entry helpful?
Help us write better definitions. Quick reactions or detailed edit suggestions.
§

Discussion

Loading…

Loading discussion…