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

# Get outputs for an agent policy

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

## Paths

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

#### Path parameters

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

## Description

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

Get a list of outputs associated with agent policy by policy id.

## Required authorization

- Privileges: `fleet-agent-policies-read` and `fleet-settings-read`

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

## Responses

#### `200`

Successful response

`application/json`

- `item` (object)
  - `agentPolicyId` (string)
  - `data` (object)
    - `integrations` (object[] · max items: 1000)
      - `id` (string)
      - `integrationPolicyName` (string)
      - `name` (string)
      - `pkgName` (string)
    - `output` (object)
      - `id` (string)
      - `name` (string)
  - `monitoring` (object)
    - `output` (object)
      - `id` (string)
      - `name` (string)
#### `400`

Bad Request

`application/json`

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

Not Found

`application/json`

## Code examples

#### Console

```console
GET kbn:/api/fleet/agent_policies/AGENT_POLICY_ID/outputs
```

#### curl

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

## Response examples

#### Get agent policy outputs

Outputs associated with the agent policy

```json
{
  "item": {
    "data_output": {
      "id": "output-id-1",
      "name": "Default output",
      "type": "elasticsearch"
    },
    "monitoring_output": {
      "id": "output-id-1",
      "name": "Default output",
      "type": "elasticsearch"
    }
  }
}
```

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

