Title: Rest Forbidden
Last modified: March 12, 2025

---

# Rest Forbidden

 *  Resolved [simoasc](https://wordpress.org/support/users/simoasc/)
 * (@simoasc)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/rest-forbidden/)
 * Hello, I am trying to update the assistants via code using the REST API `wp-json/
   mwai/v1/openai/assistants/list?envId=...`.
 * I am using the Bearer Token that I set in the settings. However, I keep receiving
   a `401 rest_forbidden` error.
 * Can you help me? Thank you!

Viewing 1 replies (of 1 total)

 *  Plugin Support [Val Meow](https://wordpress.org/support/users/valwa/)
 * (@valwa)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/rest-forbidden/#post-18363445)
 * Hey [@simoasc](https://wordpress.org/support/users/simoasc/)! 👋
 * You’re not using the **AI Engine public API** (mwai/v1)—you’re using the **WordPress
   REST API** to query a route from the plugin settings, so your **bearer token**
   won’t work here.
 * If you’re getting a **403 response**, it means that your **server** is **rejecting
   the authentication** when trying to reach this route. This isn’t something we
   can resolve at the plugin level—it’s a **server-side issue**.
 * Make sure that:
 * ✅ Your **user has the right permissions**.
 * ✅ Your **token is valid**.
 * If you’re working with custom code, it might be easier to refresh the assistant
   by directly calling:
 *     ```wp-block-code
       MeowPro_MWAI_Assistants::rest_assistants_list();
       ```
   
 * Or you can use a **wp_remote_call** directly from your server.
 * Hope this helps! 😊

Viewing 1 replies (of 1 total)

The topic ‘Rest Forbidden’ is closed to new replies.

 * ![](https://ps.w.org/ai-engine/assets/icon-256x256.png?rev=3431928)
 * [AI Engine - The Chatbot, AI Framework & MCP for WordPress](https://wordpress.org/plugins/ai-engine/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ai-engine/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ai-engine/)
 * [Active Topics](https://wordpress.org/support/plugin/ai-engine/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ai-engine/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ai-engine/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Val Meow](https://wordpress.org/support/users/valwa/)
 * Last activity: [1 year, 2 months ago](https://wordpress.org/support/topic/rest-forbidden/#post-18363445)
 * Status: resolved