---
title: "Replace the text content of one file in a session's artifact directory"
method: PUT
path: "/api/v1/sessions/{sessionId}/artifact-files"
tags: ["sessions"]
---

# Replace the text content of one file in a session's artifact directory

`PUT /api/v1/sessions/{sessionId}/artifact-files`

## Request

- Base URL: `http://127.0.0.1:3001`
- URL: `http://127.0.0.1:3001/api/v1/sessions/{sessionId}/artifact-files`
- Auth: none declared

## Path parameters

- `sessionId` string, required: Session identifier, e.g. project-1.

## Request body

- UpdateArtifactFileRequest
  - `content` string, required: The file's new UTF-8 text content.
  - `expectedFileFingerprint` string, required: Hex SHA-256 of the file content the edit started from.
  - `path` string, required: Artifact-directory-relative file path, as listed in the session's artifactFiles.

## Response `200`

OK

- ArtifactFileResponse
  - `fileFingerprint` string, required: Hex SHA-256 of the file's content.
  - `path` string, required
  - `size` integer, required

## Other responses

- `400`: Bad Request
- `404`: Not Found
- `409`: Conflict
- `500`: Internal Server Error
- `501`: Not Implemented

## Changes

- **2026-10-21** `8f160e6183cd`: 5 info
  - removed the `agent_switch_saga` enum value from the `reporting_owner` response property for the response status `400`
  - removed the `agent_switch_saga` enum value from the `reporting_owner` response property for the response status `404`
  - removed the `agent_switch_saga` enum value from the `reporting_owner` response property for the response status `409`
  - removed the `agent_switch_saga` enum value from the `reporting_owner` response property for the response status `500`
  - …1 more
- **2026-10-15** `4e814929ac08`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/composiohq/apis/agent-orchestrator-http-daemon/changes/api/v1/sessions/:sessionId/artifact-files/put.md)

---

[API](https://skmtc.dev/composiohq/apis/agent-orchestrator-http-daemon.md) - [All operations](https://skmtc.dev/composiohq/apis/agent-orchestrator-http-daemon/llms.txt) - [OpenAPI document](https://skmtc.dev/composiohq/apis/agent-orchestrator-http-daemon/revisions/61d7efd08578?raw)
