Skip to content
Connect an agent
Organisations

Upload or replace an organisation's avatar

Saves one SVG, PNG, APNG, GIF or WebP avatar, still or animated (at most 256 KB, 512 pixels, 200 frames).

PUT/orgs/{org}/avatar

TL;DR

QuestionAnswer
What does it do?Upload or replace an organisation's avatar.
What does it take?A JSON body of type AvatarBody.
What does it return?Status 200 with a body of type SavedAvatar.
What can go wrong?400 the body is not valid; 401 not signed in; 403 the caller's role may not (orgs.forbidden), 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 does not check (avatar.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, PNG, APNG, GIF or WebP avatar, still or animated (at most 256 KB, 512 pixels, 200 frames). An SVG is rewritten from an allowlist that keeps safe SMIL animation; a raster file keeps only the parts that draw. Every plan; the owner and admins. 422 avatar.invalid carries every issue.

Path parameters

FieldTypeRequiredDescription
orgstringyesThe organisation's id or its slug.

Request body

The body has the type AvatarBody.

FieldTypeRequiredDescription
svgstringnoThe SVG file's text, at most 256 KB, still or animated with SMIL. It is rewritten from an allowlist before it is stored. at most 368640 characters.
imagestringnoA PNG (APNG included), GIF or WebP file's bytes in base64, still or animated: at most 256 KB, 512 pixels on a side, and 200 frames. The format is read from the bytes. at most 368640 characters.

Responses

StatusMeaningBody
200The avatar as the organisation JSON now carries it, and what the check left out of the file.SavedAvatar
400The body is not valid.ErrorResponse
401Not signed in.ErrorResponse
403The caller's role may not (orgs.forbidden), 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 does not check (avatar.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 SavedAvatar.

FieldTypeRequiredDescription
avatarOrgAvataryesThe organisation's uploaded avatar, or null when it has none and a mark made from its id stands in.
avatar.versionstringyesChanges with every upload. Put it in the address (?v=) so a new picture is a new address.
avatar.contentType"image/svg+xml" | "image/png" | "image/gif" | "image/webp"yes
avatar.animatedbooleanyesTrue when it moves, so a page can hold it still for a person who asked for less motion.
removedstring[]yesWhat the check left out of the file because it draws nothing, such as editor metadata, EXIF or XMP.

See also

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