# PUT /v1/workspaces/{workspace_id}/fs/{path} - Update file content

Source: <https://everruns.com/docs/api/operations/update_path/>

PUT

/v1/workspaces/{workspace\_id}/fs/{path}

Select code samplecURL (shell:curl)

```js
const url = 'https://app.everruns.com/api/v1/workspaces/example/fs/example';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json'},
  body: '{"content":"# Project notes (rev 2)\n\nUpdated migration plan with rollback steps.\n","encoding":"text","expected_content":"example","expected_encoding":"example","is_readonly":false}'
};


try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```sh
curl --request PUT \
  --url https://app.everruns.com/api/v1/workspaces/example/fs/example \
  --header 'Content-Type: application/json' \
  --data '{ "content": "# Project notes (rev 2)\n\nUpdated migration plan with rollback steps.\n", "encoding": "text", "expected_content": "example", "expected_encoding": "example", "is_readonly": false }'
```

* Production APIapp.everruns.com/api/v1/workspaces/{workspace\_id}/fs/{path}

## Parameters

### Path Parameters

**workspace\_id**

required

string

Workspace ID (wsp\_<32-hex>)

**path**

required

string

File path

## Request Bodyrequired

Media typeapplication/json

Request to update a file

object

**content**

New file content

string | null

##### Example

```plaintext
# Project notes (rev 2)


Updated migration plan with rollback steps.
```

**encoding**

Content encoding: “text” or “base64”. Defaults to text.

string | null

##### Example

```plaintext
text
```

**expected\_content**

Content the file must currently hold for the write to happen.

When set, the update is a compare-and-swap: the write lands only if the stored bytes equal these, and a mismatch is reported as a conflict rather than overwriting a concurrent writer.

string | null

**expected\_encoding**

Encoding of `expected_content`. Defaults to `text` when omitted.

string | null

**is\_readonly**

Whether file is read-only

boolean | null

##### Example

```json
false
```

## Responses

### 200

Updated

Media typeapplication/json

Complete file with content

object

**content**

File content. Encoding is controlled by the `encoding` field: plain UTF-8 text for `text`, base64-encoded bytes for `base64`. `None` for directories and when this is a metadata-only listing.

string | null

**created\_at**

required

Timestamp when this entry was created (RFC 3339).

string format: date-time

**encoding**

Content encoding for the `content` field: `text` (UTF-8) or `base64` (binary).

string

**id**

required

Internal database UUID for this file entry.

string format: uuid

**is\_directory**

required

`true` when this entry represents a directory; `false` for a regular file.

boolean

**is\_readonly**

required

Whether the entry was marked read-only at creation. Read-only entries cannot be edited or deleted by the session.

boolean

**name**

required

File or directory name (the last segment of `path`).

string

**path**

required

Absolute path within the session workspace (e.g. `/notes.md`).

string

**session\_id**

required

UUID of the owning session.

string format: uuid

**size\_bytes**

required

File size in bytes. `0` for directories.

integer format: int64

**updated\_at**

required

Timestamp when this entry was last updated (RFC 3339).

string format: date-time

##### Examplegenerated

```json
{
  "content": "example",
  "created_at": "2026-04-15T12:00:00Z",
  "encoding": "example",
  "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
  "is_directory": true,
  "is_readonly": true,
  "name": "example",
  "path": "example",
  "session_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
  "size_bytes": 1,
  "updated_at": "2026-04-15T12:00:00Z"
}
```

### 400

Invalid request

### 404

Not found

### 500

Internal server error