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

# Get a full agent policy

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

## Paths

- `GET` `/api/fleet/agent_policies/{agentPolicyId}/full`
- `GET` `/s/{space_id}/api/fleet/agent_policies/{agentPolicyId}/full`

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

#### Path Parameters

- `agentPolicyId` (string)
  The ID of the agent policy

## Description

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

Get a full agent policy by ID.<br/><br/>[Required authorization] Route required privileges: fleet-agent-policies-read.

## Query String Parameters

- `download` (boolean)
  If true, returns the policy as a downloadable file
- `standalone` (boolean)
  If true, returns the policy formatted for standalone agents
- `kubernetes` (boolean)
  If true, returns the policy formatted for Kubernetes deployment
- `revision` (number)
  If provided, returns the policy at the specified revision. Cannot be used with standalone or kubernetes flags.

## Responses

#### `200`

Successful response

`application/json`

- `item` (union anyOf)
  - **string**
  - **Kibana_HTTP_APIs_full_agent_policy**
    - `agent` (object)
      - `download` (object)
        - `auth` (object)
          - `api_key` (string)
          - `headers` ([] object · max: 100)
            - `key` (string)
            - `value` (string)
          - `password` (string)
          - `username` (string)
        - `proxy_headers` (map string to boolean | number | string) — nullable
        - `proxy_url` (string)
        - `secrets` (object)
          - `ssl` (object)
            - `key` (object)
              - `id` (string)
        - `sources` ([] string · max: 3)
        - `sourceURI` (string)
        - `ssl` (object)
          - `certificate` (string)
          - `certificate_authorities` ([] string · max: 10)
          - `key` (string)
          - `renegotiation` (string)
          - `verification_mode` (string)
        - `target_directory` (string)
        - `timeout` (string)
      - `features` (map string to object)
        Map values (object)
        - `enabled` (boolean)
      - `internal` (object)
      - `limits` (object)
        - `go_max_procs` (number)
      - `logging` (object)
        - `files` (object)
          - `interval` (string)
          - `keepfiles` (number)
          - `rotateeverybytes` (number)
        - `level` (string)
        - `metrics` (object)
          - `period` (string)
        - `to_files` (boolean)
      - `monitoring` (object)
        - `_runtime_experimental` (string)
        - `apm` (object)
        - `diagnostics` (object)
          - `limit` (object)
            - `burst` (number)
            - `interval` (string)
          - `uploader` (object)
            - `init_dur` (string)
            - `max_dur` (string)
            - `max_retries` (number)
        - `enabled` (boolean)
        - `http` (object)
          - `enabled` (boolean)
          - `host` (string)
          - `port` (number)
        - `logs` (boolean)
        - `metrics` (boolean)
        - `namespace` (string)
        - `pprof` (object)
          - `enabled` (boolean)
        - `traces` (boolean)
        - `use_output` (string)
      - `protection` (object)
        - `enabled` (boolean)
        - `signing_key` (string)
        - `uninstall_token_hash` (string)
    - `connectors` (map string to object)
    - `exporters` (map string to object)
    - `extensions` (map string to object)
    - `fleet` (union anyOf)
      - **{ hosts, proxy_headers, proxy_url, … }**
        - `hosts` ([] string · max: 100)
        - `proxy_headers` (map string to boolean | number | string) — nullable
        - `proxy_url` (string)
        - `secrets` (object)
          - `ssl` (object)
            - `key` (object)
              - `id` (string)
        - `ssl` (object)
          - `certificate` (string)
          - `certificate_authorities` ([] string · max: 10)
          - `key` (string)
          - `renegotiation` (string)
          - `verification_mode` (string)
      - **{ kibana }**
        - `kibana` (object)
          - `hosts` ([] string · max: 100)
          - `path` (string)
          - `protocol` (string)
    - `id` (string)
    - `inputs` ([] object · max: 10000)
      - `data_stream` (object)
        - `namespace` (string)
      - `id` (string)
      - `meta` (object)
        - `package` (object)
          - `name` (string)
          - `version` (string)
      - `name` (string)
      - `package_policy_id` (string)
      - `processors` ([] object · max: 10000)
        - `add_fields` (object)
          - `fields` (map string to number | string)
          - `target` (string)
      - `revision` (number)
      - `streams` ([] object · max: 10000)
        - `data_stream` (object)
          - `dataset` (string)
          - `type` (string)
        - `id` (string)
      - `type` (string)
      - `use_output` (string)
    - `namespaces` ([] string · max: 100)
    - `output_permissions` (map string to string to object)
    - `outputs` (map string to object)
      Map values (object)
      - `ca_sha256` (string) — nullable
      - `hosts` ([] string · max: 100)
      - `proxy_headers` (map string to boolean | number | string) — nullable
      - `proxy_url` (string)
      - `type` (string)
    - `processors` (map string to object)
    - `receivers` (map string to object)
    - `revision` (number)
    - `secret_references` ([] object · max: 10000)
      - `id` (string)
    - `service` (object)
      - `extensions` ([] string · max: 1000)
      - `pipelines` (map string to object)
        Map values (object)
        - `exporters` ([] string · max: 1000)
        - `processors` ([] string · max: 1000)
        - `receivers` ([] string · max: 1000)
    - `signed` (object)
      - `data` (string)
      - `signature` (string)
#### `400`

Bad Request

`application/json`

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

Not Found

## Code Examples

#### Console

```console
GET /api/fleet/agent_policies/{agentPolicyId}/full
```

#### curl

```curl
curl -X GET "https://{kibana_url}/api/fleet/agent_policies/{agentPolicyId}/full"
```

## Response Examples

#### Get full agent policy

The full agent policy configuration

```json
{
  "item": {
    "agent": {
      "monitoring": {
        "logs": true,
        "metrics": true
      }
    },
    "id": "agent-policy-id-1",
    "inputs": [],
    "outputs": {
      "default": {
        "hosts": [
          "https://elasticsearch.example.com:9200"
        ],
        "type": "elasticsearch"
      }
    },
    "revision": 1
  }
}
```

#### 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 agent policy was found with the given ID

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

