Create a draft asset — returns an inline preview image
create_assetCreates a draft. The response includes a low-res PNG preview INLINE — look at it, then iterate with update_asset. Nothing is public until publish_asset, or until you pass publish: true here (one call instead of two, once the chart is final). A success means the config validated AND rendered. Style comes from the brand — only set config fields the story needs. data = {columns: [{id,type,...}], rows: [[...], ...]} (row-major, matching column order). LIMITS: keep each call under ~100 KB of rows (asset cap 2 MB) — for larger datasets create with a few rows and attach set_data_source, or append chunks via replace_asset_data.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Typed columns + row-major rows | |
| type | No | Asset type, e.g. "line" (list_asset_types). Required unless template is given. | |
| brand | No | Brand slug or id; omit for the default brand | |
| title | No | Convenience alias for config.title.text — the SAME field; if both are given, title wins. Color-span markup belongs in config.title.text. | |
| config | No | Type-specific config (get_spec_schema). Must include encoding. | |
| publish | No | Publish immediately, so the returned url/pngUrl/embedUrl are live. Leave it off while you are still iterating on the preview. | |
| template | No | Start from a published chart (list_templates, or any chart id you were shown): its type and whole design are copied, your config merges on top (set title.text), and your data must supply the column ids the template expects — the error names them if not. The fastest way to a good-looking chart. |