---
title: "Create a new mainframe file or directory"
method: POST
path: "/v1/integration/mainframe/projects/{projectId}/pipelines/{pipelineId}/files"
tags: ["Build and Configure Mainframe Integration Projects"]
---

# Create a new mainframe file or directory

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

## 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`
- Auth: HTTP bearer

Creates a new mainframe file or directory in the specified pipeline with the provided content and application type.

**Process Overview:**
1. **Request Validation** - Validates directory path, file/folder name, content, and application type
2. **File or Directory Creation** - Creates the file with specified content, or creates a directory if `directory=true`

**Directory Creation:**
- Request directory creation by setting `directory=true` in the request body. When creating a directory, `fileContent` must be null.
- Provide the directory structure in the `path` field (e.g. '/path/to') and the folder name in the `name` field.
- Use "/" for root directory path.

**File Creation:**
- Provide the directory path in the `path` field and the filename (with extension) in the `name` field.
- Upload the file content via the multipart `fileContent` field.

**File Application Types:**
- `ENGINE_SCRIPT` - Script files for execution engine
- `CONFIGURATION` - Configuration files

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

## Path parameters

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

## Response `201`

File or directory created successfully.
Location header contains the URI of the newly created file for future reference.

## Other responses

- `400`: Bad Request - Validation failed due to one of the following reasons: - Invalid project ID - Invalid pipeline ID - Invalid directory path or file/folder name format - Empty or missing file content (when not creating a directory) - Invalid file application type
- `401`: Unauthorized - Authentication required, valid credentials not provided
- `403`: Forbidden - User lacks the required 'replication-pipeline::create' 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 creation 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)
