Hey folks,
We’re building a custom UI for a client who needs to handle file attachments directly through the Guest API. We’re using the standard /api/v2/conversations/messaging/external/attachments endpoint to upload files, but we’re hitting some weird walls with MIME types.
The docs say we need to pass the Content-Type header correctly, but it feels like Genesys is doing its own validation on the backend. If we send a text/plain file that’s actually a disguised .exe, does the API reject it, or does it just store the blob? We’re trying to prevent malicious uploads without writing a whole separate validation layer on our proxy server.
Here’s what our upload flow looks like:
const formData = new FormData();
formData.append('file', fileInput.files[0]);
await axios.post(
`https://${region}.mygenesys.com/api/v2/conversations/messaging/external/attachments`,
formData,
{
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'multipart/form-data',
'Accept': 'application/json'
}
}
);
We’re seeing 400 Bad Request errors when we try to upload PDFs that are slightly larger than 5MB. The error payload is pretty sparse:
{
"errors": [
{
"code": "invalid_request",
"message": "File size exceeds maximum allowed limit"
}
]
}
Is there a hard cap on file size for the Guest API, or is this configurable in the Engagement settings? We’ve checked the general engagement config, but I don’t see a specific field for attachment size limits.
Also, are there any known issues with the SDK handling the multipart form data correctly? We’ve tried using the genesys-cloud-messaging-sdk but it seems to abstract away the low-level upload details, making it hard to debug these MIME type mismatches.
Any pointers on how to properly validate file types before sending them to the API would be great. We don’t want to waste bandwidth on rejected uploads.