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

# Get a full K8s agent manifest

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

## Paths

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

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

## Description

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

Get 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

`application/json`

- `item` (string)
#### `400`

Bad Request

`application/json`

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

#### Console

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

#### curl

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

## Response Examples

#### Get k8s manifest

The Kubernetes manifest for deploying Elastic Agent

```json
{
  "item": "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
}
```

