I am getting the error: Failed to Create File Error: Failed to authorize request: Request failed with status code 500. What is it and how to fix it?

The failed file most likely crossed Onboarding's Large Files API threshold, while the successful file used the direct Apex upload route. The HTTP 500 occurred while the Large Files Service was obtaining authorization for the org; it does not mean example.png is corrupt.

Why one file can work and another fail

Record Files uses two upload routes:

A browser console line like this confirms that the failed file used the second route:

Upload file via Large Files API [example.png]

Filename, MIME type and file contents do not affect authorization. A configured maxFileSizeMb violation would instead be rejected with a file-size validation message.

What to do

  1. Compare the two file sizes. If the failed file is above approximately 2.25 MB and the successful file is below it, that explains why only one used the Large Files route.

  2. Start a fresh Onboarding or portal session and retry. Session keys are time-limited, so a long-open page may hold an expired key.

  3. Confirm the org is onboarded. If the error persists, re-authorize the org: open https://auth.3b4sf.com/, enter the same Org ID with the current My Domain, Client ID and Client Secret, then authorize as the integration user. See Authorization Server.

  4. If it still fails, contact 3B support with the time of the failure and the org ID.

  5. Temporary workaround: resize or compress the file so its base64 payload stays below 3,000,000 bytes. This keeps it on the direct Apex route.