---
type: api
title: Get file uploaded by agent
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-get-agent-upload-file
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-get-agent-upload-file
products:
  - Kibana
---

# Get file uploaded by agent

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

## Paths

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

#### Path parameters

- `fileId` (string) — required
- `fileName` (string) — required

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

## Responses

#### `200`

OK

`application/json`

- `body` (object)
  - `items` (object)
    - `body` (object)
    - `headers` (object)
#### `400`

Generic Error

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (number)
## Code examples

#### Console

```console
GET kbn:/api/fleet/agents/files/FILE_ID/FILE_NAME
```

#### curl

```curl
curl -X GET "${KIBANA_URL}/api/fleet/agents/files/${FILE_ID}/${FILE_NAME}" \
  -H "Authorization: ApiKey ${API_KEY}"
```

