Request an upload
const url = 'https://app.mondochat.io/v1/photos/uploads';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"bytes":482113,"content_type":"image/jpeg","conversation_id":"0199d6a0-2000-7000-8000-000000000001"}'};
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/photos/uploads \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "bytes": 482113, "content_type": "image/jpeg", "conversation_id": "0199d6a0-2000-7000-8000-000000000001" }'Creates a pending photo, video or voice note and returns a presigned POST that lives 5 minutes. Send the file to it, then call the complete route. Takes a session token. Policy photos, chat.photos, the daily limits, bans and safety apply, as does the receiver’s refusal of photos. video/mp4 answers 403 policy_denied with reason videos unless chat.videos is on, and audio/mp4 with reason voice unless chat.voice is on. A file above the size limit of its kind answers 422. See https://docs.mondochat.io/guides/media/.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Asks for a presigned upload of a photo, video or voice note into a conversation.
object
The size of the file. Above chat.photo_max_bytes, chat.video_max_bytes or chat.voice_max_bytes for its kind the request answers 422.
The media type you will upload. video/mp4 needs chat.videos and audio/mp4 needs chat.voice.
The conversation the media is for.
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"}