---
title: "Write one text file of a hosted project"
method: PUT
path: "/api/v0/desk/projects/{project_id}/file"
tags: ["Desk"]
---

# Write one text file of a hosted project

`PUT /api/v0/desk/projects/{project_id}/file`

## Request

- Base URL: `https://api.outerport.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.outerport.com/api/v0/desk/projects/{project_id}/file`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/outerport/apis/outerport-api/docs/api/v0/desk/projects/:project_id/file/put.ts> (a function with typed inputs; its response is checked against the schema)

Creates or replaces the file. With ``expected_sha256`` the write lands only if the file is still the one the writer read (null: still absent), and answers 409 with ``current_sha256`` otherwise. The bytes go into the project owner's store, whoever writes them.

## Path parameters

- `project_id` string, uuid, required

## Request body

- DeskProjectWriteRequest: Create or replace one text file. ``expected_sha256`` is the hash of the file the writer started from: leave it out to write whatever is there, send null for a file that must not exist yet. A write whose expectation no longer holds answers 409 with the file's current hash.
  - `path` string, required
  - `content` string, required
  - `expected_sha256` string, nullable

## Response `200`

Successful Response

- DeskProjectEntryResponse: The path an operation left behind, the hash it holds, and the revision it moved the project to.
  - `path` string, required
  - `revision` integer, required
  - `sha256` string, nullable

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-26** `07854361a13b`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/outerport/apis/outerport-api/changes/api/v0/desk/projects/:project_id/file/put.md)

---

[API](https://skmtc.dev/outerport/apis/outerport-api.md) - [All operations](https://skmtc.dev/outerport/apis/outerport-api/llms.txt) - [OpenAPI document](https://skmtc.dev/outerport/apis/outerport-api/revisions/08b5bf6f7f18?raw)
