Skip to content
Connect an agent

Hosting

Read one picture of the library as a PNG

The picture {id}.svg answers, painted as a PNG width pixels wide (1600 when left out) on the paper of its scheme, for places that take no SVG.

GET/v1/library/{id}.png

TL;DR

QuestionAnswer
What does it do?Read one picture of the library as a PNG.
What does it take?id in the path, and width, scheme in the query string.
What does it return?Status 200 with no body.
What can go wrong?304 the picture has not changed; 400 the width or the scheme is not valid; 401 no key, or the key or token is not valid; 403 the token's grant does not hold library:read (oauth.insufficient_scope); 404 no such diagram the caller can see; 422 the picture is too big to paint (raster.too_large); 429 too many requests, or the daily limit is used up; 503 painting pictures is not available on this server (raster.unavailable). Every failure uses the one error envelope.

What it does

The picture {id}.svg answers, painted as a PNG width pixels wide (1600 when left out) on the paper of its scheme, for places that take no SVG. Painted for each call and never kept, with a strong ETag; If-None-Match answers 304. An app's token needs library:read.

Path parameters

FieldTypeRequiredDescription
idstringyes

Query parameters

FieldTypeRequiredDescription
widthintegernoThe width in pixels, 64 to 4000. 1600 when left out. Lowered to keep the picture under 25 megapixels.
scheme"light" | "dark"noFor a picture that follows the reader's color scheme, the one to paint. A light or dark picture is painted as it was drawn. light when left out.

Responses

StatusMeaningBody
200The PNG.none
304The picture has not changed.none
400The width or the scheme is not valid.ErrorResponse
401No key, or the key or token is not valid.ErrorResponse
403The token's grant does not hold library:read (oauth.insufficient_scope).ErrorResponse
404No such diagram the caller can see.ErrorResponse
422The picture is too big to paint (raster.too_large).ErrorResponse
429Too many requests, or the daily limit is used up.ErrorResponse
503Painting pictures is not available on this server (raster.unavailable).ErrorResponse

See also

DocWhy
API referenceEvery endpoint, and the error envelope
SchemasEvery request and response type
Tool referenceThe operations as callable tools