It’s hard to provide an answer to your problem without more information about what you’re doing. How are you accessing the REST API? From within a script on your local machine, or some external tool, or a Connect or Forge app?
How are you attaching the API token to the requests you are sending? Could you share a code snippet of what you’re doing? HTTP 401 most likely means that the API token isn’t being correctly received by the Atlassian APIs.