---
title: "Renew the session token"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.cloudraker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Renew the session token

Path: cloudraker.run API

`POST /_cv/{cv}/session`

A new `cvs_` token with a later expiry. The open sockets get the new expiry. Only this call moves the expiry of an open socket: the `x-run-session-token` header does not. The total lifetime is 24 hours.

## Authentication

- `session`, http, header `Authorization`

## Path parameters

- `cv` (`renewSession.path.cv`; string, required) — The conversation id (`cv_...`).

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://your-org.cloudraker.run/_cv/<cv>/session' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://your-org.cloudraker.run/_cv/<cv>/session';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://your-org.cloudraker.run/_cv/<cv>/session"

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

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

print(response.text)
```

## Responses

### 200

The new session token.

#### Example

```json
{
  "session_token": "string",
  "expires_at": "2019-08-24T14:15:22Z"
}
```

- `session_token` (`renewSession.response.200.session_token`; string, required)
- `expires_at` (`renewSession.response.200.expires_at`; string, required)
  - format `date-time`

### 401

Error. See the `code` table in the guides.

#### Example

```json
{
  "error": {
    "code": "run_busy",
    "message": "string",
    "run_id": "string",
    "details": null
  }
}
```

- `error` (`renewSession.response.401.error`; object, required)
  - `code` (`renewSession.response.401.error.code`; string, required)
    - example `"run_busy"`
  - `message` (`renewSession.response.401.error.message`; string, required)
  - `run_id` (`renewSession.response.401.error.run_id`; string, optional)
  - `details` (`renewSession.response.401.error.details`; unknown, optional)

### 429

Error. See the `code` table in the guides.

#### Example

```json
{
  "error": {
    "code": "run_busy",
    "message": "string",
    "run_id": "string",
    "details": null
  }
}
```

- `error` (`renewSession.response.429.error`; object, required)
  - `code` (`renewSession.response.429.error.code`; string, required)
    - example `"run_busy"`
  - `message` (`renewSession.response.429.error.message`; string, required)
  - `run_id` (`renewSession.response.429.error.run_id`; string, optional)
  - `details` (`renewSession.response.429.error.details`; unknown, optional)


Source: https://docs.cloudraker.com/run/api/renew-session/index.md
