---
title: "Duplicate Widget"
method: POST
path: "/v1/widgets/{widget_id}/duplicate"
tags: ["Widgets"]
---

# Duplicate Widget

`POST /v1/widgets/{widget_id}/duplicate`

Duplicate a widget ('Copy of <name>') with its metrics; optionally link the copy to a dashboard.

## Path parameters

- `widget_id` string, required

## Headers

- `X-API-Key` string, required

## Request body

- DuplicateWidgetBody
  - `dashboard_id` string, nullable — Dashboard to link the copy to

## Response `200`

Successful Response

- WidgetModel
  - `id` string, required
  - `organization_id` string, nullable
  - `name` string, required
  - `description` string, nullable
  - `chart_type` string, required
  - `chart_mode` string, nullable
  - `data_type` string, required
  - `applies_to_all_agents` boolean
  - `bar_mode` string, nullable
  - `aggregation` string[], nullable
  - `time_bucket` string, nullable
  - `group_by` string, nullable
  - `simulation_ids` integer[], nullable
  - `show_indeterminate` boolean, nullable
  - `filters` unknown
  - `column_visibility` unknown
  - `created_by` string, nullable
  - `created_at` string, nullable
  - `updated_at` string, nullable
  - `widget_metrics` WidgetMetricModel[]
    - `metric` string, required — Metric key, e.g. 'call_count', 'latency', 'custom_metric', 'goal', 'tool_call', 'trace_attribute'
    - `custom_metric_id` string, nullable — Required when metric='custom_metric': id from the custom metrics API
    - `goal` string, nullable — Goal text when metric='goal'
    - `tool_call_id` string, nullable — Required when metric='tool_call'
    - `metadata_path` string, nullable — Trace attribute path when metric='trace_attribute'
    - `threshold_operator` 'lt' | 'lte' | 'gt' | 'gte', nullable — With threshold_value: graph the share of conversations meeting the condition instead of the metric's own value
    - `threshold_value` number, nullable — Compared against the metric's per-conversation value; set together with threshold_operator
    - `metadata_type` string, nullable — Trace attribute value type when metric='trace_attribute'
    - `id` string, nullable
    - `widget_id` string, nullable
  - `layout` WidgetLayoutModel — Position and size of a widget on a dashboard grid.
    - `x` integer, required — Column position, 1-based
    - `y` 1 | 2 | 3, required — Row position
    - `w` 1 | 2 | 3, required — Width in grid units
    - `h` 1 | 2 | 3, required — Height in grid units

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/getbluejay/apis/bluejay-api.md) · [All operations](https://skmtc.net/getbluejay/apis/bluejay-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getbluejay/bluejay-api/versions/f48cef80963f/schema)
