---
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/4371/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/4371/api/doc/kibana/v0/operation/operation-put-agent-builder-conversations-conversation-id-attachments-attachment-id-origin
products:
  - Kibana
---

# Update attachment origin

Availability: 9.4+

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

## Paths

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

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

#### Path Parameters

- `conversation_id` (string · max: 256)
  The unique identifier of the conversation.
- `attachment_id` (string · max: 256)
  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.<br/><br/>[Required authorization] Route required privileges: agentBuilder:read.

## Request Body

`application/json`

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

## Response

Indicates a successful response

## Code Examples

#### Console

```console
PUT /api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}/origin
{
  "origin": "abc123"
}
```

#### curl

```curl
curl -X PUT "https://{kibana_url}/api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}/origin" \
  -H "kbn-xsrf: true" \
  -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
}
```

