---
type: api
title: Rename attachment
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/operation/operation-patch-agent-builder-conversations-conversation-id-attachments-attachment-id
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/operation/operation-patch-agent-builder-conversations-conversation-id-attachments-attachment-id
products:
  - Kibana
---

# Rename attachment

Availability: Experimental since 9.2

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

## Paths

- `PATCH` `/api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}`
- `PATCH` `/s/{space_id}/api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}`

#### Path parameters

- `conversation_id` (string · max length: 256) — required
  The unique identifier of the conversation.
- `attachment_id` (string · max length: 256) — required
  The unique identifier of the attachment to rename.

## Description

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

Rename an attachment without creating a new version.

## Required authorization

- Privileges: `agentBuilder:read`

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

- `description` (string · max length: 2048) — required
  The new description/name for the attachment.

## Response

Indicates a successful response

`application/json`

## Code examples

#### Console

```console
PATCH kbn:/api/agent_builder/conversations/CONVERSATION_ID/attachments/ATTACHMENT_ID
{
  "description": "Updated attachment name"
}
```

#### curl

```curl
curl -X PATCH "${KIBANA_URL}/api/agent_builder/conversations/${CONVERSATION_ID}/attachments/${ATTACHMENT_ID}" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Updated attachment name"
  }'
```

## Response examples

#### Rename attachment response

Example response returning the renamed attachment (version unchanged)

```json
{
  "attachment": {
    "active": true,
    "current_version": 1,
    "description": "Updated attachment name",
    "id": "att-abc123",
    "type": "text",
    "versions": [
      {
        "content_hash": "sha256-xyz",
        "created_at": "2025-01-06T10:00:00.000Z",
        "data": "Content remains the same",
        "estimated_tokens": 10,
        "version": 1
      }
    ]
  },
  "success": true
}
```

