Push API.
Replace a visual's JSON document from anything that can make an HTTP request: a script, a cron job, a CI step, a cloud function. Every open copy of the dashboard shows the new document within 15 seconds.
Endpoint
PUT https://api.outputcharts.com/visuals/{visualId}/dataPOST does the same thing. In the editor, select a visual and choose Copy push URL under Push from code to get its URL with the id filled in.
Authentication
Send an API key as a bearer token: Authorization: Bearer oc_live_…. Create keys under Account → API keys. A key's secret is shown once, and a new key can take a few seconds before its first push is accepted. Every account can make up to five keys. On Free each chart takes one update a day once its dashboard is a day old; Solo is live.
Call the API from a server, a script or a job, never from a web page: the key would be visible to anyone, and browsers on other sites are refused anyway.
Request body
The visual's whole document, as JSON, with Content-Type: application/json. It must fit the visual's type; each type's page lists its fields:
- Bar
- Horizontal bar
- Line
- Area
- Pie
- KPI
- Table
- Markdown
- Scatter
- Funnel
- Gauge
- Map
- Progress list
- Status grid
- Heatmap
- Waterfall
- Treemap
- Sankey
A push replaces the whole document, and the last push wins. Send every series and row each time.
The same push on the agent API, PUT /v1/visuals/{id}/data, also takes text/csv rows, turns numeric strings such as "1,204" or "$12" into numbers and lists what it changed, and has POST /v1/visuals/{id}/rows to append rows instead of resending them all.
Response
200 with the visual's id and the time of the change:
{ "visualId": "<visual-id>", "updatedAt": "2026-10-18T17:02:11.000Z" }Errors
Failures answer with a status, and a body of { error, code }:
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_json | The body is not valid JSON. |
| 400 | invalid_request | The visual id in the URL is not a valid id. |
| 401 | invalid_api_key | The key is missing, mistyped or revoked. A brand-new key can take a few seconds to work. |
| 403 | requires_solo | The account is on Free and the key tried to change a dashboard other than its first. |
| 403 | forbidden | The visual belongs to a different account from the key. |
| 404 | not_found | No visual has that id, or it was deleted. |
| 413 | payload_too_large | The document is over 100 KB. |
| 422 | invalid_document | The JSON does not fit the visual's type. details lists each problem. |
| 429 | rate_limited | More than 60 pushes from one key in the current minute. |
| 429 | daily_limit | On Free, this chart was already updated today, or the account has added three charts today. nextUpdateAt says when. |
A 422 also lists up to 20 problems, each with the path of the field and what was expected:
{
"error": "Visual document is invalid",
"code": "invalid_document",
"details": [{ "path": "data[1].revenue", "message": "Expected number" }]
}Limits
- 60 pushes per key per clock minute. A
429 rate_limitedclears when the next UTC minute starts; on Free, a429 daily_limitclears when the next UTC day starts. Each carries aRetry-Afterheader with the seconds until then. - Documents up to 100 KB.
- Up to five keys.
Examples
cURL
curl -X PUT "https://api.outputcharts.com/visuals/<visual-id>/data" \
-H "Authorization: Bearer $OC_KEY" \
-H "Content-Type: application/json" \
-d '{ "label": "Orders today", "value": 214, "format": "number" }'Python
import os
import requests
response = requests.put(
"https://api.outputcharts.com/visuals/<visual-id>/data",
json={"label": "Orders today", "value": 214, "format": "number"},
headers={"Authorization": f"Bearer {os.environ['OC_KEY']}"},
timeout=10,
)
response.raise_for_status()Node.js
const response = await fetch("https://api.outputcharts.com/visuals/<visual-id>/data", {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.OC_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ label: "Orders today", value: 214, format: "number" }),
});
if (!response.ok) throw new Error(`Push failed: ${response.status}`);