# 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](https://emotiv.gitbook.io/cortex-api/authentication/authorize) for details.

## Parameters

| Name         | Type     | Required | Description                                                                                    |
| ------------ | -------- | -------- | ---------------------------------------------------------------------------------------------- |
| cortexToken  | `string` | yes      | A token returned by [authorize](https://emotiv.gitbook.io/cortex-api/authentication/authorize) |
| 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 %}
