---
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/4493/api/doc/kibana-serverless/operation/operation-get-fleet-kubernetes
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana-serverless/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`

## Description

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

Get the Kubernetes manifest for deploying Elastic Agent.

## Required authorization

- Privileges: `fleet-agent-policies-read` or `fleet-setup`

## Authentication

- Api key: `Authorization: <value>`
  You must create an API key and use the encoded value in the request header. To learn about creating keys, go to [API keys](https://www.elastic.co/docs/current/serverless/api-keys).

## Query string parameters

- `download` (boolean) — optional
  If true, returns the manifest as a downloadable file
- `fleetServer` (string) — optional
  Fleet Server host URL to include in the manifest
- `enrolToken` (string) — optional
  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 kbn:/api/fleet/kubernetes
```

#### curl

```curl
curl -X GET "${KIBANA_URL}/api/fleet/kubernetes" \
  -H "Authorization: ApiKey ${API_KEY}"
```

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

