---
title: "Write workspace file"
method: POST
path: "/api/projects/{projectId}/workspaces/{workspaceId}/git/file"
tags: ["Git"]
---

# Write workspace file

`POST /api/projects/{projectId}/workspaces/{workspaceId}/git/file`

Write workspace file. Accepts a JSON request body when defined and returns the resulting resource or action status.

## Path parameters

- `projectId` string, required
- `workspaceId` string, required

## Request body

- WriteFileRequest — write File Request payload accepted by the API.
  - `path` string, required — File system path or repository-relative path.
  - `content` string, required — Text content for a file or payload.

## Response `200`

File written

- MessageResponse — Generic action result message used by endpoints that do not return a dedicated resource.
  - `message` string — Human-readable status or error message.
  - `status` string — Current status value.
  - `success` boolean — Whether the requested action succeeded.

---

[API](https://skmtc.dev/ibuildthecloud/apis/discobot-server-api.md) · [All operations](https://skmtc.dev/ibuildthecloud/apis/discobot-server-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ibuildthecloud/discobot-server-api/revisions/4de3fcd6be56/schema)
