---
title: "Save a personal UTF-8 file only if its content revision still matches"
method: PUT
path: "/storage/{storage_id}/text-files/{path}"
tags: ["storage"]
---

# Save a personal UTF-8 file only if its content revision still matches

`PUT /storage/{storage_id}/text-files/{path}`

## Request

- Base URL: `https://api.cloud.wherobots.com`
- URL: `https://api.cloud.wherobots.com/storage/{storage_id}/text-files/{path}`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

## Path parameters

- `storage_id` string, required
- `path` string, required

## Request body

- WriteTextFileRequest
  - `content` string, required: UTF-8 text: up to 25 MiB for .ipynb files, 1 MiB for other files
  - `revision` string, nullable, required: The revision from the last read or save. Null creates a file only if absent.

## Response `200`

Successful Response

- TextFileRevision
  - `revision` string, required

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `409`: The file changed, was deleted, or already exists on creation
- `422`: Validation Error
- `500`: Internal Server Error

## Changes

- **2026-10-31** `54fa857fb12d`: 6 warning
  - added the new `SCRIPT_OWNER_MISMATCH` enum value to the `errors/items/code` response property for the response status `400`
  - added the new `SCRIPT_OWNER_MISMATCH` enum value to the `errors/items/code` response property for the response status `401`
  - added the new `SCRIPT_OWNER_MISMATCH` enum value to the `errors/items/code` response property for the response status `403`
  - added the new `SCRIPT_OWNER_MISMATCH` enum value to the `errors/items/code` response property for the response status `404`
  - …2 more
- **2026-10-28** `893324217557`: 7 info
  - the `content` request property's maxLength was increased from `1048576` to `26214400`
  - added the optional property `errors/items/data` to the response with the `400` status
  - added the optional property `errors/items/data` to the response with the `401` status
  - added the optional property `errors/items/data` to the response with the `403` status
  - …3 more
- **2026-10-23** `10cad63c998a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/wherobots/apis/wherobots-cloud-api/changes/storage/:storage_id/text-files/:path/put.md)

---

[API](https://skmtc.dev/wherobots/apis/wherobots-cloud-api.md) - [All operations](https://skmtc.dev/wherobots/apis/wherobots-cloud-api/llms.txt) - [OpenAPI document](https://skmtc.dev/wherobots/apis/wherobots-cloud-api/revisions/54fa857fb12d?raw)
