1

I have completed the Xero OAuth flow with the following scopes:

openid profile email accounting.transactions offline_access

When I attempt to DELETE a connection using the URI https://api.xero.com/connections/{xeroTenantId} I get the error AuthenticationUnsuccessful.

My access token is valid and I am able to perform a GET on the same endpoint with the same token. There is nothing in the documentation that I can find which explains what scope is required to delete a connection: https://developer.xero.com/documentation/guides/oauth2/scopes

Nick
  • 685
  • 12
  • 27
  • 1
    I've noticed the same issue, [revoking a token](https://developer.xero.com/documentation/guides/oauth2/pkce-flow#revoking-tokens) seems to work but am unable to delete the whole connection. – j-petty Apr 26 '22 at 02:10
  • I also added the xero-tenant-id header as per: https://developer.xero.com/documentation/guides/oauth2/auth-flow#6-call-the-api, but the issue persists – Nick Apr 27 '22 at 13:54

1 Answers1

1

To delete a connection you need to put the connectionId to the URI and not the tenantId.

DELETE https://api.xero.com/connections/{connectionId}
Authorization: "Bearer " + access_token

Please see this link

https://developer.xero.com/documentation/guides/oauth2/auth-flow/#removing-connections

devadnqpnd
  • 154
  • 1
  • 3
  • 16
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 30 '22 at 07:13
  • Not sure how I've missed that! Thanks! – Nick Nov 09 '22 at 15:45