---
type: api
title: Update attachment origin
description: Update the origin reference for an attachment. Use this after saving a by-value attachment to link it to its persistent store.<br/><br/>[Required authorization] Route required privileges: agentBuilder:read.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-put-agent-builder-conversations-conversation-id-attachments-attachment-id-origin
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-put-agent-builder-conversations-conversation-id-attachments-attachment-id-origin
products:
  - Kibana
---

# Update attachment origin

Availability: Experimental since 9.4

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

## Paths

- `PUT` `/api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}/origin`

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

## Description

Update the origin reference for an attachment. Use this after saving a by-value attachment to link it to its persistent store.

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

- `origin` (string · max length: 2048) — required
  The origin string (e.g., saved object ID for visualizations and dashboards).

## Response

Indicates a successful response

`application/json`

## Code examples

#### Console

```console
PUT kbn:/api/agent_builder/conversations/CONVERSATION_ID/attachments/ATTACHMENT_ID/origin
{
  "origin": "abc123"
}
```

#### curl

```curl
curl -X PUT "${KIBANA_URL}/api/agent_builder/conversations/${CONVERSATION_ID}/attachments/${ATTACHMENT_ID}/origin" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "origin": "abc123"
  }'
```

## Response examples

#### Update origin response

Example response returning the attachment with updated origin

```json
{
  "attachment": {
    "active": true,
    "current_version": 1,
    "description": "Sales chart",
    "id": "att-123",
    "origin": "abc123",
    "type": "visualization",
    "versions": [
      {
        "content_hash": "sha256-xyz",
        "created_at": "2025-01-06T10:00:00.000Z",
        "data": {
          "chart_type": "bar",
          "esql": "FROM sales | STATS count=COUNT(*) BY month",
          "query": "Show monthly sales",
          "visualization": {}
        },
        "estimated_tokens": 50,
        "version": 1
      }
    ]
  },
  "success": true
}
```

