> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blobhub.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get File

Read one file of an app blob revision.

## **POST** `/revisions/:id/data/query` (Command: `get_file`)

> [!NOTE]
>
> This is a binary response: pass `Accept: application/octet-stream` and the file's bytes come back as the response
> body, with the JSON envelope serialized into the `X-Response-Body` header instead of the body.
> `Access-Control-Expose-Headers` names `X-Response-Body`, so a browser client can read it.

### Request Body

| Parameter | Type | Required | Description |
| :- | :- | :- | :- |
| `command` | string | Yes | Must be `get_file`. |
| `path` | string | Yes | The file to read, relative to the app's root. |

### Response

The file's bytes, as `application/octet-stream`. The JSON envelope travels in the `X-Response-Body` header:

| Header | Value |
| :- | :- |
| `Content-Type` | `application/octet-stream` |
| `X-Response-Body` | `{"status": "success", "path": …, "size": …}`: the path read and its size in bytes. |

### Errors

| Status | Error | Cause |
| :- | :- | :- |
| 400 | `invalid_request_body` | `path` breaks the [path rule](https://docs.blobhub.io/blob-types/app/operations/put-file.md#request-body). |
| 403 | `forbidden` | The app blob is not public and the caller is not a member of it or of its organization. |
| 404 | `file_not_found` | The revision holds no file at `path`. |

### Example

```bash Request theme={null}
curl -X POST https://api.blobhub.io/v1/revisions/rev_001/data/query \
  -H "X-API-Key: $BLOB_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/octet-stream" \
  -d '{"command":"get_file","path":"blobs/schedules/blob.yaml"}' \
  -o blob.yaml -D -
```

```json Response theme={null}
{
  "status": "success",
  "path": "blobs/schedules/blob.yaml",
  "size": 412
}
```

The bytes land in `blob.yaml`; the JSON above is what `-D -` prints as the `X-Response-Body` header.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.