---
title: "Change a chart’s type, theme, title or language"
method: PATCH
path: "/v1/charts/{id}"
---

# Change a chart’s type, theme, title or language

`PATCH /v1/charts/{id}`

## Request

- Base URL: `https://api.typesearch.ai`
- URL: `https://api.typesearch.ai/v1/charts/{id}`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Redraws from the same data: free, no new search. `type` must be one of `compatible_types`.

## Request body

- ChartUpdateRequest
  - `type` 'line' | 'area' | 'bar' | 'bar_horizontal' | 'stacked_bar' | 'pie' | 'donut' | 'scatter' | 'funnel' | 'timeline' | 'kpi' | 'table'
  - `theme` 'light' | 'dark' | 'editorial' | 'electric'
  - `title` string
  - `subtitle` string
  - `locale` 'en' | 'es'

## Response `200`

The updated chart.

- Chart
  - `id` string, nullable, required: chart_…; null with store: false or plan_only.
  - `object` 'chart', required
  - `type` 'line' | 'area' | 'bar' | 'bar_horizontal' | 'stacked_bar' | 'pie' | 'donut' | 'scatter' | 'funnel' | 'timeline' | 'kpi' | 'table', nullable, required
  - `theme` 'light' | 'dark' | 'editorial' | 'electric', required
  - `locale` 'en' | 'es', required
  - `chart` object, nullable, required: What is drawn: series, key figures, annotations, sources. Null with plan_only.
    - `type` 'line' | 'area' | 'bar' | 'bar_horizontal' | 'stacked_bar' | 'pie' | 'donut' | 'scatter' | 'funnel' | 'timeline' | 'kpi' | 'table', required
    - `title` string, required: States the finding: «The blue dollar rose 4.1% this week».
    - `subtitle` string
    - `x` object, required
      - `kind` 'time' | 'category' | 'number', required
      - `label` string
      - `unit` string
      - `granularity` 'hour' | 'day' | 'week' | 'month' | 'year'
    - `y` object, required
      - `label` string
      - `unit` string
      - `format` 'number' | 'percent' | 'currency'
      - `currency` string
      - `decimals` number
      - `higher_is_better` boolean
    - `x_measure` object
      - `label` string
      - `unit` string
      - `format` 'number' | 'percent' | 'currency'
      - `currency` string
      - `decimals` number
      - `higher_is_better` boolean
    - `series` object[], required
      - `name` string, required
      - `role` 'positive' | 'neutral' | 'negative' | 'other'
      - `points` object[], required
        - `x` union, required
          - string
          - number
        - `y` number, required
        - `r` number
        - `label` string
        - `sources` integer[]: Indexes in `sources`: where this value was published.
    - `events` object[]
      - `date` string, required
      - `end` string
      - `label` string, required
      - `detail` string
      - `sources` integer[]
    - `columns` object[]
      - `key` string, required
      - `label` string, required
      - `format` object
        - `label` string
        - `unit` string
        - `format` 'number' | 'percent' | 'currency'
        - `currency` string
        - `decimals` number
        - `higher_is_better` boolean
    - `rows` object[]
    - `kpis` object[]: The key figures above the chart: latest, change, high.
      - `label` string, required
      - `value` number, required
      - `format` object
        - `label` string
        - `unit` string
        - `format` 'number' | 'percent' | 'currency'
        - `currency` string
        - `decimals` number
        - `higher_is_better` boolean
      - `change` object
        - `value` number, required
        - `percent` boolean, required
    - `annotations` object[]
      - `x` union, required
        - string
        - number
      - `y` number
      - `series` string
      - `text` string, required
      - `kind` 'peak' | 'max' | 'min' | 'last' | 'event', required
    - `highlight` string
    - `total` number
    - `part_of_whole` boolean
    - `scale` 'linear' | 'log'
    - `smoothing` integer: Moving average drawn over the raw series, in points.
    - `attribution` string
  - `compatible_types` string[], required: The chart types this data supports.
  - `plan` object, nullable, required: From a query: what was measured and why this chart. Null for your own data.
    - `recipe` 'coverage' | 'coverage_compare' | 'share_of_voice' | 'tone' | 'tone_compare' | 'outlets' | 'timeline' | 'figure_trend' | 'figure_compare' | 'answers' | 'index_prices' | 'index_scatter' | 'index_availability' | 'index_brands' | 'data' | 'series' | 'people' | 'outlet' | 'stories', required: What was measured: coverage, share_of_voice, tone, outlets, timeline, figure_trend, figure_compare, answers, or index_* from your custom index.
    - `intent` string, required
    - `measure` string, required
    - `x_axis` string, required
    - `type` 'line' | 'area' | 'bar' | 'bar_horizontal' | 'stacked_bar' | 'pie' | 'donut' | 'scatter' | 'funnel' | 'timeline' | 'kpi' | 'table', required
    - `part_of_whole` boolean, required
    - `confidence` number, required
    - `alternatives` object[], required: Other chart types that fit: switch with PATCH, free.
      - `type` 'line' | 'area' | 'bar' | 'bar_horizontal' | 'stacked_bar' | 'pie' | 'donut' | 'scatter' | 'funnel' | 'timeline' | 'kpi' | 'table', required
      - `probability` number, required
    - `topic` string, required
    - `entities` string[], required
    - `needs` object, required: The data it needs before drawing.
      - `queries` string[], required
      - `mode` 'ultra' | 'fast' | 'normal' | 'deep', required
      - `days` number, required
      - `min_points` number, required
      - `max_results` number, required
  - `interpretation` object, nullable, required: From a query in words. Null for your own data, a custom index or a typed question.
    - `label` string, required: What we understood you expect to see: «Finishing positions of the last Formula 1 race».
    - `confidence` number, required
    - `alternatives` object[], required: Other readings of the query: pass one as `interpretation` to chart it instead.
      - `label` string, required
      - `probability` number, required
  - `rung` 'exact' | 'partial' | 'related' | 'coverage' | 'stories', nullable, required: How close the chart is to what was asked. exact: the data itself, complete and verified; partial: a verified part (the podium); related: another view of the same question (the most mentioned names); coverage: the coverage or the timeline; stories: the top stories. Null for your own data.
  - `improving` boolean, required: Still looking for what was asked: the stored chart (embed, image) updates itself if it arrives. Poll GET /v1/charts/{id} or use stream: true.
  - `sources` object[], required
    - `url` string, required
    - `title` string, required
    - `source` string, nullable, required
    - `published_at` string, nullable, required
  - `embed_url` string, nullable, required: An iframe that adapts to its width, with tooltips. Add ?theme= to change the theme.
  - `image_url` string, nullable, required: PNG at twice the resolution, for chat, email or slides.
  - `svg_url` string, nullable, required
  - `svg` string, nullable, required: The SVG, with include_svg or store: false.
  - `created_at` string, nullable, required
  - `expires_at` string, nullable, required
  - `cached` boolean, required: The same request in the last 10 minutes: the same chart, not billed.
  - `usage` object, required
    - `cost_usd` number, required
    - `mode` 'ultra' | 'fast' | 'normal' | 'deep' | 'data', nullable, required
    - `queries` integer, required
    - `duration_ms` integer, required
  - `warnings` object[], required
    - `code` string, required
    - `message` string, required

## Other responses

- `402`: Payment required: `insufficient_credits` (no credit left), `spend_limit_reached` (the key hit its monthly limit) or `budget_too_small`.
- `default`: Error (RFC 9457). In English unless the request sends `Accept-Language: es`.

---

[API](https://skmtc.dev/typesearch/apis/typesearch-news-search-api.md) · [All operations](https://skmtc.dev/typesearch/apis/typesearch-news-search-api/llms.txt) · [OpenAPI document](https://skmtc.dev/typesearch/apis/typesearch-news-search-api/revisions/b270b9a9c6a5?raw)
