---
title: "Create a file"
method: POST
path: "/cms/source-code/2026-03/{environment}/content/{path}"
tags: ["Advanced"]
deprecated: true
---

# Create a file

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

> **Deprecated.**

Creates a file at the specified path in the specified environment. Accepts multipart/form-data content type. Throws an error if a file already exists at the specified path.

## 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.

## Changes

- **2026-04-08** `b0d8bc008db9` — 1 info
  - api operation id `post-/cms/source-code/2026-03/{environment}/content/{path}_create` removed and replaced with `post-/cms/source-code/2026-03/{environment}/content/{path}`
- **2026-03-30** `dc2fdad57f7f` — 2 info
  - api tag `Advanced` added
  - api tag `Content` removed
- **2026-03-25** `62586336cea2` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/hubspot/apis/hubspot-api-specification/changes/cms/source-code/2026-03/:environment/content/:path/post.md)

---

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