For example, you want to make use of a refresh token to get the access token after the access token expires.
The following example shows the structure of a token request given a pre-existing refresh_token:
curl --location --request POST https://anypoint.mulesoft.com/accounts/api/v2/oauth2/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=<your_client_id>' \
--data-urlencode 'client_secret=<your_client_secret>' \
--data-urlencode 'grant_type=refresh_token' \
--data-urlencode 'refresh_token=<your_refresh_token>'
Steps to get the refresh token
1. Create a connected app
2. Generate access_token along with refresh token in Postman using steps below
Callback URL: https://oauth.pstmn.io/v1/callback Auth URL: https://anypoint.mulesoft.com/accounts/api/v2/oauth2/authorize Access Token: URL https://anypoint.mulesoft.com/accounts/api/v2/oauth2/token Client ID: <from connected app created in Step 1> Client Secret: <from connected app created in Step 1> Scope: offline_access full
Refresh Token Expiry
From our Docs "Refresh tokens expire after 90 days. Access tokens expire after the user’s session expires."
Subsequent refresh tokens when generated will also have the same validity as above.
001116350

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.