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

---

[API](https://skmtc.dev/getanana/apis/cleon-api.md) · [All operations](https://skmtc.dev/getanana/apis/cleon-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/getanana/cleon-api/revisions/c0f54348e251/schema)
