Skip to main content

Update a chart

The name and categories of a chart can be updated by posting to /charts/{chart key}.

POST https://api-{region}.seatsio.net/charts/{chartKey}
Note

Seats.io creates a draft chart version when you update a chart. If a draft version already exists, that draft gets updated.

This does not apply to charts without events. For those charts we don't create a draft version.

Update the chart name

To update the name of a chart, send the new name in the request body. If you don't send a name, it will not change.

{
"name": "New name for my chart"
}

Update chart categories

Note

When using the Update a Chart endpoint, you are effectively replacing all of the categories on the chart. To simply add or remove a category, you should use the Manage Categories endpoint.

To update categories, you must send an updated array of categories, for example:

[
{ "key": 1, "label": "Category 1", "color": "#aaaaaa"},
{ "key": 2, "label": "Category 2", "color": "#bbbbbb", "accessible": true}
]

The fields are:

  • key: a number or a string that uniquely identifies the category in the chart. Note that when passing in a number, it cannot exceed the value of Number.MAX_SAFE_INTEGER (i.e. 2^32 = 9007199254740991)
  • label: the category label, a string
  • color: a valid html color

Updating categories works as follows:

  • A category with a key that did not yet exist is added as a new category
  • A category with an existing key is updated. The label and color you provide overwrite the old label and color.
  • All other categories, which are not included in the array, are deleted. Sending an empty array of categories removes all categories.

Suppose that this is the list of existing categories:

{
"categories": [
{ "key": 1, "label": "Category 1", "color": "#aaaaaa"},
{ "key": 2, "label": "Category 2", "color": "#bbbbbb"}
]
}

and you send this update chart request:

{
"categories": [
{ "key": 2, "label": "My category 2"}
]
}

then category 1 will be deleted, the label for category 2 will be set to "My category 2", and the color of category 2 is left unchanged.

{
"categories": [
{ "key": 2, "label": "My category 2", "color": "#bbbbbb"}
]
}
curl https://api-{region}.seatsio.net/charts/4250fffc-e41f-c7cb-986a-2c5e728b8c28 \
-u aSecretKey: -X POST -H 'Content-Type: application/json' -d '{"name": "New name for my chart"}'

Response

204 - No Content