---
type: api
title: Get a list of agent configurations
description: Retrieve all agent configurations. You must have `read` privileges for the APM and User Experience feature in Kibana. If agent configuration is not available on the current deployment, the API returns a 404.
url: https://www.elastic.co/docs/api/doc/kibana/v0/operation/operation-getagentconfigurations
resource: https://www.elastic.co/docs/api/doc/kibana/v0/operation/operation-getagentconfigurations
products:
  - Kibana
---

# Get a list of agent configurations

Authentication: required

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

## Paths

- `GET` `/api/apm/settings/agent-configuration`

## Description

Retrieve all agent configurations. You must have `read` privileges for the APM and User Experience feature in Kibana. If agent configuration is not available on the current deployment, the API returns a 404.

## Header parameters

- `elastic-api-version` (enum · default: 2023-10-31) — required
  The version of the API to use
  Values: `2023-10-31`

## Responses

#### `200`

Successful response

`application/json`

- `configurations` (object[])
  Agent configuration
  - `@timestamp` (number)
    Timestamp
  - `agent_name` (string)
    Agent name
  - `applied_by_agent` (boolean)
    Applied by agent
  - `etag` (string)
    `etag` is sent by the APM agent to indicate the `etag` of the last successfully applied configuration. If the `etag` matches an existing configuration its `applied_by_agent` property will be set to `true`. Every time a configuration is edited `applied_by_agent` is reset to `false`.
  - `service` (object)
    Service
    - `environment` (string)
      The environment of the service.
    - `name` (string)
      The name of the service.
  - `settings` (map string to string)
    Agent configuration settings
#### `400`

Bad Request response

`application/json`

- `error` (string)
  Error type
- `message` (string)
  Error message
- `statusCode` (number)
  Error status code
#### `401`

Unauthorized response

`application/json`

- `error` (string)
  Error type
- `message` (string)
  Error message
- `statusCode` (number)
  Error status code
#### `404`

Not found response

`application/json`

- `error` (string)
  Error type
- `message` (string)
  Error message
- `statusCode` (number)
  Error status code
## Code examples

#### Console

```console
GET kbn:/api/apm/settings/agent-configuration
```

#### curl

```curl
curl -X GET "${KIBANA_URL}/api/apm/settings/agent-configuration" \
  -H "elastic-api-version: 2023-10-31" \
  -H "Authorization: ApiKey ${API_KEY}"
```

## Response examples

#### Get agent configurations response example1

`application/json`

An example of a successful response from `GET /api/apm/settings/agent-configuration`.

```json
[
  {
    "@timestamp": 1581934104843,
    "agent_name": "go",
    "applied_by_agent": false,
    "etag": "1e58c178efeebae15c25c539da740d21dee422fc",
    "service": {
      "environment": "production",
      "name": "opbeans-go"
    },
    "settings": {
      "capture_body": "off",
      "transaction_max_spans": "200",
      "transaction_sample_rate": "1"
    }
  },
  {
    "@timestamp": 1581934111727,
    "agent_name": "go",
    "applied_by_agent": false,
    "etag": "3eed916d3db434d9fb7f039daa681c7a04539a64",
    "service": {
      "name": "opbeans-go"
    },
    "settings": {
      "capture_body": "off",
      "transaction_max_spans": "300",
      "transaction_sample_rate": "1"
    }
  },
  {
    "@timestamp": 1582031336265,
    "agent_name": "nodejs",
    "applied_by_agent": false,
    "etag": "5080ed25785b7b19f32713681e79f46996801a5b",
    "service": {
      "name": "frontend"
    },
    "settings": {
      "transaction_sample_rate": "1"
    }
  }
]
```

#### Bad request

`application/json`

An example of a 400 Bad Request response, returned when the request payload or query parameters fail validation.

```json
{
  "error": "Bad Request",
  "message": "[request body]: expected value of type [string] but got [undefined]",
  "statusCode": 400
}
```

#### Unauthorized

`application/json`

An example of a 401 Unauthorized response, returned when the request is missing valid authentication credentials.

```json
{
  "error": "Unauthorized",
  "message": "[security_exception]: missing authentication credentials for REST request",
  "statusCode": 401
}
```

#### Not found

`application/json`

An example of a 404 Not Found response, returned when the requested resource does not exist or the feature is not available on the current deployment.

```json
{
  "error": "Not Found",
  "message": "Not Found",
  "statusCode": 404
}
```

