Skip to content

A REST PATCH call that successfully uploads a file (e.g. to the media library) returns an empty response body on success — is there a way to override this so it returns a custom JSON message confirming the upload succeeded?

Answer

This is standard, expected REST behavior, not something to override — a successful REST call is denoted by its HTTP status code (200 OK) rather than requiring a confirmation message in the response body. An empty body on a successful PATCH/upload is normal; checking for the 200 status code is the correct way for your integration to confirm success, rather than expecting or trying to add a custom 'everything went ok' JSON payload.

← Browse Integrations and APIs questions