Web Messaging file upload 415 vs 413 error handling

We’re trying to enable file attachments in our Genesys Cloud Web Messaging guest widget. The docs say we just need to set the fileAttachments capability in the widget config, but the actual behavior is pretty opaque when things break.

Here’s the setup:

const widget = GCWebMessaging.createWidget({
 organizationId: 'our-org-id',
 capabilities: {
 fileAttachments: true
 }
});

When a customer tries to upload a PDF that’s 2.5MB, the request fails. The browser network tab shows a 415 Unsupported Media Type. But if I try a PNG that’s 5MB, I get a 413 Payload Too Large.

I’ve checked the API reference for /api/v2/webchat/messages and there’s no clear documentation on the exact MIME type whitelist or the hard size limit per file. The fileAttachments object in the response just says enabled: true.

I tried sending a raw POST to the upload endpoint directly to test limits:

POST /api/v2/webchat/messages/upload
Content-Type: application/pdf

Same 415 error. Is there a specific list of allowed MIME types somewhere? Or do I need to handle this entirely on our frontend by rejecting files before they hit the API?

Also, is the size limit configurable in settings or is it a hard platform limit? We’re seeing different behaviors depending on the file extension, even if the underlying MIME type is the same.