Update attachment origin Technical Preview; added in 9.4.0

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

Spaces method and path for this operation:

put /s/{space_id}/api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}/origin

Refer to Spaces for more information.

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

[Required authorization] Route required privileges: agentBuilder:read.

Headers

  • kbn-xsrf string Required

    A required header to protect against CSRF attacks

Path parameters

  • conversation_id string Required

    The unique identifier of the conversation.

  • attachment_id string Required

    The unique identifier of the attachment to update.

application/json

Body

  • origin string Required

    The origin string (e.g., saved object ID for visualizations and dashboards).

Responses

  • 200 application/json

    Indicates a successful response

PUT /api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}/origin
curl \
 --request PUT 'https://localhost:5601/api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}/origin' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --header "kbn-xsrf: true" \
 --data '{"origin":"abc123"}'
Request example
Example request for linking an attachment to a saved visualization
{
  "origin": "abc123"
}
Response examples (200)
Example response returning the attachment with updated origin
{
  "success": true,
  "attachment": {
    "id": "att-123",
    "type": "visualization",
    "active": true,
    "origin": "abc123",
    "versions": [
      {
        "data": {
          "esql": "FROM sales | STATS count=COUNT(*) BY month",
          "query": "Show monthly sales",
          "chart_type": "bar",
          "visualization": {}
        },
        "version": 1,
        "created_at": "2025-01-06T10:00:00.000Z",
        "content_hash": "sha256-xyz",
        "estimated_tokens": 50
      }
    ],
    "description": "Sales chart",
    "current_version": 1
  }
}