﻿---
title: stack kb dashboards upsert-dashboard cli command
description: Upsert a dashboard Behaviour flags: --dry-run — validate all inputs and exit without performing any action 
url: https://www.elastic.co/elastic/docs-builder/docs/4302/reference/elastic-cli/cli/stack/kb/dashboards/upsert-dashboard
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# stack kb dashboards upsert-dashboard cli command
<cli-modifiers>
</cli-modifiers>

```bash
elastic stack kb dashboards upsert-dashboard --id <id> --title <title> [options]
```

Upsert a dashboard
**Behaviour flags:**
`--dry-run` — validate all inputs and exit without performing any action

## Options

<definitions>
  <definition term="--id string required">
    The unique ID of the dashboard to be created or updated
  </definition>
  <definition term="--title string required">
    A human-readable title for the dashboard.
  </definition>
  <definition term="--access-control string">
  </definition>
  <definition term="--description string">
    A short description of the dashboard.
  </definition>
  <definition term="--esql-approximation">
    When `true`, ES|QL visualizations that use `STATS` run with [approximate execution](https://www.elastic.co/docs/reference/query-languages/esql/esql-query-approximation) for faster, estimated results.
  </definition>
  <definition term="--filters string[]">
    Filters applied across all panels, including pinned panels.
    **Repeatable:** pass `--filters` multiple times to supply more than one value
  </definition>
  <definition term="--options string">
  </definition>
  <definition term="--panels string[]">
    Panels and sections in the dashboard. Each entry is either a panel (with a `type` and `config`) or a collapsible section (with a `title`, `collapsed` state, and nested `panels`).
    **Repeatable:** pass `--panels` multiple times to supply more than one value
  </definition>
  <definition term="--pinned-panels string[]">
    An array of control panels and their state in the control group.
    **Repeatable:** pass `--pinned-panels` multiple times to supply more than one value
  </definition>
  <definition term="--project-routing string">
    Controls [cross-project search](https://www.elastic.co/docs/explore-analyze/cross-project-search/cross-project-search-project-routing) behavior for this dashboard (Serverless only). Set to `_alias:_origin` to scope data to the current project, or `_alias:*` to search across all projects. When omitted, the space default applies.
  </definition>
  <definition term="--query string">
  </definition>
  <definition term="--refresh-interval string">
  </definition>
  <definition term="--tags string[]">
    Tag IDs to associate with this dashboard.
    **Repeatable:** pass `--tags` multiple times to supply more than one value
  </definition>
  <definition term="--time-range string">
  </definition>
  <definition term="--input-file string">
    path to a JSON file to use as command input
  </definition>
  <definition term="--dry-run">
    validate all inputs and exit without performing any action (preview changes without applying them)
  </definition>
  <definition term="--no-validate">
    skip input validation and send the request as-is
  </definition>
</definitions>


## Global Options

<definitions>
  <definition term="--output-fields string">
    comma-separated list of fields to include in output (dot-notation supported)
  </definition>
  <definition term="--output-template string">
    Mustache-like template for custom text output (e.g. "{{id}}: {{name}}")
  </definition>
  <definition term="--json">
    output as JSON
  </definition>
</definitions>