CreateSession - Create a Conversation Session
Create a new conversation session (Session) to organize one or more question-and-answer interactions.
Interface Description
A Session represents a conversation context. After creation, a sessionId is returned. Subsequent question requests must be associated with a Session.
If the client already has a reusable sessionId, this step can be skipped and a question can be submitted directly.
Usage Notes
- A single Session can contain multiple questions.
- A Session can be reused multiple times; you do not need to create a new one for every question.
Request Method
Request Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
| tenantId | Query + Body | Integer | Yes | Tenant ID |
| userId | Query + Body | Integer | Yes | User ID |
| domainId | Body | Integer | Yes | Data domain ID, corresponding to a dataset |
| title | Body | String | No | Session title, used to identify the Session |
| loginToken | Query + Body | String | Yes | Authentication Token obtained via GenerateAuthToken |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| success | Boolean | Whether the request was successful |
| data | Integer | The sessionId of the newly created session |
Request Example
Response Example
Successful response:
The value 4729 in data is the newly created sessionId.
Error Codes
| Error Code | Description |
|---|---|
| success=false | Token is invalid, parameters are missing, or insufficient permissions |
Related Documentation
- GenerateAuthToken — Previous step: obtain authentication Token
- Text2InsightQuery — Next step: submit a data analysis request
- Quick Start — Complete end-to-end example
