# Using Refresh Tokens to Renew Access Tokens

When an access token expires after 2 hours for All, Hyperscale, and Custom scope types, you must use a refresh token to renew the access tokens. To extend the access token for another 2 hours, use the Renew Token REST API. You can renew the token within 14 days after it expires. If you do not renew it within this 14-day period, the existing token cannot be renewed, and you must generate a new access token to continue using the REST APIs.

For expired access tokens with Microsoft SCIM and 1-Touch recovery scope types, you can only add a new access token.

Important

- Remember to use the latest access and refresh tokens in the Renew Token REST API. If you use a previous or older set of access and refresh tokens:

- All access tokens in the create and renew chain will be invalidated and deleted.

- If your email exists in your Commvault user profile, you will receive an email with details.

- You must create a new access token.

## Renew Token API Request to Renew the Access Token

### Syntax

    POST $[webservice]/V4/AccessToken/Renew HTTP/1.1
    Host: $[host name]
    Accept: application/xml
    Authorization: Bearer $[AccessToken]

    {
        "accessToken" : "$[AccessToken]",
        "refreshToken" : "$[RefreshTokenofExpiredAccessToken]"
    }

where <webservice> is the root path used to route the API requests to the Web Server.

For more information, see Available Web Services for REST API.

### Request Parameters

Name | Description | Required
--- | --- | ---
AccessToken | The access token for executing APIs. If the access token is not known, use the Create Access Token API to create a new token. | Yes
RefreshTokenofExpiredAccessToken | The token used for refreshing or renewing the access token. The RefreshToken is created along with the AccessToken in the Create Access Token API. | Yes

### Request Headers

Name | Description
--- | ---
Host | The host name of the Web Server or Command Center used in the API request.
Accept | The format of the response. Valid values are: application/xml or application/json.
Authorization | The bearer token or access token that you can create for yourself or for a user group. For more information, see the Create Access Token API.

×

Loading...