OAuth 2.0 Authorization

PRO adds OAuth 2.0 so you can authorize with APIs that require tokens. You can use Authorization Code for user based access or Client Credentials for server to server access.

Before you start

  • Create an application in the provider dashboard
  • Obtain Client ID and Client Secret
  • Copy the Authorization URL and Token URL
  • Confirm required scopes

Connect an OAuth 2.0 account

  1. Open your API tab then go to Authentication → OAuth 2.0
  2. Select a grant type:
    • Authorization Code: click Connect and complete consent. API Press stores the access token and the refresh token if provided
    • Client Credentials: click Get Token to request a server to server token

Use the token in requests

  • API Press can inject the header automatically for the selected OAuth connection
  • Or reference the token directly with variables:
    • Bearer header value: Authorization: [[oauth2:header]]
    • Raw token string: [[oauth2:token]] or [[oauth_2_token]]

Token refresh

  • When a refresh token is available API Press refreshes the access token before it expires
  • You can force a refresh from the OAuth panel if needed

Troubleshooting

  • Invalid redirect: the Redirect URL shown in API Press must match exactly in the provider settings
  • Invalid scope: confirm the list of scopes in the provider docs
  • 401 Unauthorized: check that the token is present and has not expired