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 'folderId=<string>' \
  --form 'folderPath=<string>' \
  --form 'fileName=<string>' \
  --form 'charsetHunch=<string>' \
  --form 'options=<string>' \
  --form file=@example-file
{
  "extension": "<string>",
  "access": "PUBLIC_INDEXABLE",
  "parentFolderId": "<string>",
  "sourceGroup": "<string>",
  "fileMd5": "<string>",
  "encoding": "<string>",
  "type": "<string>",
  "isUsableInContent": true,
  "url": "<string>",
  "expiresAt": 123,
  "createdAt": "2023-11-07T05:31:56Z",
  "archivedAt": "2023-11-07T05:31:56Z",
  "path": "<string>",
  "archived": true,
  "size": 123,
  "name": "<string>",
  "width": 123,
  "id": "<string>",
  "defaultHostingUrl": "<string>",
  "updatedAt": "2023-11-07T05:31:56Z",
  "height": 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 -Starter
This API requires one of the following scopes:
files

Authorizations

Authorization
string
header
required

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

Body

multipart/form-data
file
file

File to be uploaded.

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.

fileName
string

Desired name for the uploaded file.

charsetHunch
string

Character set of the uploaded file.

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:
PUBLIC_INDEXABLE,
PUBLIC_NOT_INDEXABLE,
HIDDEN_INDEXABLE,
HIDDEN_NOT_INDEXABLE,
HIDDEN_PRIVATE,
PRIVATE,
HIDDEN_SENSITIVE,
SENSITIVE
createdAt
string<date-time>
required

Creation time of the file object.

archived
boolean
required

If the file is deleted.

id
string
required

File ID.

updatedAt
string<date-time>
required

Timestamp of the latest update to the file.

extension
string

Extension of the file. ex: .jpg, .png, .gif, .pdf, etc.

parentFolderId
string

ID of the folder the file is in.

sourceGroup
string
fileMd5
string

The MD5 hash of the file.

encoding
string

Encoding of the file.

type
string

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

isUsableInContent
boolean

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

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.

expiresAt
integer
archivedAt
string<date-time>

Deletion time of the file object.

path
string

Path of the file in the file manager.

size
integer

Size of the file in bytes.

name
string

Name of the file.

width
integer

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

defaultHostingUrl
string

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

height
integer

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