Pixela API Document

API Document for Pixela ( https://pixe.la/ ) .

PUT - /v1/users/<username>/graphs/<graphID>


Update predefined pixelation graph definitions.
The items that can be updated are limited as compared with the pixelation graph definition creation.

HTTP Method , API endpoint

PUT /v1/users/<username>/graphs/<graphID>

Request Header

Key Description
X-USER-TOKEN [required] It is the authentication token specified at the time of user registration.

Request Body

Key Type Description
name string [optional] It is the name of the pixelation graph.
unit string [optional] It is a unit of the quantity recorded in the pixelation graph. Ex. commit, kilogram, calory.
color string [optional] Defines the display color of the pixel in the pixelation graph.
shibafu (green), momiji (red), sora (blue), ichou (yellow), ajisai (purple) and kuro (black) are supported as color kind.
timezone string [optional] Specify the timezone for handling this graph as Asia/Tokyo. If not specified, it is treated as UTC.
purgeCacheURLs array[string] [optional] This is an advanced option.
Specify the URL to send the purge request to purge the cache when the graph is updated.
For example, in GitHub, since all images referenced from GitHub are cached, it is necessary to purge the cache every time the Pixeleation graph is changed.
Even with the same Pixelation graph, different cache URLs are generated when referring from multiple places, you can specify up to 5 URLs.
selfSufficient string [optional] If SVG graph with this field increment or decrement is referenced, Pixel of this graph itself will be incremented or decremented.
It is suitable when you want to record the PVs on a web page or site simultaneously.
The specification of increment or decrement is the same as Increment a Pixel and Decrement a Pixel with webhook.
If not specified, it is treated as none .
isSecret bool [optional] Graphs with this property's value true are not displayed on the graph list page and can be kept secret.
However, this feature is a limited to supporters. For details, please check How to support Pixela by Patreon / Use Limited Features.


$ curl -X PUT https://pixe.la/v1/users/a-know/graphs/test-graph -H 'X-USER-TOKEN:thisissecret' -d '{"name":"graph-name","unit":"commit","color":"shibafu","timezone":"Asia/Tokyo","purgeCacheURLs":["https://camo.githubusercontent.com/xxx/xxxx"]}'