CreateDataAgentSession

Updated at:

Create a DataAgent session

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dms:CreateDataAgentSession

create

*All Resource

*

None None

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

DMSUnit

string

No

The current DMS unit.

cn-hangzhou

Title

string

No

The session title. Supports Chinese and English. Maximum length: 128 characters.

帮我分析一下这份数据,给出报告。

File

string

No

The file ID.

f-8*******01m

SessionConfig

object

No

The session configuration.

Language

string

No

The language. Valid values:

  • CHINESE: Chinese

  • ENGLISH: English

CHINESE

CustomAgentId

string

No

The custom agent ID.

ca-e*******ckd

CustomAgentStage

string

No

The custom agent stage. Valid values:

  • debug: Test stage.

  • prod: Production stage.

debug

Mode

string

No

The mode. Valid values:

  • ASK_DATA: Quick inquiry mode.

  • ANALYSIS: Analysis mode.

  • INSIGHT: Insight mode.

ANALYSIS

EnableSearch

boolean

No

Specifies whether to enable web search.

false

McpServerIds

array

No

A list of MCP server IDs.

string

No

The MCP server ID.

2q1tu90**********6uttu2nw

KbUuidList

array

No

string

No

UserOssBucket

string

No

The OSS bucket name.

  • This bucket stores intermediate files and report artifacts from the analysis.

user-oss-bucket

EncryptType

string

No

EncryptKey

string

No

ReportWaterMark

string

No

ReportPageWidth

integer

No

WorkspaceId

string

No

The workspace ID.

12****

Response elements

Element

Type

Description

Example

object

The response schema.

RequestId

string

The request ID.

1CB***********3F1A

Data

object

The response structure.

SessionId

string

The agent session ID.

976*********p

SessionStatus

string

The session status.

RUNNING

AgentId

string

The agent ID.

cu0cs*******mf

AgentStatus

string

The agent status.

RUNNING

Title

string

The session title.

帮我分析一下这份数据,给出报告。

File

string

The ID of the associated file.

f-8*******01m

SessionConfig

object

The session configuration.

Language

string

The language. Valid values:

  • CHINESE: Chinese

  • ENGLISH: English

CHINESE

CustomAgentId

string

The custom agent ID.

ca-e*******ckd

CustomAgentStage

string

The stage of the custom agent. Valid values:

  • debug: Debug stage

  • prod: Production stage

debug

Mode

string

The mode. Valid values:

  • ASK_DATA: Quick Inquiry Mode

  • ANALYSIS: Analysis Mode

  • INSIGHT: Insight Mode

ANALYSIS

EnableSearch

boolean

Indicates whether web search is enabled.

true

McpServerIds

array

A list of MCP server IDs.

string

An MCP server ID.

2q1tu90**********6uttu2nw

KbUuidList

array

string

UserOssBucket

string

The name of the user's OSS bucket.

  • Analysis files and report artifacts can be uploaded to this OSS bucket.

user-oss-bucket

EncryptType

string

EncryptKey

string

ReportWaterMark

string

ReportPageWidth

integer

CreateTime

integer

The time when the session was created, in Unix milliseconds.

1765262307992

Saved

boolean

Indicates whether the current user has favorited the session.

false

Success

boolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.

  • false: The request failed.

true

ErrorCode

string

The error code.

success

ErrorMessage

string

The error message returned if the request fails.

UnknownError

Examples

Success response

JSON format

{
  "RequestId": "1CB***********3F1A",
  "Data": {
    "SessionId": "976*********p",
    "SessionStatus": "RUNNING",
    "AgentId": "cu0cs*******mf",
    "AgentStatus": "RUNNING",
    "Title": "帮我分析一下这份数据,给出报告。",
    "File": "f-8*******01m",
    "SessionConfig": {
      "Language": "CHINESE",
      "CustomAgentId": "ca-e*******ckd",
      "CustomAgentStage": "debug",
      "Mode": "ANALYSIS",
      "EnableSearch": true,
      "McpServerIds": [
        "2q1tu90**********6uttu2nw"
      ],
      "KbUuidList": [
        ""
      ],
      "UserOssBucket": "user-oss-bucket",
      "EncryptType": "",
      "EncryptKey": "",
      "ReportWaterMark": "",
      "ReportPageWidth": 0
    },
    "CreateTime": 1765262307992,
    "Saved": false
  },
  "Success": true,
  "ErrorCode": "success",
  "ErrorMessage": "UnknownError"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.