> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ninjatrader.com/_mcp/server.

# Renew Access Token

GET https://demo.tradovateapi.com/v1/auth/renewaccesstoken

### Renew an existing access token without starting a new session.

**Available to:** All authenticated users

**Environments:** Demo, Live

**[Rate Limit](/api/authentication#request-rate-limits-and-time-penalties):** 15 requests per hour, 15-second back-off, counts all requests

Extends the lifetime of your current access token without creating a new session. Send your existing, non-expired token with the `Bearer` scheme; the response returns a fresh `accessToken` and `expirationTime`.

Use renewal in long-running applications so you don't start a new session unless it's absolutely necessary. Repeatedly calling [`accessTokenRequest`](/api/rest-api-endpoints/authentication/access-token-request) starts new sessions, and because you're limited to two concurrent sessions per user, that can drop dependent services that share a token. Call renewal about 15 minutes before the current token expires. See [Authentication & Access](/api/authentication) for session details.

**Common Failure Scenarios**

- The supplied access token has already expired — renew before expiry, not after.
- The `Authorization` header is missing or malformed (returns `HTTP 401`).

**Error Messages**

| `errorText` | Trigger |
|-------------|---------|
| Non-empty `errorText` | The request failed; the field describes the reason. |

Reference: https://docs.ninjatrader.com/api/rest-api-endpoints/authentication/renew-access-token

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: public
  version: 1.0.0
paths:
  /auth/renewaccesstoken:
    get:
      operationId: renewAccessToken
      summary: Renew Access Token
      description: >-
        ### Renew an existing access token without starting a new session.


        **Available to:** All authenticated users


        **Environments:** Demo, Live


        **[Rate
        Limit](/api/authentication#request-rate-limits-and-time-penalties):** 15
        requests per hour, 15-second back-off, counts all requests


        Extends the lifetime of your current access token without creating a new
        session. Send your existing, non-expired token with the `Bearer` scheme;
        the response returns a fresh `accessToken` and `expirationTime`.


        Use renewal in long-running applications so you don't start a new
        session unless it's absolutely necessary. Repeatedly calling
        [`accessTokenRequest`](/api/rest-api-endpoints/authentication/access-token-request)
        starts new sessions, and because you're limited to two concurrent
        sessions per user, that can drop dependent services that share a token.
        Call renewal about 15 minutes before the current token expires. See
        [Authentication & Access](/api/authentication) for session details.


        **Common Failure Scenarios**


        - The supplied access token has already expired — renew before expiry,
        not after.

        - The `Authorization` header is missing or malformed (returns `HTTP
        401`).


        **Error Messages**


        | `errorText` | Trigger |

        |-------------|---------|

        | Non-empty `errorText` | The request failed; the field describes the
        reason. |
      tags:
        - Authentication
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: AccessTokenResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessTokenResponse'
servers:
  - url: https://demo.tradovateapi.com/v1
    description: Demo
  - url: https://live.tradovateapi.com/v1
    description: Live
components:
  schemas:
    AccessTokenResponseHibpHint:
      type: string
      enum:
        - EmailAndPasswordCompromised
        - PasswordCompromised
      description: EmailAndPasswordCompromised, PasswordCompromised
      title: AccessTokenResponseHibpHint
    AccessTokenResponseUserStatus:
      type: string
      enum:
        - Active
        - Closed
        - Initiated
        - TemporaryLocked
        - UnconfirmedEmail
      description: Active, Closed, Initiated, TemporaryLocked, UnconfirmedEmail
      title: AccessTokenResponseUserStatus
    AccessTokenResponse:
      type: object
      properties:
        errorText:
          type: string
          description: Non-empty if the request failed
        hibpHint:
          $ref: '#/components/schemas/AccessTokenResponseHibpHint'
          description: EmailAndPasswordCompromised, PasswordCompromised
        accessToken:
          type: string
        expirationTime:
          type: string
          format: date-time
        passwordExpirationTime:
          type: string
          format: date-time
        userStatus:
          $ref: '#/components/schemas/AccessTokenResponseUserStatus'
          description: Active, Closed, Initiated, TemporaryLocked, UnconfirmedEmail
        userId:
          type: integer
          format: int64
        name:
          type: string
        hasLive:
          type: boolean
        hasSimPlus:
          type: boolean
        showKIDs:
          type: boolean
      title: AccessTokenResponse
  securitySchemes:
    bearer_access_token:
      type: http
      scheme: bearer

```

## Examples



**Response**

```json
{
  "errorText": "string",
  "hibpHint": "EmailAndPasswordCompromised",
  "accessToken": "string",
  "expirationTime": "2024-01-15T09:30:00Z",
  "passwordExpirationTime": "2024-01-15T09:30:00Z",
  "userStatus": "Active",
  "userId": 1,
  "name": "string",
  "hasLive": true,
  "hasSimPlus": true,
  "showKIDs": true
}
```

**SDK Code**

```python
import requests

url = "https://demo.tradovateapi.com/v1/auth/renewaccesstoken"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://demo.tradovateapi.com/v1/auth/renewaccesstoken';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://demo.tradovateapi.com/v1/auth/renewaccesstoken"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://demo.tradovateapi.com/v1/auth/renewaccesstoken")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://demo.tradovateapi.com/v1/auth/renewaccesstoken")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://demo.tradovateapi.com/v1/auth/renewaccesstoken', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://demo.tradovateapi.com/v1/auth/renewaccesstoken");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://demo.tradovateapi.com/v1/auth/renewaccesstoken")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```