Skip to main content
PUT
/
cms
/
v3
/
source-code
/
{environment}
/
content
/
{path}
Create or update a file
curl --request PUT \
  --url https://api.hubapi.com/cms/v3/source-code/{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

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

Authorizations

Authorization
string
header
required

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

Path Parameters

environment
string
required

The environment of the file ("draft" or "published").

path
string
required

The file system location of the file.

Body

multipart/form-data
file
file

Response

successful operation

createdAt
integer<int64>
required

Timestamp of when the object was first created.

folder
boolean
required

Determines whether or not this path points to a folder.

id
string
required

The path of the file in the CMS Developer File System.

name
string
required

The name of the file.

updatedAt
integer<int64>
required

Timestamp of when the object was last updated.

archivedAt
integer<int64>

Timestamp of when the object was archived (deleted).

children
string[]

If the object is a folder, contains the filenames of the files within the folder.

hash
string
Last modified on December 16, 2025