Create Session

Start a new chatbot conversation session. You must create a session before sending messages.

Start a new chatbot conversation. Returns a session_uid that you use for all subsequent message and session operations.

Required: Owner, Editor, or Operator role

POST
/createSession

Authorization

bearerToken

AuthorizationBearer <token>

API token for YourGPT Public APIs. Create tokens in Settings > API Tokens in your YourGPT dashboard.

In: header

Request Body

application/x-www-form-urlencoded

project_uid*string

The project unique identifier

Response Body

application/json

curl -X POST "https://api.yourgpt.ai/chatbot/v1/createSession" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d 'project_uid=string'
{
  "type": "RXSUCCESS",
  "message": "Chatbot session created successfully",
  "data": {
    "id": 0,
    "session_uid": 0,
    "chat_mode": "string",
    "project_id": 0,
    "integration_id": 0,
    "state": "string",
    "segment": "string",
    "device_type": "string",
    "platform": "string",
    "ip": "string",
    "country": "string",
    "visitor_id": 0,
    "is_emulator": true,
    "contact_id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  }
}

Save the session_uid from the response — you need it for Send Message and Get Session Messages.