Request an avatar upload
const url = 'https://app.mondochat.io/v1/me/avatar';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"bytes":120345,"content_type":"image/jpeg"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.mondochat.io/v1/me/avatar \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "bytes": 120345, "content_type": "image/jpeg" }'Returns a presigned POST for the user’s own picture. Takes a session token. Answers 403 policy_denied with reason avatar_upload unless chat.avatar_upload is on. The file may be up to chat.photo_max_bytes. See https://docs.mondochat.io/guides/media/.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Asks for a presigned upload of the user’s own picture.
object
The size of the file, at most chat.photo_max_bytes.
The image type you will upload.
Responses
Section titled “Responses”Successful Response
A presigned POST: send the file to url with fields as form fields.
object
When the upload link stops working, 5 minutes on.
Form fields to send with the file in the multipart POST.
object
The id of the pending media. Pass it to the complete route.
Where to POST the file.
Example
{ "expires_at": "2026-11-01T12:05:00Z", "fields": { "Content-Type": "image/jpeg", "key": "orig/p/0199d6a0-4000-7000-8000-000000000001/orig" }, "photo_id": "0199d6a0-4000-7000-8000-000000000001", "url": "https://uploads.example.test/"}Problem
An RFC 9457 problem: the body of every error answer.
object
The stable error code to branch on, such as policy_denied.
What went wrong this time, when there is more to say.
For validation, one entry per invalid field.
One invalid field.
object
The path to the field.
What is wrong with it.
The path of the request.
For policy_denied and limit_reached, the rule or limit that refused the request; for forbidden, a short cause such as you_blocked; for banned, temporary when the ban expires.
The HTTP status code.
A short summary of the problem.
A URL that names the problem, https://app.mondochat.io/problems/<code>.
Example
{ "code": "policy_denied", "detail": null, "instance": "/v1/conversations/0199d6a0-2000-7000-8000-000000000001", "reason": "pins", "status": 403, "title": "Policy denied", "type": "https://app.mondochat.io/problems/policy_denied"}