Getting 401 unauthenticated error in WP Rest API revisions

The solution was to generate and use an API token.

  1. in WP admin, go to user and generate the key
  2. take that key and glue it with the username it is generated with in this format: username:key
  3. base64 encode that string
  4. put that base64 value into the header: 'Authorization': 'Basic <base64 token here>'

In my case, the key was deleted.