Skip to main content
PUT
/
v0
/
boards
/
{boardId}
/
charts
/
{chartId}
Edit chart
curl --request PUT \
  --url https://api.formo.so/v0/boards/{boardId}/charts/{chartId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "chartId": "<string>",
  "projectId": "<string>",
  "title": "<string>",
  "query": "<string>",
  "description": "<string>",
  "x_axis": "<string>",
  "y_axis": [
    "<string>"
  ],
  "group_by": "<string>",
  "steps": [
    {
      "event": "<string>"
    }
  ],
  "settings": {
    "funnelType": "closed",
    "endStep": {
      "event": "<string>"
    },
    "maxSteps": 3,
    "nodesPerStep": 5,
    "filters": "<string>",
    "retentionFilter": {
      "event": "<string>"
    },
    "retentionUserFilters": [
      {
        "field": "<string>",
        "value": "<string>"
      }
    ],
    "retentionSignalType": "event"
  }
}
'
import requests

url = "https://api.formo.so/v0/boards/{boardId}/charts/{chartId}"

payload = {
"chartId": "<string>",
"projectId": "<string>",
"title": "<string>",
"query": "<string>",
"description": "<string>",
"x_axis": "<string>",
"y_axis": ["<string>"],
"group_by": "<string>",
"steps": [{ "event": "<string>" }],
"settings": {
"funnelType": "closed",
"endStep": { "event": "<string>" },
"maxSteps": 3,
"nodesPerStep": 5,
"filters": "<string>",
"retentionFilter": { "event": "<string>" },
"retentionUserFilters": [
{
"field": "<string>",
"value": "<string>"
}
],
"retentionSignalType": "event"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chartId: '<string>',
projectId: '<string>',
title: '<string>',
query: '<string>',
description: '<string>',
x_axis: '<string>',
y_axis: ['<string>'],
group_by: '<string>',
steps: [{event: '<string>'}],
settings: {
funnelType: 'closed',
endStep: {event: '<string>'},
maxSteps: 3,
nodesPerStep: 5,
filters: '<string>',
retentionFilter: {event: '<string>'},
retentionUserFilters: [{field: '<string>', value: '<string>'}],
retentionSignalType: 'event'
}
})
};

fetch('https://api.formo.so/v0/boards/{boardId}/charts/{chartId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.formo.so/v0/boards/{boardId}/charts/{chartId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'chartId' => '<string>',
'projectId' => '<string>',
'title' => '<string>',
'query' => '<string>',
'description' => '<string>',
'x_axis' => '<string>',
'y_axis' => [
'<string>'
],
'group_by' => '<string>',
'steps' => [
[
'event' => '<string>'
]
],
'settings' => [
'funnelType' => 'closed',
'endStep' => [
'event' => '<string>'
],
'maxSteps' => 3,
'nodesPerStep' => 5,
'filters' => '<string>',
'retentionFilter' => [
'event' => '<string>'
],
'retentionUserFilters' => [
[
'field' => '<string>',
'value' => '<string>'
]
],
'retentionSignalType' => 'event'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.formo.so/v0/boards/{boardId}/charts/{chartId}"

payload := strings.NewReader("{\n \"chartId\": \"<string>\",\n \"projectId\": \"<string>\",\n \"title\": \"<string>\",\n \"query\": \"<string>\",\n \"description\": \"<string>\",\n \"x_axis\": \"<string>\",\n \"y_axis\": [\n \"<string>\"\n ],\n \"group_by\": \"<string>\",\n \"steps\": [\n {\n \"event\": \"<string>\"\n }\n ],\n \"settings\": {\n \"funnelType\": \"closed\",\n \"endStep\": {\n \"event\": \"<string>\"\n },\n \"maxSteps\": 3,\n \"nodesPerStep\": 5,\n \"filters\": \"<string>\",\n \"retentionFilter\": {\n \"event\": \"<string>\"\n },\n \"retentionUserFilters\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"retentionSignalType\": \"event\"\n }\n}")

req, _ := http.NewRequest("PUT", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("https://api.formo.so/v0/boards/{boardId}/charts/{chartId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chartId\": \"<string>\",\n \"projectId\": \"<string>\",\n \"title\": \"<string>\",\n \"query\": \"<string>\",\n \"description\": \"<string>\",\n \"x_axis\": \"<string>\",\n \"y_axis\": [\n \"<string>\"\n ],\n \"group_by\": \"<string>\",\n \"steps\": [\n {\n \"event\": \"<string>\"\n }\n ],\n \"settings\": {\n \"funnelType\": \"closed\",\n \"endStep\": {\n \"event\": \"<string>\"\n },\n \"maxSteps\": 3,\n \"nodesPerStep\": 5,\n \"filters\": \"<string>\",\n \"retentionFilter\": {\n \"event\": \"<string>\"\n },\n \"retentionUserFilters\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"retentionSignalType\": \"event\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.formo.so/v0/boards/{boardId}/charts/{chartId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chartId\": \"<string>\",\n \"projectId\": \"<string>\",\n \"title\": \"<string>\",\n \"query\": \"<string>\",\n \"description\": \"<string>\",\n \"x_axis\": \"<string>\",\n \"y_axis\": [\n \"<string>\"\n ],\n \"group_by\": \"<string>\",\n \"steps\": [\n {\n \"event\": \"<string>\"\n }\n ],\n \"settings\": {\n \"funnelType\": \"closed\",\n \"endStep\": {\n \"event\": \"<string>\"\n },\n \"maxSteps\": 3,\n \"nodesPerStep\": 5,\n \"filters\": \"<string>\",\n \"retentionFilter\": {\n \"event\": \"<string>\"\n },\n \"retentionUserFilters\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"retentionSignalType\": \"event\"\n }\n}"

response = http.request(request)
puts response.read_body
"<string>"

Authorizations

Authorization
string
header
required

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

Path Parameters

boardId
string
required
chartId
string
required

Body

application/json

Request body for updating an existing chart.

chartId
string
required

ID of the chart to update.

projectId
string
required

Project the chart belongs to.

chart_type
enum<string>
required

Visualization type. Determines which other fields are required:

chart_typeExtra required fields
tablequery
numberquery (must return 1 row × 1 column)
barquery, x_axis, y_axis (≥ 1)
linequery, x_axis, y_axis (≥ 1)
piequery, y_axis (exactly 1)
stackedquery, x_axis, y_axis (exactly 1), group_by
funnelsteps (≥ 2), query placeholder "SELECT 1"
user_pathsquery, settings.startStep
retentionnone (query ignored)
Available options:
table,
number,
funnel,
bar,
line,
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.
  • retention: can be omitted or pass ""; 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 filters as extra keys on the step object (e.g. "rdns": { "op": "equals", "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: startStep, endStep, maxSteps, nodesPerStep, conversionWindow, filters
  • retention: retentionFilter, retentionUserFilters, retentionSignalType, retentionLabelSignal

All fields are optional at the schema level; see per-type validation rules for which are functionally required.

Response

200 - application/json

Chart updated

Chart ID