---
type: api
title: Download a file
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-endpointfiledownload
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-endpointfiledownload
products:
  - Kibana
---

# Download a file

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

## Paths

- `GET` `/api/endpoint/action/{action_id}/file/{file_id}/download`
- `GET` `/s/{space_id}/api/endpoint/action/{action_id}/file/{file_id}/download`

#### Path parameters

- `action_id` (string) — required
- `file_id` (string) — required

## Description

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

Download a file from an endpoint. 
> info
> To construct a `file_id`, combine the `action_id` and `agent_id` values using a dot separator:
> {`file_id`} = {`action_id`}`.`{`agent_id`}

## 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>`

## Response

OK

`application/json`

Type: `object`

## Code examples

#### Console

```console
GET kbn:/api/endpoint/action/ACTION_ID/file/FILE_ID/download
```

#### curl

```curl
curl -X GET "${KIBANA_URL}/api/endpoint/action/${ACTION_ID}/file/${FILE_ID}/download" \
  -H "Authorization: ApiKey ${API_KEY}"
```

