Update Session

Update a session's state, chat mode, or segment.

Update a conversation session's state, chat mode, or segment. Only the allowed fields can be updated — any extra fields will be rejected.

Required: Owner, Editor, or Operator role

POST
/updateSession

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

session_uid*number

The session UID to update

state?string

Update session state

Value in"resolved" | "pending" | "unresolved" | "closed"
chat_mode?string

Update chat mode. bot = AI handles, awaiting = waiting for operator, operator = human takeover

Value in"bot" | "awaiting" | "operator"
segment?string

Update session segment label

Lengthlength <= 255

Response Body

application/json

curl -X POST "https://api.yourgpt.ai/chatbot/v1/updateSession" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d 'project_uid=string'
{
  "type": "RXSUCCESS",
  "message": "Session updated successfully",
  "data": {
    "session_uid": 0,
    "id": 0,
    "project_id": 0,
    "state": "string",
    "chat_mode": "string",
    "segment": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  }
}

About chat_mode

ValueMeaning
botAI handles the conversation
awaitingWaiting for a human operator
operatorHuman operator has taken over

About state

ValueMeaning
pendingActive conversation
resolvedResolved (auto-transfers to bot mode)
unresolvedMarked as unresolved
closedClosed conversation

Setting state to resolved automatically transfers the session to bot mode. You cannot set chat_mode and state: resolved in the same request.