---
title: "Send items"
---

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

# Send items

Path: cloudraker.run API

`POST /_cv/{cv}/items`

Send input items. Max 7 MB body. One turn is in flight at a time. A refused item (`turn_in_flight`, `conversation_ended`, a file that is too large, a conversation cap) comes back as an `error` item in `items`, with status 200. A 4XX status refuses the request: a bad body (400), a bad or expired token (401), a body over 7 MB (413), or the per-IP limit (429).

## Authentication

- `session`, http, header `Authorization`

## Path parameters

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

## Request body

_Required._

- `items` (`sendItems.items`; array<object>, required)
  - `type` (`sendItems.items.type`; string, required)
    - one of `"text"`, `"file"`, `"answer"`, `"variable"`, `"cancel"`, `"typing"`, `"end"`, `"audio"`
  - `text` (`sendItems.items.text`; string, optional)
    - maxLength 4000
  - `client_id` (`sendItems.items.client_id`; string, optional)
    - maxLength 64
  - `name` (`sendItems.items.name`; string, optional)
  - `content_type` (`sendItems.items.content_type`; string, optional)
  - `data` (`sendItems.items.data`; string, optional) — `file`: base64, max 5 MB decoded over HTTP.
  - `question_id` (`sendItems.items.question_id`; string, optional)
  - `value` (`sendItems.items.value`; string | number | boolean, optional)

## Example request

```json
{
  "items": [
    {
      "type": "text",
      "text": "string",
      "client_id": "string",
      "name": "string",
      "content_type": "string",
      "data": "string",
      "question_id": "string",
      "value": "string"
    }
  ]
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://your-org.cloudraker.run/_cv/<cv>/items' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "items": [
    {
      "type": "text",
      "text": "string",
      "client_id": "string",
      "name": "string",
      "content_type": "string",
      "data": "string",
      "question_id": "string",
      "value": "string"
    }
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://your-org.cloudraker.run/_cv/<cv>/items';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    items: [
      {
        type: 'text',
        text: 'string',
        client_id: 'string',
        name: 'string',
        content_type: 'string',
        data: 'string',
        question_id: 'string',
        value: 'string'
      }
    ]
  })
};

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>/items"

payload = { "items": [
        {
            "type": "text",
            "text": "string",
            "client_id": "string",
            "name": "string",
            "content_type": "string",
            "data": "string",
            "question_id": "string",
            "value": "string"
        }
    ] }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

The last durable seq and the ephemeral answers.

#### Example

```json
{
  "seq": 0,
  "items": [
    {
      "type": "user",
      "seq": 0,
      "at": "2019-08-24T14:15:22Z"
    }
  ]
}
```

- `seq` (`sendItems.response.200.seq`; integer, required) — The last durable seq after the items.
- `items` (`sendItems.response.200.items`; array<object>, required) — Ephemeral answers, for example `error` items.
  - `type` (`sendItems.response.200.items.type`; string, required)
    - one of `"user"`, `"message"`, `"message.delta"`, `"question"`, `"activity"`, `"ui"`, `"file"`, `"event"`, `"handoff"`, `"language"`, `"blocked"`, `"ended"`, `"status"`, `"error"`
  - `seq` (`sendItems.response.200.items.seq`; integer | null, required)
  - `at` (`sendItems.response.200.items.at`; string, required)
    - format `date-time`

### 4XX

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

#### Example

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

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


Source: https://docs.cloudraker.com/run/api/send-items/index.md
