Skip to main content
POST

Overview

Creates a new chart and attaches it to a board. Returns the full chart object on success. The chart_type field controls which other request body fields are required or validated. Funnel charts derive SQL from steps and accept "SELECT 1" as the placeholder. User Paths charts derive SQL from settings.anchors, so omit query.

Request Fields


Chart Types

table

Renders query results in a paginated table. No axis fields needed.

number

Renders a single scalar value (KPI card). The query must return exactly 1 row × 1 column.

bar, line, and area

All three require x_axis and at least 1 column in y_axis. area requires exactly 1 column in y_axis when group_by is set.

pie

Requires exactly 1 column in y_axis. x_axis identifies the label column.

stacked

Requires x_axis, exactly 1 column in y_axis, and group_by.

Funnel Charts

Funnel charts measure step-by-step user conversion. The SQL is auto-generated from steps, so query must be the placeholder "SELECT 1". At least 2 steps are required.

The FunnelStep Object

Each step in the steps array has the following shape:

Filter Operators (StepFilterCondition)

For in and nin, join multiple values with a pipe |. Escape a literal pipe with \| and a literal backslash with \\. The legacy numeric long forms (greater, greaterOrEqual, less, lessOrEqual) are retired and rejected with a 400 naming the token. Send gt / gte / lt / lte. notEmpty and isEmpty are rejected on the numeric event columns volume / revenue / points.

settings for Funnel Charts

ConversionWindow

unit must be one of: hour · day · week (7 days).

breakdown values

device · browser · os · location · referrer · ref · utm_source · utm_medium · utm_campaign · utm_term · utm_content · builder_codes The top categories are shown individually. The rest collapse into “Others”.

Funnel Examples

Basic 3-step closed funnel

With per-step property filters

Filter step 2 to MetaMask wallets on Ethereum mainnet:

With breakdown by device

Open funnel with multi-value in filter


User Paths Charts

Visualize how users navigate your app through an ordered list of path anchors. settings.anchors requires at least one entry. One anchor produces an open-ended exploration; two or more constrain the path in order.

settings for User Paths Charts


Retention Charts

Measures how often users return over time. Omit the query field; retention data is fetched automatically.

settings for Retention Charts

Each RetentionUserFilter:
For all-user retention with no event filters, explicitly set both event filters to null:

Validation Reference


Response

201 Created - returns the full chart object.
Use the returned id with the Get Chart, Update Chart, and Delete Chart endpoints. 400 Bad Request - validation failed (missing required fields, invalid SQL, wrong step count, etc.). Branch on error.code; see Errors.

Overview

Creates a new chart and attaches it to a board. Returns the full chart object on success. The chart_type field controls which other request body fields are required or validated. Funnel charts derive SQL from steps and accept "SELECT 1" as the placeholder. User Paths charts derive SQL from settings.anchors, so omit query.

Request Fields


Chart Types

table

Renders query results in a paginated table. No axis fields needed.

number

Renders a single scalar value (KPI card). The query must return exactly 1 row × 1 column.

bar, line, and area

All three require x_axis and at least 1 column in y_axis. area requires exactly 1 column in y_axis when group_by is set.

pie

Requires exactly 1 column in y_axis. x_axis identifies the label column.

stacked

Requires x_axis, exactly 1 column in y_axis, and group_by.

Funnel Charts

Funnel charts measure step-by-step user conversion. The SQL is auto-generated from steps, so query must be the placeholder "SELECT 1". At least 2 steps are required.

The FunnelStep Object

Each step in the steps array has the following shape:

Filter Operators (StepFilterCondition)

For in and nin, join multiple values with a pipe |. Escape a literal pipe with \| and a literal backslash with \\. The legacy numeric long forms (greater, greaterOrEqual, less, lessOrEqual) are retired and rejected with a 400 naming the token. Send gt / gte / lt / lte. notEmpty and isEmpty are rejected on the numeric event columns volume / revenue / points.

settings for Funnel Charts

ConversionWindow

unit must be one of: hour · day · week (7 days).

breakdown values

