Title: Error in batch optimization.
Last modified: July 27, 2023

---

# Error in batch optimization.

 *  Resolved [nosu](https://wordpress.org/support/users/nosu/)
 * (@nosu)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/error-in-batch-optimization/)
 * Thank you for the great plugin.
   I have an error and would like to discuss it 
   with you.
 * The following error occurred on the batch optimization screen
   HTTP Error 401 (
   0.509s): {“code”: “webpc_rest_token_invalid”, “message”: “Sorry, you do not have
   permission to do that.”, “data”:{“status”:401}}
 * I tried to batch optimize in this state, but got “An error occurred while connecting
   to the REST API. Please try again.” The message “An error occurred while connecting
   to the REST API.
 * WordPress 6.2.2 and Converter for Media 5.9.4 are installed.
   What should I do
   to make it work without errors?Please advise.

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/error-in-batch-optimization/#post-16928717)
 * Hi [@nosu](https://wordpress.org/support/users/nosu/),
 * Thank you for your message.
 * Can you use Dev Tools in your browser? Please follow these steps (best to do 
   it in Chrome browser):
    1. Launch DevTools
    2. Go to the Network tab
    3. Select the Fetch/XHR filter
    4. Go to the plugin settings page or refresh it
    5. Take a Dev Tools screenshot and send it to me
 * Best,
    Mateusz
 *  Thread Starter [nosu](https://wordpress.org/support/users/nosu/)
 * (@nosu)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/error-in-batch-optimization/#post-16928729)
 * Thank you for your message as well.
 * [https://www.dropbox.com/t/mOuhsYPLSCU8XEul](https://www.dropbox.com/t/mOuhsYPLSCU8XEul)
   
   Is the above correct?Please check.
 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/error-in-batch-optimization/#post-16928737)
 * Thank you [@nosu](https://wordpress.org/support/users/nosu/)!
 * You have 9 requests listed there. Could you please click on request number 3 (
   images-stats in red) and take screenshots of what will show up in the request
   details? Please do the same with row number 4 (images-stats in white).
 *  Thread Starter [nosu](https://wordpress.org/support/users/nosu/)
 * (@nosu)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/error-in-batch-optimization/#post-16928758)
 * Thank you for the prompt confirmation as well.
 * We will send you the screenshot again.
   [https://www.dropbox.com/t/AwR2kyFFXL2yk3ZM](https://www.dropbox.com/t/AwR2kyFFXL2yk3ZM)
 * Due to reloading, I am not sure which image-stats you are referring to. So we
   are sending you 6 screenshots of all the image-stats.
 * Please take a moment to check them again.
 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/error-in-batch-optimization/#post-16928759)
 * Thank you [@nosu](https://wordpress.org/support/users/nosu/),
 * REST API redirects are set on your server. This should not be the case, therefore
   the plugin cannot connect to the endpoint in the REST API. Do you know anything
   more about it?
 *  Thread Starter [nosu](https://wordpress.org/support/users/nosu/)
 * (@nosu)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/error-in-batch-optimization/#post-16928788)
 * Something inexplicable happened.
   I think that an error occurred like a screenshot
   until an hour ago, but when I checked the plug-in setting screen now, the error
   was resolved and the conversion to webp was done.Not sure why the error disappeared,
   but now it works fine.
 * Thank you very much.
 *  [bansies](https://wordpress.org/support/users/bansies/)
 * (@bansies)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/error-in-batch-optimization/#post-17018585)
 * Hello,
   I face the same error,
    1. code: “webpc_rest_token_invalid”
    2. data: {status: 401}
    3. message: “Sorry, you do not have permission to do that.”
       Please provide any 
       solution
 *  -  This reply was modified 2 years, 9 months ago by [bansies](https://wordpress.org/support/users/bansies/).

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Error in batch optimization.’ is closed to new replies.

 * ![](https://ps.w.org/webp-converter-for-media/assets/icon-256x256.png?rev=2636288)
 * [Converter for Media - Optimize images | Convert WebP & AVIF](https://wordpress.org/plugins/webp-converter-for-media/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/webp-converter-for-media/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/webp-converter-for-media/)
 * [Active Topics](https://wordpress.org/support/plugin/webp-converter-for-media/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/webp-converter-for-media/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/webp-converter-for-media/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [bansies](https://wordpress.org/support/users/bansies/)
 * Last activity: [2 years, 9 months ago](https://wordpress.org/support/topic/error-in-batch-optimization/#post-17018585)
 * Status: resolved