## ExchangeToken `identity.exchange_token(IdentityExchangeTokenParams**kwargs) -> IdentityExchangeTokenResponse` **post** `/gitpod.v1.IdentityService/ExchangeToken` Exchanges an exchange token for a new access token. Use this method to: - Convert exchange tokens to access tokens - Obtain new access credentials - Complete token exchange flows ### Examples - Exchange token: Trades an exchange token for an access token. ```yaml exchangeToken: "exchange-token-value" ``` ### Parameters - `exchange_token: Optional[str]` exchange_token is the token to exchange ### Returns - `class IdentityExchangeTokenResponse: …` - `access_token: Optional[str]` access_token is the new access token ### Example ```python import os from gitpod import Gitpod client = Gitpod( bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted ) response = client.identity.exchange_token( exchange_token="exchange-token-value", ) print(response.access_token) ``` #### Response ```json { "accessToken": "accessToken" } ```