---
title: "Create or update a file"
method: PUT
path: "/cms/source-code/2026-03/{environment}/content/{path}"
tags: ["Advanced"]
---

# Create or update a file

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

Upserts a file at the specified path in the specified environment. Accepts multipart/form-data content type.

## Path parameters

- `environment` string, required
- `path` string, required

## Response `200`

successful operation

- CmsSourceCodeAssetFileMetadata
  - `archivedAt` integer — 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.
  - `createdAt` integer, required — Timestamp of when the object was first created.
  - `folder` boolean, required — Determines whether or not this path points to a folder.
  - `hash` string — A unique identifier for the file's content, used to verify data integrity.
  - `id` string, required — The path of the file in the CMS Developer File System.
  - `name` string, required — The name of the file.
  - `updatedAt` integer, required — Timestamp of when the object was last updated.

## Other responses

- `default` — An error occurred.

---

[API](https://skmtc.net/hubspot/apis/hubspot-api-specification.md) · [All operations](https://skmtc.net/hubspot/apis/hubspot-api-specification/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hubspot/hubspot-api-specification/versions/f9c7181056c5/schema)
