> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tess.im/llms.txt
> Use this file to discover all available pages before exploring further.

# Replace an instruction in an agent

> Replace a single exact passage while preserving the rest of the prompt.

**x-workspace-id** `number` *required*

Workspace ID. Use the workspace that owns the agent.

**id** `number` *required*

Numeric agent ID.

**revision** `string` *required*

Revision returned by the read operation.

**old\_text** `string` *required*

Exact passage from the saved instructions. It must occur once.

**new\_text** `string` *required*

Replacement text. Use an empty string to remove the passage.

Send the revision returned by the read, the exact passage as `old_text` and the replacement as `new_text`. Send an empty `new_text` to remove the passage. The server returns HTTP 409 if the prompt changed or the passage does not occur exactly once.

Use this operation for corrections or removals. Use `append_to_prompt` in [Update an agent](https://docs.tess.im/en/update-agent.md) when the request is to add a new instruction.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.