---
title: "Create Widget"
method: POST
path: "/api/v1/dashboards/{dashboard_id}/widgets"
tags: ["dashboards"]
---

# Create Widget

`POST /api/v1/dashboards/{dashboard_id}/widgets`

Create a widget on a dashboard.

## Path parameters

- `dashboard_id` string, uuid, required

## Request body

- WidgetCreate
  - `title` string, required
  - `viz_type` 'line' | 'bar' | 'pie' | 'number' | 'pivot' | 'logs_table' | 'heatmap', required
  - `config` object
  - `position` object — Grid placement {x, y, w, h}. OMIT to have the server append the widget below the existing layout at the default size for this viz_type.

## Response `201`

Successful Response

- WidgetRead
  - `id` string, uuid, required
  - `dashboard_id` string, uuid, required
  - `title` string, required
  - `viz_type` 'line' | 'bar' | 'pie' | 'number' | 'pivot' | 'logs_table' | 'heatmap', required
  - `config` object, required
  - `position` object, required
  - `is_system` boolean
  - `source_kind` 'system' | 'user', nullable
  - `source_ref` string, nullable
  - `source_config_snapshot` object, nullable
  - `source_viz_snapshot` 'line' | 'bar' | 'pie' | 'number' | 'pivot' | 'logs_table' | 'heatmap'
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `404` — Not found
- `422` — Invalid request body (array-shaped detail), or a semantically invalid widget configuration (string detail).

---

[API](https://skmtc.dev/getanana/apis/cleon-api.md) · [All operations](https://skmtc.dev/getanana/apis/cleon-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/getanana/cleon-api/revisions/c0f54348e251/schema)
