curl --request POST \
--url https://api.hubapi.com/cms/source-code/2026-03/{environment}/content/{path} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file'{
"createdAt": 123,
"folder": true,
"id": "<string>",
"name": "<string>",
"updatedAt": 123,
"archivedAt": 123,
"children": [
"<string>"
],
"hash": "<string>"
}Upload a content file to a specified environment and path in the HubSpot CMS. This endpoint allows you to add new content files to your HubSpot account by specifying the environment and path where the file should be stored. The request must include a file in binary format.
curl --request POST \
--url https://api.hubapi.com/cms/source-code/2026-03/{environment}/content/{path} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file'{
"createdAt": 123,
"folder": true,
"id": "<string>",
"name": "<string>",
"updatedAt": 123,
"archivedAt": 123,
"children": [
"<string>"
],
"hash": "<string>"
}Supported products
Required Scopes
The access token received from the authorization server in the OAuth 2.0 flow.
The environment in which the content file will be uploaded. Typically represents different stages like 'staging' or 'production'.
The specific path within the environment where the content file will be stored. This should be a valid path string.
.+successful operation
Timestamp of when the object was first created.
Determines whether or not this path points to a folder.
The path of the file in the CMS Developer File System.
The name of the file.
Timestamp of when the object was last updated.
Timestamp of when the object was archived (deleted).
If the object is a folder, contains the filenames of the files within the folder.
A unique identifier for the file's content, used to verify data integrity.
Was this page helpful?