---
type: api
title: Get an agent by ID
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-get-agent-builder-agents-id
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-get-agent-builder-agents-id
products:
  - Kibana
---

# Get an agent by ID

Availability: 9.2+

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

## Paths

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

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

#### Path Parameters

- `id` (string)
  The unique identifier of the agent to retrieve.

## Description

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

Get a specific agent by ID. Use this endpoint to retrieve the complete agent definition including all configuration details and tool assignments. To learn more about agents, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).<br/><br/>[Required authorization] Route required privileges: agentBuilder:read.

## Response

Indicates a successful response

## Code Examples

#### Console

```console
GET kbn://api/agent_builder/agents/{id}
```

#### curl

```curl
curl \
  -X GET "${KIBANA_URL}/api/agent_builder/agents/{id}" \
  -H "Authorization: ApiKey ${API_KEY}"
```

## Response Examples

#### Get agent by id response

Example response that an agent created by the user that will query elasticsearch indices starting with 'content-' prefix to answer the questions.

```json
{
  "access_control": {
    "access_mode": "private",
    "entries": [
      {
        "name": "alice",
        "role": "manager",
        "type": "user"
      }
    ]
  },
  "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": "Hi! I can help you search the data within the indices starting with \u0022content-\u0022 prefix.",
  "id": "created-agent-id",
  "labels": [
    "custom-indices",
    "department-search"
  ],
  "name": "Search Index Helper",
  "permissions": {
    "update_access_control": true,
    "update_agent": true
  },
  "type": "chat"
}
```

