---
title: "Get mainframe file or directory by ID"
method: GET
path: "/v1/integration/mainframe/projects/{projectId}/pipelines/{pipelineId}/files/{fileId}"
tags: ["Build and Configure Mainframe Integration Projects"]
---

# Get mainframe file or directory by ID

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

## 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/{fileId}`
- Auth: HTTP bearer

Retrieves a mainframe file or directory by its unique file ID.

**Response Modes:**
- When `contentOnly=true` or not provided (default): Returns raw file content as octet-stream for direct download/viewing (files only)
- When `contentOnly=false`: Returns complete file/directory metadata including path, name, content, timestamps, and application type as JSON

**Use Cases:**
- Download raw file content (contentOnly=true, default, files only)
- View file or directory details and content (contentOnly=false)
- Access individual file or directory metadata

**Required Permissions:** `replication-pipeline::view`

## Path parameters

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

## Query parameters

- `contentOnly` boolean

## Response `200`

Successfully retrieved file

- MainframeFileResponse: Represents the response containing mainframe file metadata and content.
  - `id` string: Unique identifier of the mainframe file.
  - `fileName` string: Name of the mainframe file.
  - `fileContent` string: Base64-encoded content of the mainframe file.
  - `contentHash` string: SHA-256 content hash of the decoded file bytes.
  - `size` integer: File size in bytes.
  - `uploadedDate` string, date-time: Date when the file was uploaded.
  - `modifiedDate` string, date-time: Date when the file was last modified.
  - `lastModifiedBy` string: Username of the last person who modified the file.
  - `fileApplicationType` 'ENGINE_SCRIPT' | 'CONFIGURATION': Application type of the file, e.g., ENGINE_SCRIPT or CONFIGURATION.

## Other responses

- `400`: Bad Request - Validation failed due to one of the following reasons: - Invalid project ID - Invalid pipeline ID - Invalid file ID
- `401`: Unauthorized - Authentication required, valid credentials not provided
- `403`: Forbidden - User lacks 'replication-pipeline::view' permission
- `404`: Not Found - File not found with the given ID
- `500`: Internal Server Error - Server encountered an unexpected condition, such as: - File retrieval 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)
