---
type: api
title: Get an uploaded file
description: Get a file uploaded by an agent.<br/><br/>[Required authorization] Route required privileges: fleet-agents-read.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-get-fleet-agents-files-fileid-filename
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-get-fleet-agents-files-fileid-filename
products:
  - Kibana
---

# Get an uploaded file

- Server: `https://{kibana_url}`

## Paths

- `GET` `/api/fleet/agents/files/{fileId}/{fileName}`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v0/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v0/authentication#basicauth)

#### Path Parameters

- `fileId` (string)
  The ID of the uploaded file
- `fileName` (string)
  The name of the uploaded file

## Description

Get a file uploaded by an agent.<br/><br/>[Required authorization] Route required privileges: fleet-agents-read.

## Responses

#### `200`

Successful response — returns the uploaded file content

`application/json`

Type: `object`

#### `400`

Bad Request

`application/json`

- `attributes` (object)
- `error` (string)
- `errorType` (string)
- `message` (string)
- `statusCode` (number)
## Code Examples

#### Console

```console
GET /api/fleet/agents/files/{fileId}/{fileName}
```

#### curl

```curl
curl -X GET "https://{kibana_url}/api/fleet/agents/files/{fileId}/{fileName}"
```

## Response Examples

#### Get agent upload file

The uploaded file content as a stream

```json
<binary file content>
```

#### Generic error response

Example of a generic error response

```json
{
  "error": "Bad Request",
  "message": "An error message describing what went wrong",
  "statusCode": 400
}
```

