---
type: api
title: Lookup single agent configuration
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-searchsingleconfiguration
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-searchsingleconfiguration
products:
  - Kibana
---

# Lookup single agent configuration

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

## Paths

- `POST` `/api/apm/settings/agent-configuration/search`
- `POST` `/s/{space_id}/api/apm/settings/agent-configuration/search`

## Description

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

This endpoint allows to search for single agent configuration and update 'applied_by_agent' field.

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

## Header parameters

- `elastic-api-version` (enum · default: 2023-10-31) — required
  The version of the API to use
  Values: `2023-10-31`
- `kbn-xsrf` (string) — required
  A required header to protect against CSRF attacks

## Request body

`application/json`

- `etag` (string) — optional
  If etags match then `applied_by_agent` field will be set to `true`
- `mark_as_applied_by_agent` (boolean) — optional
  `markAsAppliedByAgent=true` means "force setting it to true regardless of etag".
This is needed for Jaeger agent that doesn't have etags
- `service` (object) — required
  Service
  - `environment` (string) — optional
    Environment
  - `name` (string) — optional
    Name

## Responses

#### `200`

Successful response

`application/json`

- `_id` (string)
  Identifier
- `_index` (string)
  Index
- `_score` (number)
  Score
- `_source` (object)
  Agent configuration
  - `@timestamp` (number)
    Timestamp
  - `agent_name` (string)
    Agent name
  - `applied_by_agent` (boolean)
    Applied by agent
  - `etag` (string)
    Etag
  - `service` (object)
    Service
    - `environment` (string)
      Environment
    - `name` (string)
      Name
  - `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
POST kbn:/api/apm/settings/agent-configuration/search
{
  "service": {}
}
```

#### curl

```curl
curl -X POST "${KIBANA_URL}/api/apm/settings/agent-configuration/search" \
  -H "elastic-api-version: 2023-10-31" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "service": {}
  }'
```

