---
title: "Create Card"
method: POST
path: "/api/workspace/analytics/cards"
tags: ["workspace-analytics", "workspace-analytics"]
---

# Create Card

`POST /api/workspace/analytics/cards`

## Request

- Base URL: `https://api.dialogbrain.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.dialogbrain.com/api/workspace/analytics/cards`
- Auth: none declared

Create a new pinned dashboard card.

SQL is guard-validated (shape + allowlist). Card is appended to the bottom
of the grid (y = max(y+h) of existing cards).

## Request body

- CardCreate
  - `title` string, required
  - `question` string, required
  - `sql` string, required
  - `chart` ChartSpec, required: Chart configuration: type + optional x/y column names.
    - `type` 'number' | 'table' | 'bar' | 'hbar' | 'line' | 'area' | 'pie', required
    - `x` string, nullable
    - `y` string, nullable
  - `source` 'workspace' | 'database'

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway.md) · [All operations](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/revisions/77bef09a9209?raw)
