SessionController_create
POST
/v1/public/session
const url = 'https://example.com/v1/public/session';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"channel":"web","context":{},"language":"example","publishableKey":"pk_…","visitorId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/public/session \ --header 'Content-Type: application/json' \ --data '{ "channel": "web", "context": {}, "language": "example", "publishableKey": "pk_…", "visitorId": "example" }'Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
channel
string
context
Unsigned host context (anonymous sessions only; max 8 KB)
object
language
Preferred answer language (BCP 47, e.g. tr, en-GB)
string
publishableKey
required
string
Example
pk_…visitorId
Previous visitor id to keep the same identity
string
Responses
Section titled “Responses”Media typeapplication/json
object
expiresIn
required
number
token
required
string
visitorId
required
string
Example generated
{ "expiresIn": 1, "token": "example", "visitorId": "example"}Guest sessions are disabled for this tenant