Content

Update a file

Update the content file in the specified environment and path within the HubSpot CMS. This operation allows you to upload a new file to replace the existing content at the given path. It is useful for managing and updating your website's source code files directly through the API.

put/cms/source-code/2026-03/{environment}/content/{path}

Path parameters

environmentstring required

The environment in which the content file is located, such as 'staging' or 'production'.

pathstring required

The path to the content file that you want to update. This should be a string representing the file's location.

Response

successful operation

archivedAtinteger

Timestamp of when the object was archived (deleted).

childrenstring[]

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

createdAtinteger required

Timestamp of when the object was first created.

folderboolean required

Determines whether or not this path points to a folder.

hashstring

A unique identifier for the file's content, used to verify data integrity.

idstring required

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

namestring required

The name of the file.

updatedAtinteger required

Timestamp of when the object was last updated.

Changes