---
title: "Pull a file from the device"
method: POST
path: "/sessions/{sessionId}/device/pullFile"
tags: ["Device File Management"]
---

# Pull a file from the device

`POST /sessions/{sessionId}/device/pullFile`

## Request

- Base URL: `https://api.us-west-1.saucelabs.com/rdc/v2`
- URL: `https://api.us-west-1.saucelabs.com/rdc/v2/sessions/{sessionId}/device/pullFile`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/saucelabs/apis/real-device-access-api-reference/docs/sessions/:sessionId/device/pullFile/post.ts> (a function with typed inputs; its response is checked against the schema)

Retrieves a file from the device storage as a binary stream.

## Path parameters

- `sessionId` string, required

## Request body

- PullFileRequest
  - `path` string, required: The absolute path of the file on the device to retrieve.
  - `bundleId` string: The iOS app bundle identifier (e.g., `com.example.app`). Required for iOS devices, not needed for Android. On iOS, each app runs in its own **sandbox** — an isolated file system container that restricts access to only that app's data. This means you must specify which app's sandbox to operate on by providing its bundle ID. You can find the bundle ID in Xcode, in the app's `Info.plist`, or via the Sauce Labs app management API. See [Apple's File System documentation](https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html) for more details.

## Response `200`

File retrieved successfully

## Other responses

- `400`: Bad request or missing bundleId for iOS file operations
- `404`: Not Found
- `422`: Capability not supported
- `500`: Device File Operation Error

---

[API](https://skmtc.dev/saucelabs/apis/real-device-access-api-reference.md) - [All operations](https://skmtc.dev/saucelabs/apis/real-device-access-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/saucelabs/apis/real-device-access-api-reference/revisions/f845a4b66e37?raw)
