---
schema_version: "1"
id: b249b03be92fae3de3316ea1e0473ef96d973923811892454667484e86606877
title: Upload a File
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/uiapi/ui_api_resources_records_contentversion.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_records_contentversion.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 93b03790e59a529ce43641f9c35b43aafa304f0102a7edc0e5dc6a8026b2e74d
description: Upload a file such as a document or image.
---
# Upload a File

Upload a file such as a document or image.

Resource

/ui-api/records/content-documents/content-versions

Available Version

56.0

HTTP Method

POST

To upload a file or a new file version, provide the binary file in a multipart/form-data body part where name="fileData". See [Upload Binary Files](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_features_records_binary_upload.htm "If a record has a Base64 field, you can upload binary data to the field when you create or update a record.") and [Upload Files](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_features_records_content_document.htm "Upload documents and images or update the file with a new version.").

Request Parameters for POST

| Parameter Name | Type | Description | Required or Optional | Available Version |
| --- | --- | --- | --- | --- |
| description | String | A description of the document or image to be uploaded. | Optional | 56.0 |
| title | String | The title of the document or image to be uploaded. | Optional | 56.0 |

Request Body for POST

Example for Uploading a File

POST /ui-api/records/content-documents/content-versions

{
  "description": "A description of the product",
  "title": "product\_image"
}

Properties

| Name | Type | Description | Required or Optional | Available Version |
| --- | --- | --- | --- | --- |
| description | String | A description of the document or image to be uploaded. | Optional | 56.0 |
| title | String | The title of the document or image to be uploaded. | Optional | 56.0 |

Response Body

[Content Document Composite](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_responses_contentdocumentcomposite.htm "The file and its relationship to a record.")