---
type: api
title: Lookup single agent configuration
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-searchsingleconfiguration
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/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`

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

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

## 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` ({}) — 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` ({})
  Agent configuration
  - `@timestamp` (number)
    Timestamp
  - `agent_name` (string)
    Agent name
  - `applied_by_agent` (boolean)
    Applied by agent
  - `etag` (string)
    Etag
  - `service` ({})
    Service
    - `environment` (string)
      Environment
    - `name` (string)
      Name
  - `settings` (object)
    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 /api/apm/settings/agent-configuration/search
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/apm/settings/agent-configuration/search" \
  -H "elastic-api-version: string" \
  -H "kbn-xsrf: true"
```

