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": "<string>",
  "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

File access. Can be PUBLIC_INDEXABLE, PUBLIC_NOT_INDEXABLE, PRIVATE.

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

If the file is deleted.

createdAt
string<date-time>
required

Creation time of the file object.

id
string
required

File ID.

updatedAt
string<date-time>
required

Timestamp of the latest update to the file.

archivedAt
string<date-time>

Deletion time of the file object.

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 file. ex: .jpg, .png, .gif, .pdf, etc.

fileMd5
string

The MD5 hash of the file.

height
integer<int32>

For image and video files, the height of the content.

isUsableInContent
boolean

Previously "archied". Indicates if the file should be used when creating new content like web pages.

name
string

Name of the file.

parentFolderId
string

ID of the folder the file is in.

path
string

Path of the file in the file manager.

size
integer<int64>

Size of the file in bytes.

sourceGroup
string
type
string

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

url
string

URL of the given file. This URL can change depending on the domain settings of the account. Will use the select file hosting domain.

width
integer<int32>

For image and video files, the width of the content.

Last modified on December 16, 2025