Permission scopes don't update or missing scopes in the documentation

Recently migrated from PUT “/wiki/rest/api/content/{id}” to PUT “/wiki/rest/v2/pages/{id}”. (asApp)
The app is installed in Confluence AND Jira.
After deploying the errors started to role in: 401: “Unauthorized; scope does not match”.
Manifest did include “write:confluence-content”.

Looked into the documentation and added “write:page:confluence”.
Still 401: “Unauthorized; scope does not match”.

Verified the app user is allowed to update the page by using “Inspect permissions”

Then I tried to re-install several times, trigger a new major version update etc, without resolving this API error.

It’s not the first time this happend to me: Whenever I need to update scopes, I seem to have problems to make it apply for existing installations.
This led me to create this Topic - I have some questions.

  • Shouldn’t the scopes for the old API endpoint be sufficient for the new one?
  • Previously users had to consent to permissions. Is that gone entirely? Why is there no one-time approval that needs to be done by a site administrator??
  • Is there an additional scope I need for “/wiki/rest/v2/pages/{id}”, which is not listed in the documentation?

I hope someone knows something about this and can help. My app is currently broken on multiple installations and a fail to see how I would do something wrong.

In Addition to that my development sandbox has the app installed, but it’s not listed, I can’t uninstall it and I can’t update it. I guess this will be resolved by resetting the sandbox. Still weird that such a state exists.

Have you redeployed the app after changing the scope? If not, that is likely the source of the issue. Redeploying is different than reinstalling, which is why I ask.

I think installation of the app is viewed as approval by a site administrator. If the scope changes, admins have to reapprove on update, I believe.

Yeah I redeployed several times and I also triggered a manual update.

I think installation of the app is viewed as approval by a site administrator.

That does makes sense, but I was thinking more about the case where a scope updates.
Apps get updated without a notice to site administrators. I am not aware if apps are clever enough to avoid scope changes and thus are allowed to auto update, or if site admin consent is not enforced there.

I figured out that I was trying to talk to the wrong endpoint.
The correct endpoint for update page is NOT /wiki/rest/v2/pages/, but /wiki/api/v2/pages/.

Why does /wiki/rest/v2/pages/ even exist and why is it returning 401???