---
type: api
title: Update an agent
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v9/operation/operation-put-agent-builder-agents-id
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v9/operation/operation-put-agent-builder-agents-id
products:
  - Kibana
---

# Update an agent

Availability: Generally available since 9.2

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

## Paths

- `PUT` `/api/agent_builder/agents/{id}`
- `PUT` `/s/{space_id}/api/agent_builder/agents/{id}`

#### Path parameters

- `id` (string) — required
  The unique identifier of the agent to update.

## Description

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

Update an existing agent configuration. Use this endpoint to modify any aspect of the agent's behavior, appearance, or capabilities. To learn more about agents, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

## Required authorization

- Privileges: `agentBuilder:manageAgents`

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

- `kbn-xsrf` (string) — required
  A required header to protect against CSRF attacks

## Request body

`application/json`

- `access_control` (object) — optional
  - `access_mode` (enum) — required
    **Technical Preview; added in 9.4.0.** Access-control mode: `public` (any privileged user can read/write), `shared` (any privileged user can read, only owner can write), `private` (only owner can read/write).
    Values: `public`, `shared`, `private`
- `avatar_color` (string) — optional
  Updated hex color code for the agent avatar.
- `avatar_symbol` (string) — optional
  Updated symbol/initials for the agent avatar.
- `configuration` (object) — optional
  Updated configuration settings for the agent.
  - `connector_ids` (string[] · max items: 100) — optional
    Array of connector IDs to associate with the agent.
  - `enable_elastic_capabilities` (boolean) — optional
    When true, enables built-in Elastic capabilities for the agent.
  - `instructions` (string) — optional
    Updated system instructions that define the agent behavior.
  - `plugin_ids` (string[] · max items: 100) — optional
    Array of plugin IDs to assign to the agent.
  - `skill_ids` (string[] · max items: 100) — optional
    Array of skill IDs to be available to the agent.
  - `tools` (object[]) — optional
    - `tool_ids` (string[]) — required
      Array of tool IDs that the agent can use.
  - `workflow_ids` (string[] · max items: 100) — optional
- `description` (string) — optional
  Updated description of what the agent does.
- `labels` (string[]) — optional
  Updated labels for categorizing and organizing agents.
- `name` (string) — optional
  Updated display name for the agent.

## Response

Indicates a successful response

`application/json`

## Code examples

#### Console

```console
PUT kbn://api/agent_builder/agents/{id}
{
  "name": "Search Index Helper",
  "description": "Updated description - Search for anything in \"content-*\" indices!",
  "labels": ["custom-indices", "department-search", "elastic-employees"],
  "avatar_color": "#BFDBFF",
  "avatar_symbol": "SI",
  "configuration": {
    "instructions": "You are a custom agent that wants to help searching data using all indices starting with prefix \"content-\".",
    "tools": [{
      "tool_ids": [
        "platform.core.search",
        "platform.core.list_indices",
        "platform.core.get_index_mapping",
        "platform.core.get_document_by_id"
      ]
    }]
  }
}
```

#### curl

```curl
curl \
  -X PUT "${KIBANA_URL}/api/agent_builder/agents/{id}" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "kbn-xsrf: true" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Search Index Helper",
    "description": "Updated description - Search for anything in \"content-*\" indices!",
    "labels": ["custom-indices", "department-search", "elastic-employees"],
    "avatar_color": "#BFDBFF",
    "avatar_symbol": "SI",
    "configuration": {
      "instructions": "You are a custom agent that wants to help searching data using all indices starting with prefix \"content-\".",
      "tools": [{
        "tool_ids": [
          "platform.core.search",
          "platform.core.list_indices",
          "platform.core.get_index_mapping",
          "platform.core.get_document_by_id"
        ]
      }]
    }
  }'
```

## Response examples

#### Update agent response

Example response returning the agent definition with the changes applied from the request

```json
{
  "avatar_color": "#BFDBFF",
  "avatar_symbol": "SI",
  "configuration": {
    "instructions": "You are a custom agent that wants to help searching data using all indices starting with prefix \u0022content-\u0022.",
    "tools": [
      {
        "tool_ids": [
          "platform.core.search",
          "platform.core.list_indices",
          "platform.core.get_index_mapping",
          "platform.core.get_document_by_id"
        ]
      }
    ]
  },
  "description": "Updated description - Search for anything in \u0022content-*\u0022 indices!",
  "id": "created-agent-id",
  "labels": [
    "custom-indices",
    "department-search",
    "elastic-employees"
  ],
  "name": "Search Index Helper",
  "type": "chat"
}
```

