---
title: "Create or update agent configuration"
method: PUT
path: "/api/apm/settings/agent-configuration"
tags: ["APM agent configuration"]
---

# Create or update agent configuration

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

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

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

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

Create or update an agent configuration. You must have `all` privileges for the APM and User Experience feature in Kibana. When updating an existing configuration, the `?overwrite=true` query parameter is required. If the configuration already exists and `overwrite` is not set to `true`, the API returns a 400 error. When successful and Fleet is enabled, APM package policies are synchronized accordingly.

## Query parameters

- `overwrite` boolean

## Headers

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

## Request body

- APMUIAgentConfigurationIntakeObject
  - `agent_name` string — The agent name is used by the UI to determine which settings to display.
  - `service` APMUIServiceObject, required — Service
    - `environment` string — The environment of the service.
    - `name` string — The name of the service.
  - `settings` APMUISettingsObject, required — Agent configuration settings

## Response `200`

Successful response

- object — The response body is intentionally empty for this endpoint.

## Other responses

- `400` — Bad Request response
- `401` — Unauthorized response
- `403` — Forbidden 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/versions/531c9e2a7d23/schema)
