---
title: "Lookup single agent configuration"
method: POST
path: "/api/apm/settings/agent-configuration/search"
tags: ["APM agent configuration"]
deprecated: true
---

# Lookup single agent configuration

`POST /api/apm/settings/agent-configuration/search`

> **Deprecated.**

**Spaces method and path for this operation:**

<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/apm/settings/agent-configuration/search</span></div>

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

DEPRECATED: This endpoint is intended for internal use by APM agents to fetch their configuration and mark it as applied. Do not use for new integrations. It searches for a single agent configuration matching the given service, and optionally updates the `applied_by_agent` field when the provided `etag` matches the current configuration.

## Headers

- `elastic-api-version` '2023-10-31', required
- `kbn-xsrf` string, required

## Request body

- APMUISearchAgentConfigurationObject
  - `error` string — If provided, the agent configuration will be marked as error and `applied_by_agent` will be set to `false`. This is useful for cases where the agent configuration was not applied successfully.
  - `etag` string — If etags match then `applied_by_agent` field will be set to `true`
  - `mark_as_applied_by_agent` boolean — `markAsAppliedByAgent=true` means "force setting it to true regardless of etag". This is needed for Jaeger agent that doesn't have etags
  - `service` APMUIServiceObject, required — Service
    - `environment` string — The environment of the service.
    - `name` string — The name of the service.

## Response `200`

Successful response

- APMUISearchAgentConfigurationResponse
  - `_id` string — Identifier
  - `_index` string — Index
  - `_score` number — Score
  - `_source` APMUIAgentConfigurationObject — Agent configuration
    - `@timestamp` number, required — Timestamp
    - `agent_name` string — Agent name
    - `applied_by_agent` boolean — Applied by agent
    - `etag` string, required — `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` APMUIServiceObject, required — Service
      - `environment` string — The environment of the service.
      - `name` string — The name of the service.
    - `settings` APMUISettingsObject, required — Agent configuration settings

## Other responses

- `400` — Bad Request response
- `401` — Unauthorized response
- `404` — Not found response

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/revisions/c52eb4b0e51f/schema)