device · browser · os · location · referrer · ref · utm_source · utm_medium · utm_campaign · utm_term · utm_content · builder_codes The top categories are shown individually. The rest collapse into “Others”.

Funnel Examples

Basic 3-step closed funnel

With per-step property filters

Filter step 2 to MetaMask wallet connections on Ethereum mainnet:

With breakdown by device

Open funnel with multi-value in filter


User Paths Charts

Visualize how users navigate your app through an ordered list of path anchors. settings.anchors requires at least one entry. One anchor produces an open-ended exploration; two or more constrain the path in order.

settings for User Paths Charts


Retention Charts

Measures how often users return over time. Omit the query field; retention data is fetched automatically.

settings for Retention Charts

Each RetentionUserFilter:
For all-user retention with no event filters, explicitly set both event filters to null:

Validation Reference


Response

201 Created - returns the full chart object.
Use the returned id with the Get Chart, Update Chart, and Delete Chart endpoints. 400 Bad Request - validation failed (missing required fields, invalid SQL, wrong step count, etc.). Branch on error.code; see Errors.

Authorizations

Authorization
string
header
required

Workspace API key (e.g. formo_xxx). Create one in the Formo dashboard under Team Settings > API.

Headers

Idempotency-Key
string

Optional unique value (e.g. a UUID v4) that lets you safely retry POST/PUT/PATCH/DELETE requests. The first request runs normally; subsequent requests with the same key replay the stored response (status + body) for 24 hours, so retries can never double-create or double-charge. Two concurrent requests with the same key return 409 IDEMPOTENCY_IN_PROGRESS. Generate a fresh key per logical operation.

Maximum string length: 255

Path Parameters

boardId
string
required

Body

application/json

Request body for creating a chart.

projectId
string
required

Project the chart belongs to.

chart_type
enum<string>
required

Visualization type. Determines which other fields are required:

Available options:
table,
number,
funnel,
bar,
line,
area,
pie,
stacked,
user_paths,
retention
title
string
required

Display name shown on the chart and board.

Minimum string length: 1
query
string

SQL query that powers the chart.

  • funnel: pass "SELECT 1"; the actual query is auto-generated from steps.
  • user_paths: omit it; the query is generated from settings.anchors.
  • retention: omit it; data is fetched automatically.
  • All other types: required; must be a valid SQL string.
Minimum string length: 1
description
string

Optional description.

x_axis
string

Column name for the X axis. Required for bar, line, and stacked.

y_axis
string[]

Column name(s) used as Y axis metrics.

  • bar / line: at least 1 element required.
  • pie / stacked: exactly 1 element required.
group_by
string

Column to group / stack series by. Required for stacked.

steps
object[]

Ordered list of funnel steps. Required for funnel (minimum 2 steps).

Each element is a FunnelStep; add property predicates in its canonical filters array (e.g. "filters": [{ "field": "rdns", "op": "eq", "value": "io.metamask" }]).

Minimum array length: 2
settings
object

Chart-type-specific configuration. The fields that apply depend on chart_type:

  • funnel: funnelType, conversionWindow, breakdown
  • user_paths: anchors, maxSteps, nodesPerStep, conversionWindow, filters
  • retention: entryFilter, retentionFilter, retentionUserFilters, retentionSignalType, retentionLabelSignal

Fields are optional at the schema level except where the selected chart type requires them. User Paths require at least one anchors entry. Retention requests must explicitly include entryFilter; use null for any event.

Response

Chart created

A saved chart attached to a board.

id
string
required
chart_type
enum<string>
required

Visualization type.

Available options:
table,
number,
funnel,
bar,
line,
area,
pie,
stacked,
user_paths,
retention
title
string
required
query
string
required

SQL query powering the chart. For funnel and retention charts this is a system-managed placeholder.

project_id
string
required
board_id
string
required
description
string | null
x_axis
string | null

Column used as the X axis.

y_axis
string[] | null

Column(s) used as Y axis metric(s).

group_by
string | null

Column used to group/stack series.

steps
object[] | null

Ordered list of funnel steps. Only present when chart_type is funnel.

settings
object | null

Type-specific configuration. See ChartSettings for all fields.