---
title: "Ensure Portfolio Dashboard"
method: POST
path: "/api/v1/dashboards/ensure-portfolio"
tags: ["dashboards"]
---

# Ensure Portfolio Dashboard

`POST /api/v1/dashboards/ensure-portfolio`

Idempotent: return the Commercial tab's canonical booking dashboard (the
ex-Portfolio), creating + seeding it if none exists — or ``null`` when the
tenant removed the tab or its built-in (PLAN-deletable-system-tabs D8; the
provision ledger says it was provisioned before, so it is never recreated,
and a 404 would toast on every reporting mount).

Post-``kind`` cutover (PR5): the dashboard is identified by
``(category = Commercial, is_category_system_dashboard)`` — the partial
unique index ``uq_one_system_dashboard_per_category`` makes the create
race-safe (the loser retries the lookup). ``kind`` is neither read nor
written here; ``provision_reporting_categories`` first migrates any legacy
``kind='portfolio'`` dashboard into Commercial.

## Response `200`

Successful Response

- DashboardRead
  - `id` string, uuid, required
  - `name` string, required
  - `is_default` boolean, required
  - `kind` string, nullable
  - `category_id` string, uuid, nullable
  - `sort_order` integer
  - `is_category_system_dashboard` boolean
  - `is_category_default` boolean
  - `default_date_range` string, nullable, required
  - `created_by_user_id` string, uuid, nullable, required
  - `widgets` 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
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

---

[API](https://skmtc.dev/getanana/apis/cleon-api.md) · [All operations](https://skmtc.dev/getanana/apis/cleon-api/llms.txt) · [OpenAPI document](https://skmtc.dev/getanana/apis/cleon-api/revisions/59d90f796108?raw)
