---
title: "Create bot session"
method: POST
path: "/bot/{botId}/session/create"
tags: ["Bot Session"]
---

# Create bot session

`POST /bot/{botId}/session/create`

## Request

- Base URL: `https://api.chatbotkit.com/api/v1`
- URL: `https://api.chatbotkit.com/api/v1/bot/{botId}/session/create`
- Auth: HTTP bearer

## Path parameters

- `botId` string, required: The ID of the bot for this session

## Request body

- object
  - `durationInSeconds` number: The maximum amount of time this session will stay open
  - `messages` object[]: An array of messages to be included in the conversation
    - `type` 'user' | 'bot' | 'reasoning' | 'context' | 'instruction' | 'backstory' | 'activity' | 'checkpoint', required: The type of the message
    - `text` string, required: The text of the message
  - `meta` Meta: Meta data information

## Response `200`

The bot was deleted successfully

- object
  - `id` string, required: The ID of the bot
  - `conversationId` string, required: The ID of the conversation
  - `token` string, required: The token for this conversation
  - `expiresAt` number, required: The time the token will expire in milliseconds
  - `messages` object[]: An array of messages included in the conversation
    - `type` 'user' | 'bot' | 'reasoning' | 'context' | 'instruction' | 'backstory' | 'activity' | 'checkpoint', required: The type of the message
    - `text` string, required: The text of the message

## Other responses

- `default`: An error response

---

[API](https://skmtc.dev/chatbotkit/apis/cbk-api.md) · [All operations](https://skmtc.dev/chatbotkit/apis/cbk-api/llms.txt) · [OpenAPI document](https://skmtc.dev/chatbotkit/apis/cbk-api/revisions/13d250576136?raw)
