---
title: "Update one project file"
method: PUT
path: "/v1/integration/projects/{projectId}/files/{fileId}"
tags: ["Unified Project Lifecycle APIs"]
---

# Update one project file

`PUT /v1/integration/projects/{projectId}/files/{fileId}`

## Request

- Base URL: `https://integration-adapter.connect.cloud.precisely.com`
- URL: `https://integration-adapter.connect.cloud.precisely.com/v1/integration/projects/{projectId}/files/{fileId}`
- Auth: HTTP bearer

Updates one project file through the unified project API.
The request `content` is a Base64-encoded string. The response returns updated metadata
and a new ETag; it does not return decoded content.

**Features:**
- Supports optimistic concurrency via the `If-Match` request header.
- Fails with a precondition-failed response when the file was changed since it was opened.
- Skips the write and returns `unchanged: true` when the submitted content, `mimeType`, and `encoding` already match the stored file (for example, a retried autosave); the file's version is not incremented in that case.

**Use Cases:**
- VS Code extension saves edits to an open file.
- User applies a content patch to an existing file.

**Authorization:** Requires `replication-pipeline::update` when permission harmonization is enabled; otherwise, `replication-pipeline::manage`.

## Path parameters

- `projectId` string, required
- `fileId` string, required

## Query parameters

- `projectType` 'REPLICATION' | 'MAINFRAME_REPLICATION' | 'ADVANCED_REPLICATION', required: Supported project types for unified project operations
- `pipelineId` string
- `revisionNumber` integer

## Headers

- `If-Match` string

## Request body

- ProjectFileUpdateRequest: Request payload for updating one project file's content
  - `content` string: Base64-encoded file content, decoded using the declared encoding
  - `mimeType` string: MIME type of the file content
  - `encoding` string: Encoding used to decode the Base64 content
  - `expectedVersion` integer: Expected current version, used for optimistic concurrency

## Response `200`

File updated successfully

- ProjectFileSummaryResponse: Project file metadata. Content is intentionally omitted.
  - `fileId` string: Unique identifier of the file
  - `dataFlowId` string: Advanced Replication dataflow identifier owning this file, when applicable
  - `fileName` string: File name derived from the flattened path
  - `flattenedPath` string: Path of the file within the project's flattened file tree
  - `version` integer: Current version number of the file
  - `phase` 'DRAFT' | 'APPROVED' | 'PENDING_DELETION': Lifecycle phase of the file
  - `mimeType` string: MIME type of the file content
  - `encoding` string: Encoding of the file content
  - `sizeBytes` integer: Size of the file content in bytes
  - `contentHash` string: Hash of the file content, used for change detection
  - `entryFile` boolean: Whether this file is the project's designated entry file
  - `unchanged` boolean: True when an update matched the stored file and no write was performed; omitted for read (list/get) and create/delete responses

## Other responses

- `400`: Bad Request — the resolved project type does not support files (DI-ADAPTER-PRF-0009)
- `401`: Unauthorized
- `403`: Forbidden — requires replication-pipeline::update when permission harmonization is enabled, or legacy replication-pipeline::manage otherwise
- `404`: Not Found — project or file does not exist (DI-ADAPTER-PRF-0001)
- `409`: Conflict — the project has a commit in progress, so file operations are temporarily blocked until it finishes (DI-ADAPTER-PRF-0005)
- `412`: Precondition Failed — file changed since it was last opened (DI-ADAPTER-PRF-0004)
- `500`: Internal Server Error — file update failed (DI-ADAPTER-PRF-0002)

---

[API](https://skmtc.dev/precisely/apis/precisely-integration-adapter-service.md) · [All operations](https://skmtc.dev/precisely/apis/precisely-integration-adapter-service/llms.txt) · [OpenAPI document](https://skmtc.dev/precisely/apis/precisely-integration-adapter-service/revisions/2d2629f4987d?raw)
