Skip to content
Connect an agent
Organisations

Upload or replace a custom icon

Saves one SVG or PNG icon (at most 32 KB) under a name diagrams use as icon=org: on the hosted service, with up to ten aliases.

PUT/orgs/{org}/icons/{name}

TL;DR

QuestionAnswer
What does it do?Upload or replace a custom icon.
What does it take?A JSON body of type IconBody.
What does it return?Status 200 with a body of type SavedIcon.
What can go wrong?400 the body is not valid; 401 not signed in; 403 the caller's role may not (orgs.forbidden), the owner's plan does not include custom icons (plan.icons_not_included), the organisation holds the most icons it may (orgs.icon_limit_reached), or the request came from an origin that may not make changes; 404 no such organisation, or the caller is not a member of it; 413 the body is too large; 422 the file, the name or an alias does not check (icon.invalid, with every issue in details); 429 too many requests; 503 organisations are not set up on this server. Every failure uses the one error envelope.

What it does

Saves one SVG or PNG icon (at most 32 KB) under a name diagrams use as icon=org: on the hosted service, with up to ten aliases. An SVG is rewritten from an allowlist; anything that could run or load is refused. The owner and admins may, on a plan with custom icons. 422 icon.invalid carries every issue.

Path parameters

FieldTypeRequiredDescription
orgstringyesThe organisation's id or its slug.
namestringyesThe name after org:, lowercase words joined by hyphens.

Request body

The body has the type IconBody.

FieldTypeRequiredDescription
svgstringnoThe SVG file's text, at most 32 KB. It is rewritten from an allowlist before it is stored. at most 49152 characters.
pngstringnoThe PNG file's bytes in base64, at most 32 KB and 1024 pixels on a side. at most 49152 characters.
aliasesstring[]noOther names search and automatic matching find the icon by, at most 10. Left out, the icon has none.

Responses

StatusMeaningBody
200The saved icon, and what the check left out of the file.SavedIcon
400The body is not valid.ErrorResponse
401Not signed in.ErrorResponse
403The caller's role may not (orgs.forbidden), the owner's plan does not include custom icons (plan.icons_not_included), the organisation holds the most icons it may (orgs.icon_limit_reached), or the request came from an origin that may not make changes.ErrorResponse
404No such organisation, or the caller is not a member of it.ErrorResponse
413The body is too large.ErrorResponse
422The file, the name or an alias does not check (icon.invalid, with every issue in details).ErrorResponse
429Too many requests.ErrorResponse
503Organisations are not set up on this server.ErrorResponse

Response body

A 200 answer has the type SavedIcon.

FieldTypeRequiredDescription
iconOrgIconyes
icon.namestringyes
icon.refstringyesWhat a diagram writes to use it.
icon.aliasesstring[]yes
icon.mediaType"image/svg+xml" | "image/png"yes
icon.imagestringyesThe checked picture as a data: address, for a preview.
icon.widthnumberyes
icon.heightnumberyes
icon.bytesintegeryes
icon.updatedAtintegeryesMilliseconds since the epoch.
removedstring[]yesWhat the check left out of the file because it draws nothing, such as editor metadata.

See also

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