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}/avatarTL;DR
| Question | Answer |
|---|---|
| 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
| Field | Type | Required | Description |
|---|---|---|---|
org | string | yes | The organisation's id or its slug. |
Request body
The body has the type AvatarBody.
| Field | Type | Required | Description |
|---|---|---|---|
svg | string | no | The 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. |
image | string | no | A 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
| Status | Meaning | Body |
|---|---|---|
| 200 | The avatar as the organisation JSON now carries it, and what the check left out of the file. | SavedAvatar |
| 400 | The body is not valid. | ErrorResponse |
| 401 | Not signed in. | ErrorResponse |
| 403 | The caller's role may not (orgs.forbidden), or the request came from an origin that may not make changes. | ErrorResponse |
| 404 | No such organisation, or the caller is not a member of it. | ErrorResponse |
| 413 | The body is too large. | ErrorResponse |
| 422 | The file does not check (avatar.invalid, with every issue in details). | ErrorResponse |
| 429 | Too many requests. | ErrorResponse |
| 503 | Organisations are not set up on this server. | ErrorResponse |
Response body
A 200 answer has the type SavedAvatar.
| Field | Type | Required | Description |
|---|---|---|---|
avatar | OrgAvatar | yes | The organisation's uploaded avatar, or null when it has none and a mark made from its id stands in. |
avatar.version | string | yes | Changes 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.animated | boolean | yes | True when it moves, so a page can hold it still for a person who asked for less motion. |
removed | string[] | yes | What the check left out of the file because it draws nothing, such as editor metadata, EXIF or XMP. |
See also
| Doc | Why |
|---|---|
| API reference | Every endpoint, and the error envelope |
| Schemas | Every request and response type |
| Tool reference | The operations as callable tools |