---
title: "Create Environment File"
method: POST
path: "/v1/environments/{environmentId}/files"
tags: ["Environments"]
---

# Create Environment File

`POST /v1/environments/{environmentId}/files`

Adds a new file to the environment. Maximum content size is 64 KB (65,536 bytes). The `path` is validated against allowed locations (typically under `~/`).

## Path parameters

- `environmentId` string, required

## Request body

- CreateEnvironmentFileRequest — Request body for creating an environment file. Maximum content size is 64 KB (65,536 bytes).
  - `name` string, required
  - `path` string, required — Destination path inside the workspace, e.g. `~/AGENTS.md`
  - `content` string, required — File contents (≤ 64 KB)

## Response `201`

File created

- EnvironmentFileResponse
  - `environment_file` EnvironmentFile, required — A file dropped into the workspace at the configured `path` when the workspace is provisioned.
    - `id` string, uuid, required
    - `organization_id` string, uuid, required
    - `environment_id` string, uuid, required
    - `name` string, required — Human-readable name
    - `path` string, required — Destination path inside the workspace (typically under `~/`)
    - `content` string, required — File contents (≤ 64 KB)
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required

## Other responses

- `400` — Bad request - Missing or invalid parameters
- `401` — Unauthorized - Invalid or missing API key
- `500` — Internal server error

---

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