---
title: "Replace Asset Text Content"
method: PUT
path: "/asset/{asset_id}/content"
tags: ["accepts-api-key"]
---

# Replace Asset Text Content

`PUT /asset/{asset_id}/content`

## Request

- Base URL: `https://api.tellers.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.tellers.ai/asset/{asset_id}/content`
- Auth: none declared

Replace or patch a text, Markdown or SVG file's content and reprocess it.

Send `content` to replace the whole body, or `diff` (a unified diff
against the file as stored) to change part of a long file without
resending it. Either way the file is written over in place, the way the
agent's patch_file tool does, then preprocessing re-runs so the search
embeddings match the new text and an SVG's thumbnail matches its new
markup. There is no size limit. The resulting SVG must be a well-formed
document with an <svg> root, or the call is refused with 400 and nothing
is written. A diff whose hunks do not match the stored file is refused
with 409; a diff that cannot be parsed with 400.

## Path parameters

- `asset_id` string, uuid, required

## Headers

- `x-api-key` string, nullable
- `authorization` string, nullable

## Request body

- AssetTextContentRequest: Exactly one of ``content`` or ``diff``.
  - `content` string, nullable: The file's complete new text, UTF-8: the body of a text or Markdown file, or the full markup of an SVG. Replaces the whole body. Give this or `diff`, not both.
  - `diff` string, nullable: A standard unified diff against the file as stored, the format `git diff` prints: each hunk starts with its own '@@ -start,count +start,count @@' line, then a leading space for context, '-' to remove, '+' to add; the '--- a/file' and '+++ b/file' header lines are optional. Hunks are placed by line number and their context must match the file exactly, so read the file first. A hunk that does not match is refused with 409 and the error says which line missed. For a long file this is far smaller than resending the whole body. Give this or `content`, not both.

## Response `200`

Successful Response

- AssetTextContentResponse
  - `asset_id` string, required
  - `byte_size` integer, required

## Other responses

- `422`: Validation Error

---

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