Title: Exception: Invalid API endpoint. .. lib/API/JSON/API.php:190
Last modified: January 27, 2025

---

# Exception: Invalid API endpoint. .. lib/API/JSON/API.php:190

 *  [Ov3rfly](https://wordpress.org/support/users/ov3rfly/)
 * (@ov3rfly)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/exception-invalid-api-endpoint-lib-api-json-api-php190/)
 * Getting these errors in `debug.log`
 *     ```wp-block-code
       [27-Jan-2025 03:04:48 UTC] Exception: Invalid API endpoint. in .../wp-content/plugins/mailpoet/lib/API/JSON/API.php:190Stack trace:#0 .../wp-content/plugins/mailpoet/lib/Subscription/Form.php(33): MailPoet\API\JSON\API->processRoute()#1 .../wp-includes/class-wp-hook.php(324): MailPoet\Subscription\Form->onSubmit(Array)#2 .../wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)#3 .../wp-includes/plugin.php(517): WP_Hook->do_action(Array)#4 .../wp-admin/admin-post.php(61): do_action('admin_post_nopr...')#5 {main}
       ```
   
 * The error occurs if something, not sure what/how, calls e.g. these URLs:
 *     ```wp-block-code
       /wp-admin/admin-post.php?action=mailpoet_subscription_form&mailpoet_error=1/wp-admin/admin-post.php?action=mailpoet_subscription_form&mailpoet_error=2
       ```
   
 * The plugin was uninstalled/re-installed via WP admin and also FTP, the issue 
   is still there.
 * The same error message has [already also been posted here in forum](https://wordpress.org/support/topic/php-error-possibly-due-to-invalid-api-endpoint/)
   but my reply there that we are affected as well was deleted by some mod so here
   is a new thread now.
 * MailPoet 5.6.2

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

 *  Plugin Support [Lynn J.a11n](https://wordpress.org/support/users/lynnjat7/)
 * (@lynnjat7)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/exception-invalid-api-endpoint-lib-api-json-api-php190/#post-18272796)
 * Hi there [@ov3rfly](https://wordpress.org/support/users/ov3rfly/),
 * Thanks for opening a fresh thread for this – in practice it is always a good 
   idea to open a new thread for your own issues, so we can better track them and
   respond.
 * Do you have any more information about what is happening on the site that is 
   triggering this error? It looks like it might happen when you attempt to edit
   and then re-save a form. It might also be happening when a customer fills out
   a subscribe form, especially if that form is not generated using MailPoet but
   rather comes from a third party forms plugin. Can you give both of these scenarios
   a try to see if it triggers the error?
 * Also, can you check the MailPoet logs under MailPoet > Settings on the “Advanced”
   tab to see if this same error is listed, but with additional information? Scroll
   to the bottom of the tab and click “View Logs” to see the logs.
 * Lastly, can you share with us your site’s System Info? It’s under MailPoet > 
   Help on the “system info” tab, please do redact any sensitive information as 
   needed.
 * Thank you!
 *  Thread Starter [Ov3rfly](https://wordpress.org/support/users/ov3rfly/)
 * (@ov3rfly)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/exception-invalid-api-endpoint-lib-api-json-api-php190/#post-18272861)
 * It e.g. happens here, if some bot or similar obviously scrapes links in website
   front end html code and calls the plain `action` URL from MailPoet `form` tag
   without other parameters:
 *     ```wp-block-code
       https://www.example.com/wp-admin/admin-post.php?action=mailpoet_subscription_form
       ```
   
 * MailPoet logs is set to record “errors” but does not record anything when the
   mentioned issue occurs.
 * The issue is not related to backend editing or re-saving forms, we recorded IP
   adresses and they are random worldwide but not logged in user. No third party
   forms plugin is used.
 *  Plugin Support [Lynn J.a11n](https://wordpress.org/support/users/lynnjat7/)
 * (@lynnjat7)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/exception-invalid-api-endpoint-lib-api-json-api-php190/#post-18275143)
 * Hi there [@ov3rfly](https://wordpress.org/support/users/ov3rfly/),
 * Thanks for the clarification. Just to confirm, there’s nothing actually wrong
   with the MailPoet functionality – subscribers can sign up and you can send email,
   correct?
 * If the issue is that bots are pinging your site and attempting to submit the 
   form, we do recommend activating reCaptcha on your forms. You can use the MailPoet
   built-in feature or set up Google reCaptcha. More here:
   [https://kb.mailpoet.com/article/182-add-captcha-to-your-websites-forms](https://kb.mailpoet.com/article/182-add-captcha-to-your-websites-forms)
 *  Thread Starter [Ov3rfly](https://wordpress.org/support/users/ov3rfly/)
 * (@ov3rfly)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/exception-invalid-api-endpoint-lib-api-json-api-php190/#post-18275197)
 * Bots are not attempting to submit the form. As already explained no form data
   is sent. Calling the plain `action` URL from MailPoet `form` tag without other
   parameters causes the error. No MailPoet built-in feature or Google reCaptcha
   will help here. Endpoints should catch all kind of errors and not fail with an
   exception.
 *  Plugin Support [Lynn J.a11n](https://wordpress.org/support/users/lynnjat7/)
 * (@lynnjat7)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/exception-invalid-api-endpoint-lib-api-json-api-php190/#post-18277361)
 * Hi there [@ov3rfly](https://wordpress.org/support/users/ov3rfly/),
 * Thanks for reaching back out, I do understand the issue is that the form submission
   URL is being pinged and then throws an error due to missing information.
 * I have brought this to the attention of our development team and they will evaluate
   it for priority. As this issue does not affect the actual operation of MailPoet,
   I expect it to be a lower priority, so there will be no firm ETA for a fix. Please
   watch future release notes for any updates.

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

The topic ‘Exception: Invalid API endpoint. .. lib/API/JSON/API.php:190’ is closed
to new replies.

 * ![](https://ps.w.org/mailpoet/assets/icon-256x256.png?rev=3284564)
 * [MailPoet - Newsletters, Email Marketing, and Automation](https://wordpress.org/plugins/mailpoet/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mailpoet/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mailpoet/)
 * [Active Topics](https://wordpress.org/support/plugin/mailpoet/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mailpoet/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mailpoet/reviews/)

## Tags

 * [ajax](https://wordpress.org/support/topic-tag/ajax/)
 * [exception](https://wordpress.org/support/topic-tag/exception/)
 * [invalid](https://wordpress.org/support/topic-tag/invalid/)

 * 5 replies
 * 2 participants
 * Last reply from: [Lynn J.a11n](https://wordpress.org/support/users/lynnjat7/)
 * Last activity: [1 year, 4 months ago](https://wordpress.org/support/topic/exception-invalid-api-endpoint-lib-api-json-api-php190/#post-18277361)
 * Status: not resolved