This method is used to replace previously uploaded files and returns the new URL for use in CME. The file schema field type for content requires a URL, so you must use this endpoint before saving/updating file content.
NOTE: Only use this endpoint if you want to replace a file. If you're just uploading a file, use Upload a File.
NOTE: This method uses the S3 settings in the org to delete previous files. If those S3 settings ever change, then all files previously uploaded will become zombie files. This method will simply ignore any URLs you pass it that you do not have access to delete (due to changed S3 settings) or are simply invalid.
NOTE: This request must be a multipart/form-data for the file to be uploaded. Please search for how to complete a multipart/form-data request in your framework/programming language.
In order to provide CME with the JWT, you must provide a header named Authorization and the token must be prefixed with the word Bearer.
Required parameters are underlined.
Include the two fields above: file and previousFile.
A successful response will have a 200 status code and a body containing the URL of the new file.
An error response will return a 400 (or 500 for internal server error) and a message: