---
title: "Rename mainframe files or directories"
method: PUT
path: "/v1/integration/mainframe/projects/{projectId}/pipelines/{pipelineId}/files/rename"
tags: ["Build and Configure Mainframe Integration Projects"]
---

# Rename mainframe files or directories

`PUT /v1/integration/mainframe/projects/{projectId}/pipelines/{pipelineId}/files/rename`

## Request

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

Rename one or more mainframe files or directories in the specified pipeline. Supports conflict resolution strategies.

**Process Overview:**
1. **Request Validation** - Validates file/directory identifiers
2. **Conflict Detection** - Checks for naming conflicts with existing files or directories
3. **Resolution Strategy** - Applies specified conflict resolution (REPLACE_ALL, IGNORE_ALL, PARTIAL)
4. **Rename Execution** - Performs the rename operation(s)
5. **Response Generation** - Returns results with success/failure details per file or directory

**Conflict Resolution Strategies:**
- `REPLACE_ALL` - Replace all existing files or directories with conflicting names
- `IGNORE_ALL` - Skip all files or directories with conflicting names
- `PARTIAL` - Replace only provided in `replaceFiles` list, other conflicts are ignored

**Key Features:**
- Batch rename support for multiple files and directories
- Comprehensive error reporting with failure reasons

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

## Path parameters

- `projectId` string, required
- `pipelineId` string, required

## Query parameters

- `conflictResolution` 'REPLACE_ALL' | 'IGNORE_ALL' | 'PARTIAL'

## Request body

- MainframeFilesRequest: Request payload for mainframe files operations involving multiple files
  - `files` MainframeFileRequest[], required: List of files to be processed.
    - `currentFilePath` string, required: The current path/name of the file or folder.
    - `newFilePath` string, required: The new path/name for the file or folder.
    - `isDirectory` boolean: Indicates if the current path is a directory.
  - `replaceFiles` string[]: List of files to be replaced during the operation. only applicable for PARTIAL conflict resolution.

## Response `200`

Files renamed or cloned successfully

- MainframeFileOperationResponse: Represents the response of a mainframe file operation such as upload. rename etc.
  - `filesCreated` string[]: List of files that were renamed during the operation.
  - `filesRenamed` string[]: List of files that were renamed during the operation.
  - `filesConflicted` string[]: List of files that were conflicted during the operation.
  - `filesUpdated` string[]: List of files that were updated during the operation.
  - `filesDeleted` string[]: List of files that were deleted during the operation.
  - `filesIgnored` string[]: List of files that were ignored during the operation.
  - `errors` string[]: List of error messages encountered during the operation.

## Other responses

- `400`: Bad Request - Validation failed due to one of the following reasons: - Invalid project ID - Invalid pipeline ID - Invalid file name format - Missing required rename request fields - Empty rename request list
- `401`: Unauthorized - Authentication required, valid credentials not provided
- `403`: Forbidden - User lacks the required 'replication-pipeline::update' or legacy 'replication-pipeline::manage' permission
- `404`: Not Found - Pipeline does not exist
- `500`: Internal Server Error - Server encountered an unexpected condition, such as: - File rename operation failure

---

[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)
