---
title: "Create Widget Session"
method: POST
path: "/api/v1/public/text-widget/sessions"
tags: ["text-widget-public"]
---

# Create Widget Session

`POST /api/v1/public/text-widget/sessions`

Create a new text chat session for a widget visitor.

## Query parameters

- `key` string, nullable

## Headers

- `X-Widget-Key` string, nullable

## Request body

- TextWidgetSessionCreate — Request body for creating a text widget session.
  - `visitor_name` string, nullable
  - `visitor_email` string, nullable
  - `visitor_phone` string, nullable
  - `text_agent_id` string, uuid, nullable
  - `consent_given` boolean
  - `consent_version` string, nullable

## Response `201`

Successful Response

- TextWidgetSessionCreated — Response after creating a text widget session.
  - `session_id` string, uuid, required
  - `session_token` string, required
  - `greeting_message` string, nullable, required

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-03** `d65b8fefae34` — 2 info
  - added the optional property `detail/items/ctx` to the response with the `422` status
  - added the optional property `detail/items/input` to the response with the `422` status

[Change history](https://skmtc.dev/getanana/apis/cleon-api/changes/api/v1/public/text-widget/sessions/post.md)

---

[API](https://skmtc.dev/getanana/apis/cleon-api.md) · [All operations](https://skmtc.dev/getanana/apis/cleon-api/llms.txt) · [OpenAPI document](https://skmtc.dev/getanana/apis/cleon-api/revisions/41c5e4645524?raw)
