---
type: api
title: Download an agent manifest
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-get-fleet-kubernetes-download
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-get-fleet-kubernetes-download
products:
  - Kibana
---

# Download an agent manifest

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

## Paths

- `GET` `/api/fleet/kubernetes/download`
- `GET` `/s/{space_id}/api/fleet/kubernetes/download`

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

## Description

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

Download the Kubernetes manifest for deploying Elastic Agent.<br/><br/>[Required authorization] Route required privileges: fleet-agent-policies-read OR fleet-setup.

## Query String Parameters

- `download` (boolean)
  If true, returns the manifest as a downloadable file
- `fleetServer` (string)
  Fleet Server host URL to include in the manifest
- `enrolToken` (string)
  Enrollment token to include in the manifest

## Responses

#### `200`

Successful response — returns the Kubernetes manifest as a YAML file download

`application/json`

Type: `string`

#### `400`

Bad Request

`application/json`

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

Not Found

`application/json`

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

#### Console

```console
GET /api/fleet/kubernetes/download
```

#### curl

```curl
curl -X GET "https://{kibana_url}/api/fleet/kubernetes/download"
```

## Response Examples

#### Get download k8s manifest

The Kubernetes manifest download

```json
apiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: agent-node-datastreams\n  namespace: kube-system\n
```

#### Generic error response

Example of a generic error response

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

#### Not found

No manifest was found

```json
{
  "error": "Not Found",
  "message": "Agent manifest not found",
  "statusCode": 404
}
```

