Upload avatar
Uploads the agent's avatar and points the theme at it.
- Authentication
- Bearer token
- Retries
- Idempotency-Key
- Body
- multipart/form-data
- Version
- 2026-09-03
widget_theme.avatar_url has been settable since themes existed, with nothing behind it - a tenant could name an image they hosted themselves and had no way to supply one otherwise. Object storage removed that blocker on 2026-08-29; this is the endpoint that was left.
The size cap is enforced while reading, as it is on document upload and for the same reason: await file.read() on an unbounded body buffers the whole thing before any check runs, so one large request can exhaust the container before the limit is consulted.
The file's type is read from its bytes, never from the Content-Type the uploader claims - see app.platform.images. The stored object is served to every visitor of the tenant's website, and an attacker-chosen type there is how an avatar becomes text/html on our own origin.
Path parameters#
Headers#
Request body#
Responses#
Errors#
Failures use one envelope on every endpoint, described in Retries, versioning and limits. The codes you are most likely to meet here:
validation_error· 422 — The payload was well-formed JSON but failed schema validation.unauthenticated· 401 — The request carried no API key, or one the API could not verify.forbidden· 403 — The key is valid, but it is not allowed to do this — either the scope is missing or the resource belongs to another workspace.idempotency_key_reused· 422 — This `Idempotency-Key` was used before, for a request with a different body.rate_limited· 429 — Too many requests in the current window. The limit is per workspace, and some endpoints add a per-agent limit on top.
More Agents endpoints#
Something unclear or missing? Tell us and we’ll fix it.