Skip to main content
POST
/
files
/
v3
/
files
Upload file
curl --request POST \
  --url https://api.hubapi.com/files/v3/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'charsetHunch=<string>' \
  --form file='@example-file' \
  --form 'fileName=<string>' \
  --form 'folderId=<string>' \
  --form 'folderPath=<string>' \
  --form 'options=<string>'
{
  "access": "HIDDEN_INDEXABLE",
  "archived": true,
  "createdAt": "2023-11-07T05:31:56Z",
  "id": "<string>",
  "updatedAt": "2023-11-07T05:31:56Z",
  "archivedAt": "2023-11-07T05:31:56Z",
  "defaultHostingUrl": "<string>",
  "encoding": "<string>",
  "expiresAt": 123,
  "extension": "<string>",
  "fileMd5": "<string>",
  "height": 123,
  "isUsableInContent": true,
  "name": "<string>",
  "parentFolderId": "<string>",
  "path": "<string>",
  "size": 123,
  "sourceGroup": "CONTENT",
  "type": "<string>",
  "url": "<string>",
  "width": 123
}

Supported products

Requires one of the following products or higher.
Marketing HubMarketing Hub -Free
Sales HubSales Hub -Free
Service HubService Hub -Free
Content HubContent Hub -Free
Data HubData Hub -Free

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

multipart/form-data
charsetHunch
string

Character set of the uploaded file.

file
file

File to be uploaded.

fileName
string

Desired name for the uploaded file.

folderId
string

Either 'folderId' or 'folderPath' is required. folderId is the ID of the folder the file will be uploaded to.

folderPath
string

Either 'folderPath' or 'folderId' is required. This field represents the destination folder path for the uploaded file. If a path doesn't exist, the system will try to create one.

options
string

JSON string representing FileUploadOptions.

Response

successful operation

File

access
enum<string>
required

PUBLIC_INDEXABLE: File is publicly accessible by anyone who has the URL. Search engines can index the file. PUBLIC_NOT_INDEXABLE: File is publicly accessible by anyone who has the URL. Search engines can't index the file. PRIVATE: File is NOT publicly accessible. Requires a signed URL to see content. Search engines can't index the file.

Available options:
HIDDEN_INDEXABLE,
HIDDEN_NOT_INDEXABLE,
HIDDEN_PRIVATE,
HIDDEN_SENSITIVE,
PRIVATE,
PUBLIC_INDEXABLE,
PUBLIC_NOT_INDEXABLE,
SENSITIVE
archived
boolean
required

Marks whether the folder is deleted or not.

createdAt
string<date-time>
required

Timestamp of folder creation.

id
string
required

File ID.

updatedAt
string<date-time>
required

Timestamp of the latest update to the folder.

archivedAt
string<date-time>

Timestamp of folder deletion.

defaultHostingUrl
string

Default hosting URL of the file. This will use one of HubSpot's provided URLs to serve the file.

encoding
string

Encoding of the file.

expiresAt
integer<int64>
extension
string

Extension of the requested file.

fileMd5
string

The MD5 hash of the file.

height
integer<int32>

For image and video files. The height of the file.

isUsableInContent
boolean

Mark whether the file should be used in new content or not.

name
string

New name. If specified the folder's name and fullPath will change. All children of the folder will be updated accordingly.

parentFolderId
string

New parent folderId. If changed, the folder and all it's children will be moved into the specified folder. parentFolderId and parentFolderPath cannot be specified at the same time.

path
string

Path of the folder in the file manager.

size
integer<int64>

Size in bytes of the requested file.

sourceGroup
enum<string>
Available options:
CONTENT,
CONVERSATIONS,
FORMS,
UI_EXTENSIONS,
UNKNOWN
type
string

Type of the file. Can be IMG, DOCUMENT, AUDIO, MOVIE, or OTHER.

url
string

URL to download the new file from.

width
integer<int32>

For image and video files. The width of the file.

Last modified on February 12, 2026