## ExchangeToken `client.identity.exchangeToken(IdentityExchangeTokenParamsbody, RequestOptionsoptions?): 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 - `body: IdentityExchangeTokenParams` - `exchangeToken?: string` exchange_token is the token to exchange ### Returns - `IdentityExchangeTokenResponse` - `accessToken?: string` access_token is the new access token ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const response = await client.identity.exchangeToken({ exchangeToken: 'exchange-token-value' }); console.log(response.accessToken); ``` #### Response ```json { "accessToken": "accessToken" } ```