> For the complete documentation index, see [llms.txt](https://emotiv.gitbook.io/cortex-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://emotiv.gitbook.io/cortex-api/authentication/generatenewtoken.md).

# generateNewToken

This method uses a Cortex token to generate a new Cortex token. You can use this method to extend the expiration date of a token.

See [authorize](/cortex-api/authentication/authorize.md) for details.

## Parameters

| Name         | Type     | Required | Description                                                              |
| ------------ | -------- | -------- | ------------------------------------------------------------------------ |
| cortexToken  | `string` | yes      | A token returned by [authorize](/cortex-api/authentication/authorize.md) |
| clientId     | `string` | yes      | The client id of your Cortex application                                 |
| clientSecret | `string` | yes      | The client secret of your Cortex application                             |

## Result

The result is an object containing a field **cortexToken**.

| Name        | Type     | Description                      |
| ----------- | -------- | -------------------------------- |
| cortexToken | `string` | The new Cortex token of the user |

## Example

{% tabs %}
{% tab title="Request" %}

```javascript
{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "generateNewToken",
    "params": {
        "cortexToken": "xxx",
        "clientId": "...",
        "clientSecret": "..."
    }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "cortexToken": "yyy"
    }
}
```

{% endtab %}
{% endtabs %}
