Title: REST API 403 error
Last modified: December 5, 2022

---

# REST API 403 error

 *  Resolved [bohdanwlcm](https://wordpress.org/support/users/bohdanwlcm/)
 * (@bohdanwlcm)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/rest-api-403-error/)
 * I need to use PaidMembershipsPro API to programmatically change a membership 
   of a user.
 * For my Admin user I created Application Password, then I created base64 from 
   auth data:
    `const token = Buffer.from(${process.env.WP_USERNAME}:${process.env.
   WP_APP_PASSWORD}).toString( 'base64');`
 * Set Basic Authorization:
    `axios.defaults.headers.common['Authorization'] = Basic
   ${token};`
 * But any `/pmpro/v1` route, I’m trying to trigger always returns me the error:
 *     ```
       data: {
          status: 'error',
          error: 'Restricted',
          error_description: 'Sorry, you are not allowed to access REST API.'
       }
       ```
   
 * My user has all pmpro capabilities.
    -  This topic was modified 3 years, 6 months ago by [bohdanwlcm](https://wordpress.org/support/users/bohdanwlcm/).

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

 *  Plugin Support [Kim White](https://wordpress.org/support/users/kimwhite/)
 * (@kimwhite)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/rest-api-403-error/#post-16275016)
 * Hello [@bohdanwlcm](https://wordpress.org/support/users/bohdanwlcm/),
 * I’m sorry you are having problems with this. The 403 error is a permission error
   indicating that the incorrect password or username has been entered and that 
   this could be related to something in your code.
 * You will need to revise your code and confirm your login details are correct.
 * Kim W
 *  Thread Starter [bohdanwlcm](https://wordpress.org/support/users/bohdanwlcm/)
 * (@bohdanwlcm)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/rest-api-403-error/#post-16295753)
 * Which username and password should I use?
 * Currently I use admin’s username and password and I’m sure that this is the correct
   data
 *  Plugin Author [Andrew Lima](https://wordpress.org/support/users/andrewza/)
 * (@andrewza)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/rest-api-403-error/#post-16296827)
 * This sounds like you are correctly using the API and something is incorrect with
   your capabilities of some sort or blocking your REST API access – I cannot say
   for certain without looking into this further and difficult to assume the cause.
 * Are you able to access default WordPress REST API routes?
 *  Thread Starter [bohdanwlcm](https://wordpress.org/support/users/bohdanwlcm/)
 * (@bohdanwlcm)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/rest-api-403-error/#post-16305260)
 * Yes, I’m able to access any other WordPress REST API route, except this one
 *  Plugin Author [Andrew Lima](https://wordpress.org/support/users/andrewza/)
 * (@andrewza)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/rest-api-403-error/#post-16305643)
 * I’ve run some further tests and you should receive a 401 error if your permissions
   are wrong. 403 indicates a different issue that may be more server related.
 * I am unable to replicate this issue on my development site. If you have a local
   environment please can you run tests with Postman and basic authentication to
   see if the issue persists for you?
 * Here is a screenshot for reference on my own test using PostMan, basic authentication
   and a PMPro REST route. (You may open this in a new tab to zoom in).
 * ![](https://i0.wp.com/i.postimg.cc/zvvgB8Kr/Screenshot-2022-12-20-at-11-42-04.
   png?ssl=1)

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

The topic ‘REST API 403 error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/paid-memberships-pro_f1dacb.svg)
 * [Paid Memberships Pro - Content Restriction, User Registration, & Paid Subscriptions](https://wordpress.org/plugins/paid-memberships-pro/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/paid-memberships-pro/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/paid-memberships-pro/)
 * [Active Topics](https://wordpress.org/support/plugin/paid-memberships-pro/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/paid-memberships-pro/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/paid-memberships-pro/reviews/)

## Tags

 * [api](https://wordpress.org/support/topic-tag/api/)
 * [rest](https://wordpress.org/support/topic-tag/rest/)

 * 5 replies
 * 3 participants
 * Last reply from: [Andrew Lima](https://wordpress.org/support/users/andrewza/)
 * Last activity: [3 years, 5 months ago](https://wordpress.org/support/topic/rest-api-403-error/#post-16305643)
 * Status: resolved