---
title: "Get a socket ticket"
---

> 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.

# Get a socket ticket

Path: cloudraker.run API

`POST /_cv/{cv}/ticket`

A one-time ticket for `GET /_cv/{cv}/socket`. It opens one socket within 30 seconds, for this conversation, origin and session. A browser socket cannot send `Authorization`, so the socket takes this ticket and never the session token. Get a new ticket for each connect and reconnect.

## Authentication

- `session`, http, header `Authorization`

## Path parameters

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

## Code samples

### cURL

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

### TypeScript

```typescript
const url = 'https://your-org.cloudraker.run/_cv/<cv>/ticket';
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>/ticket"

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

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

print(response.text)
```

## Responses

### 200

The socket ticket.

#### Example

```json
{
  "ticket": "string",
  "expires_in": 30
}
```

- `ticket` (`socketTicket.response.200.ticket`; string, required) — A one-time socket ticket (`cvt_...`). Send it as `ticket` on `GET /_cv/{cv}/socket`.
- `expires_in` (`socketTicket.response.200.expires_in`; integer, required) — Seconds until the ticket expires.

### 401

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

#### Example

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

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

### 403

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

#### Example

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

- `error` (`socketTicket.response.403.error`; object, required)
  - `code` (`socketTicket.response.403.error.code`; string, required)
    - example `"run_busy"`
  - `message` (`socketTicket.response.403.error.message`; string, required)
  - `run_id` (`socketTicket.response.403.error.run_id`; string, optional)
  - `details` (`socketTicket.response.403.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` (`socketTicket.response.429.error`; object, required)
  - `code` (`socketTicket.response.429.error.code`; string, required)
    - example `"run_busy"`
  - `message` (`socketTicket.response.429.error.message`; string, required)
  - `run_id` (`socketTicket.response.429.error.run_id`; string, optional)
  - `details` (`socketTicket.response.429.error.details`; unknown, optional)


Source: https://docs.cloudraker.com/run/api/socket-ticket/index.md
