Exchange Authorization Code
Description: Exchanges an authorization code for an access token. This is the second step of the OAuth 2.0 flow, completed after the user has authenticated and COUNT has redirected back to your application with a code.
Purpose: Allows your backend server to securely retrieve an access token (and optionally a refresh token) using the authorization code returned from COUNT’s authorization screen. This access token is then used to authenticate API requests on behalf of the user.
🔁 Authorization Code Flow Recap
After you initiate the OAuth flow and redirect the user to COUNT’s authorization screen, the user will authenticate and grant consent. Once successful, COUNT redirects the user back to your specified redirectUri with a query parameter named code. This authorization code is short-lived and is used in the next step to obtain an access token.
Header Parameters
Body Parameters
Response
Response Attributes
A Bearer access token used to authenticate API requests on behalf of the user. Include this in the Authorization header as Bearer
A token used to obtain a new accessToken when the current one expires. Should be securely stored and used only from your backend.
The ISO 8601 timestamp indicating when the accessToken will expire. After this time, you must use the refreshToken to obtain a new access token.
The ISO 8601 timestamp showing when the refreshToken will expire. After this point, the user must re-authenticate via the authorization flow.
A unique identifier for the COUNT workspace (organization/account) the user has connected. Use this to scope or associate actions with a specific COUNT account.
The human-readable name of the connected COUNT workspace, useful for display in your UI or logs.