The docs state: “File attachments are supported via the media API. Maximum size is 10MB per file. Supported MIME types include image/jpeg, image/png, application/pdf.”
We are integrating file uploads into our custom web client. Sending a 2MB PDF via POST /api/v2/webmessaging/guests/{guestId}/attachments. The request fails with 413 Payload Too Large. This happens even when the file is clearly under the 10MB limit.
Here is the cURL equivalent we are using for testing:
curl -X POST "https://{org}.mypurecloud.com/api/v2/webmessaging/guests/{guestId}/attachments" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: multipart/form-data" \
-F "file=@test.pdf;type=application/pdf"
The response body is empty. No error details. Just 413. We’ve checked the Nginx config on our proxy side, limits are set to 50MB. So it’s not our infrastructure. Is there a hidden header required for the media upload endpoint? Or is the token scope insufficient? We are using webmessaging:guest:write.
Also, trying to upload a 500KB JPEG works fine. It’s only larger files that trigger the 413. Feels like a bug in the gateway layer.