---
title: "Start a conversation"
---

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

# Start a conversation

Path: cloudraker.run API

`POST /_cv/start/{embed_key}`

Checks the Turnstile token and opens a web conversation on the door. Answers a `cvs_` session token. The `Origin` must be an origin of the door.

## Path parameters

- `embed_key` (`startConversation.path.embed_key`; string, required) — The public `rek_` embed key of a front door.
  - pattern `^rek_[A-Za-z0-9]{24}$`

## Request body

_Required._

- `turnstile_token` (`startConversation.turnstile_token`; string, required) — The token from the challenge frame. Single use.
  - maxLength 4096
- `lang` (`startConversation.lang`; string, optional) — Must be in the door `languages`.
- `variables` (`startConversation.variables`; map<boolean | number | string>, optional) — Session variables of the door. A string only for an `enum` value.
- `gate_accepted` (`startConversation.gate_accepted`; boolean, optional) — Required `true` when the door has a gate.

## Example request

```json
{
  "turnstile_token": "string",
  "lang": "string",
  "variables": {
    "property1": true,
    "property2": true
  },
  "gate_accepted": true
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://your-org.cloudraker.run/_cv/start/<embed_key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "turnstile_token": "string",
  "lang": "string",
  "variables": {
    "property1": true,
    "property2": true
  },
  "gate_accepted": true
}
'
```

### TypeScript

```typescript
const url = 'https://your-org.cloudraker.run/_cv/start/<embed_key>';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    turnstile_token: 'string',
    lang: 'string',
    variables: {property1: true, property2: true},
    gate_accepted: true
  })
};

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/start/<embed_key>"

payload = {
    "turnstile_token": "string",
    "lang": "string",
    "variables": {
        "property1": True,
        "property2": True
    },
    "gate_accepted": True
}
headers = {"Content-Type": "application/json"}

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

print(response.text)
```

## Responses

### 201

The conversation and its session token.

#### Example

```json
{
  "conversation_id": "cv_01K7Q3V9X2M4N6P8R0S2T4V6W8",
  "session_token": "string",
  "expires_at": "2019-08-24T14:15:22Z",
  "socket_url": "http://example.com",
  "items_url": "http://example.com",
  "stream_url": "http://example.com",
  "door": {
    "id": "support/support",
    "name": "Acme support",
    "languages": [
      "string"
    ],
    "lang": "string",
    "variables": {
      "property1": {
        "type": "boolean",
        "values": [
          "string"
        ],
        "min": 0,
        "max": 0,
        "default": null
      },
      "property2": {
        "type": "boolean",
        "values": [
          "string"
        ],
        "min": 0,
        "max": 0,
        "default": null
      }
    },
    "theme": {},
    "gate": {},
    "greeting": "string",
    "files": true
  }
}
```

- `conversation_id` (`startConversation.response.201.conversation_id`; string, required)
  - example `"cv_01K7Q3V9X2M4N6P8R0S2T4V6W8"`
- `session_token` (`startConversation.response.201.session_token`; string, required) — `cvs_` session token of this conversation.
- `expires_at` (`startConversation.response.201.expires_at`; string, required)
  - format `date-time`
- `socket_url` (`startConversation.response.201.socket_url`; string, required)
  - format `uri`
- `items_url` (`startConversation.response.201.items_url`; string, required)
  - format `uri`
- `stream_url` (`startConversation.response.201.stream_url`; string, required)
  - format `uri`
- `door` (`startConversation.response.201.door`; object, required) — The browser view of a front door. No guard, router, agent or limit leaves the server.
  - `id` (`startConversation.response.201.door.id`; string, required)
    - example `"support/support"`
  - `name` (`startConversation.response.201.door.name`; string, required)
    - example `"Acme support"`
  - `languages` (`startConversation.response.201.door.languages`; array | null, required)
  - `lang` (`startConversation.response.201.door.lang`; string | null, required)
  - `variables` (`startConversation.response.201.door.variables`; map<object>, required)
  - `theme` (`startConversation.response.201.door.theme`; object | null, required) — `channels.web.theme` of the door.
  - `gate` (`startConversation.response.201.door.gate`; object | null, required) — `channels.web.gate` of the door: `title`, `body`, `accept`, `links`.
  - `greeting` (`startConversation.response.201.door.greeting`; string | null, required)
  - `files` (`startConversation.response.201.door.files`; boolean, required) — The chat may send files.

### 503

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

#### Example

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

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

### 4XX

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

#### Example

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

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


Source: https://docs.cloudraker.com/run/api/start-conversation/index.md
