Stuck on the file upload flow for our Web Messaging integration. We’re using the Guest API to handle initial customer attachments before the agent handoff, but I keep hitting a 413 Payload Too Large error. This is weird because the docs say the limit is 2MB and I’m testing with a 1.2MB PDF.
Here’s the snippet I’m using in the Node.js handler:
const formData = new FormData();
formData.append('file', fileBuffer, 'doc.pdf');
const response = await axios.post(
'https://api.mypurecloud.com/api/v2/conversations/messages/files',
formData,
{
headers: {
'Content-Type': 'multipart/form-data',
'Authorization': `Bearer ${token}`
}
}
);
The error response is just:
{
"code": "payloadTooLarge",
"message": "Request Entity Too Large",
"status": "413"
}
I’ve checked the Content-Type header and it’s set correctly. Is there a hidden limit for the Guest API specifically? Or maybe I need to set a specific MIME type in the request body? i’m running this on node v18.17.
I can’t figure out why it’s rejecting files that are clearly under the stated limit. The standard conversation upload API works fine with the same file, so it’s definitely something specific to this endpoint.
Any ideas on what I’m missing?