ModifyCustomAgent

Updated at:

Modify a custom agent in a personal space or workspace

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:ModifyCustomAgent

update

*All Resource

*

None None

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

WorkspaceId

string

No

The ID of the workspace.

56kv1pvl9uvt9**********bb

CustomAgentId

string

Yes

The ID of the custom agent.

ca-4y3ca4khkcu**********ysf

Name

string

No

The name of the custom agent.

Agent测试名称

Description

string

No

The description of the custom agent.

Agent测试描述

DataJson

string

No

The data scope for the agent, specified in a JSON-formatted string.

  • General parameters:
    • tableFlag: Set this to true to specify the data scope.

    • scope: The value must be personal.

    • personal: The parameters for files or databases.

For files, use the following parameters:

  • DataSourceType: The value must be remote_data_center.

  • FileId: The file ID.

  • Database: The database name returned by the ListDataCenterTable operation. This is typically the file name.

  • Tables: The table names returned by the ListDataCenterTable operation.

  • TableIds: The table IDs returned by the ListDataCenterTable operation.

  • RegionId: The current region.

{
  "tableFlag": true,
  "scope": "personal",
  "personal": {
    "DataSourceType": "remote_data_center",
    "FileId": "f-f0jksn001ibmkoo********6v2zn6",
    "Database": "diamonds.csv",
    "Tables": [
      "diamonds"
    ],
    "TableIds": [
      "35hfn94pxl********50pi"
    ],
    "RegionId": "cn-hangzhou"
  }
}

For databases, use the following parameters:

  • DataSourceType: The value must be database.

  • DmsInstanceId: The ID of the DMS instance, which is returned by the data center API.

  • DmsDatabaseId: The ID of the DMS database, which is returned by the data center API.

  • FileId: The instance name. This parameter is deprecated.

  • DbName: The database name returned by the data center API.

  • Database: The database name returned by the data center API.

  • Tables: The table names returned by the data center API.

  • TableIds: The table IDs returned by the data center API.

  • Engine: The database engine type. Valid values: mysql and postgresql.

  • RegionId: The current region.

{
  "tableFlag": true,
  "scope": "personal",
  "personal": {
    "DataSourceType": "database",
    "DmsInstanceId": "284***8",
    "DmsDatabaseId": "769***45",
    "FileId": "pgm-bp15095e*******6t",
    "DbName": "pg_catalog",
    "Database": "pg_catalog",
    "Tables": [
      "pg_aggregate"
    ],
    "TableIds": [
      "5263****31"
    ],
    "Engine": "postgresql",
    "RegionId": "cn-hangzhou"
  }
}

{ "tableFlag" : true, "scope" : "personal", "personal" : { "DataSourceType" : "remote_data_center", "FileId" : "f-5qlrwaw10********s3gpw1z", "Database" : "测试表格******.xlsx", "Tables" : [ "Sheet1" ], "TableIds" : [ "******" ], "RegionId" : "cn-hangzhou" } }

Instruction

string

No

The system instruction for the custom agent.

  • The maximum length is 10,000 characters.

分析框架: 1、需按日、周、月维度监控核心指标(GMV、订单量、UV、转化率),分析趋势变化及同比/环比波动; 2、划分新老客、渠道、地域进行拆解,识别增长来源与短板; 3、结合用户行为路径(浏览→加购→支付)开展漏斗分析,定位流失环节;

Knowledge

string

No

A text-based knowledge base for the custom agent.

  • The maximum length is 10,000 characters.

核心指标定义: 1、GMV(成交总额)指订单金额总和,含已支付及未支付成功订单; 2、订单量为每日有效下单笔数; 3、UV(独立访客)指访问网站或APP的去重用户数; 4、转化率=支付订单数 / UV,反映流量转化效率;

KnowledgeConfigList

array<object>

No

The configurations for the external knowledge base.

object

No

The configuration for the external knowledge base.

AccessType

string

No

The access type.

  • mcp: Connects via the MCP service.

Valid values:

  • mcp :

    Connects via the MCP service.

mcp

McpServerId

string

No

The ID of the MCP server.

nhdpt9adf6ac**********ca

KbUuid

string

No

The UUID of the knowledge base.

ExecutionConfig

object

No

The execution configuration.

SkipPlan

boolean

No

Specifies whether to skip the plan confirmation step.

true

SkipSqlConfirm

boolean

No

Specifies whether to skip all SQL confirmation steps.

true

SkipWebReportConfirm

boolean

No

Specifies whether to skip the confirmation for web report generation.

true

SkipAskHuman

boolean

No

Specifies whether to prevent the agent from asking for user input during execution.

true

ScheduleTaskConfig

object

No

The configuration for the scheduled task.

RelatedSessionId

string

No

The ID of a previous session to use as a reference.

4m24*****mg7j2v

CronExpression

string

No

The cron expression for the scheduled task.

0 0 0,1 ? * 1-7

Query

string

No

The query for the scheduled task.

分析一下这份数据,给出简报

TextReportConfig

string

No

The formatting instructions for the text report.

  • The maximum length is 10,000 characters.

文字报告要求所有数字不使用阿拉伯数字,全部转为中文数字

WebReportConfig

string

No

The formatting instructions for the web report.

  • The maximum length is 50,000 characters.

网页报告要求所有数字不使用阿拉伯数字,全部转为中文数字

DMSUnit

string

No

The current DMS unit.

cn-hangzhou

CallbackConfig

object

No

The callback configuration.

Type

string

No

The callback type.

ToolId

string

No

The ID of the tool to call.

CallbackPrompt

string

No

The prompt to use for the callback.

CallbackArgs

string

No

The arguments for the callback.

CallbackTime

integer

No

The timestamp of the callback.

Response elements

Element

Type

Description

Example

object

The response schema.

RequestId

string

The ID of the request.

67E910F2-4B62-5B0C-ACA3-7547695C****

Success

boolean

Indicates whether the request succeeded. Valid values:

  • true: The request succeeded.

  • false: The request failed.

true

ErrorCode

string

The error code.

success

ErrorMessage

string

The error message.

Specified parameter Tid is not valid.

Data

object

The response data.

CustomAgentId

string

The custom agent ID.

ca-4y3ca4khkcu**********ysf

Name

string

The custom agent name.

Agent测试名称

Description

string

The custom agent description.

Agent测试描述

DataJson

string

The data scope in JSON format.

{ "tableFlag" : true, "scope" : "personal", "personal" : { "DataSourceType" : "remote_data_center", "FileId" : "f-5qlrwaw10********s3gpw1z", "Database" : "测试表格******.xlsx", "Tables" : [ "Sheet1" ], "TableIds" : [ "******" ], "RegionId" : "cn-hangzhou" } }

Instruction

string

The instruction for the agent.

分析框架: 1、需按日、周、月维度监控核心指标(GMV、订单量、UV、转化率),分析趋势变化及同比/环比波动; 2、划分新老客、渠道、地域进行拆解,识别增长来源与短板; 3、结合用户行为路径(浏览→加购→支付)开展漏斗分析,定位流失环节;

Knowledge

string

The text-based knowledge for the agent.

核心指标定义: 1、GMV(成交总额)指订单金额总和,含已支付及未支付成功订单; 2、订单量为每日有效下单笔数; 3、UV(独立访客)指访问网站或APP的去重用户数; 4、转化率=支付订单数 / UV,反映流量转化效率;

Status

string

The agent status.

RELEASED

ReleaseTime

string

The release time.

2025-12-11T14:04:32.000+00:00

OfflineTime

string

The offline time.

2025-12-11T14:04:32.000+00:00

Modifier

string

ID of the last modifier.

20372822********

WorkspaceId

string

The workspace ID.

56kv1pvl9uvt9**********bb

Region

string

The region ID.

cn-hangzhou

AliyunUid

string

The Alibaba Cloud account ID.

20372822********

AliyunParentUid

string

The main Alibaba Cloud account ID.

16738266********

DmsUnit

string

The current DMS unit.

cn-hangzhou

GmtCreated

string

The creation time.

2025-12-11T14:04:32.000+00:00

GmtModified

string

The last modification time.

2025-12-11T14:04:32.000+00:00

KnowledgeConfigList

array<object>

Configurations for external knowledge bases.

object

Configuration of an external knowledge base.

AccessType

string

The access type.

  • mcp: Connects via MCP.

Valid values:

  • mcp :

    Access using the MCP method

mcp

McpServerId

string

The MCP server ID.

nhdpt9adf6ac**********ca

KbUuid

string

The knowledge base UUID.

ExecutionConfig

object

The execution configuration.

SkipPlan

boolean

Specifies whether to skip plan confirmation.

true

SkipSqlConfirm

boolean

Specifies whether to skip all SQL confirmations.

true

SkipWebReportConfirm

boolean

Specifies whether to skip web report confirmation.

true

SkipAskHuman

boolean

Specifies whether to skip asking for human input during execution.

true

TextReportConfig

string

Formatting requirements for the text report.

文字报告要求所有数字不使用阿拉伯数字,全部转为中文数字

WebReportConfig

string

Formatting requirements for the web report.

网页报告要求所有数字不使用阿拉伯数字,全部转为中文数字

CreatorUserName

string

Name of the user who created the agent.

HaoY*****

ModifierUserName

string

Name of the user who last modified the agent.

HaoY*****

DMSUnit

string

The current DMS unit.

cn-hangzhou

IsScheduleTask

boolean

Indicates whether a scheduled task is configured.

false

NextRuntime

integer

The next runtime for the scheduled task.

  • This value is a UNIX timestamp.

1767715200

ScheduleTaskConfig

object

The scheduled task configuration.

RelatedSessionId

string

The ID of a reference session.

4m24*****mg7j2v

CronExpression

string

The cron expression for the task.

0 0 0 ? * 1-7

Query

string

The query for the task.

分析一下这份数据,给出简报

CallbackConfig

object

The callback configuration.

Type

string

The callback type.

ToolId

string

The ID of the tool to be called.

CallbackPrompt

string

The callback prompt.

CallbackArgs

string

The callback arguments.

CallbackTime

integer

The callback timestamp.

RelatedSessionId

string

The ID of a reference session.

Examples

Success response

JSON format

{
  "RequestId": "67E910F2-4B62-5B0C-ACA3-7547695C****",
  "Success": true,
  "ErrorCode": "success",
  "ErrorMessage": "Specified parameter Tid is not valid.",
  "Data": {
    "CustomAgentId": "ca-4y3ca4khkcu**********ysf",
    "Name": "Agent测试名称",
    "Description": "Agent测试描述",
    "DataJson": "{\n  \"tableFlag\" : true,\n  \"scope\" : \"personal\",\n  \"personal\" : {\n    \"DataSourceType\" : \"remote_data_center\",\n    \"FileId\" : \"f-5qlrwaw10********s3gpw1z\",\n    \"Database\" : \"测试表格******.xlsx\",\n    \"Tables\" : [ \"Sheet1\" ],\n    \"TableIds\" : [ \"******\" ],\n    \"RegionId\" : \"cn-hangzhou\"\n  }\n}",
    "Instruction": "分析框架:\n1、需按日、周、月维度监控核心指标(GMV、订单量、UV、转化率),分析趋势变化及同比/环比波动;\n2、划分新老客、渠道、地域进行拆解,识别增长来源与短板;\n3、结合用户行为路径(浏览→加购→支付)开展漏斗分析,定位流失环节;",
    "Knowledge": "核心指标定义:\n1、GMV(成交总额)指订单金额总和,含已支付及未支付成功订单;\n2、订单量为每日有效下单笔数;\n3、UV(独立访客)指访问网站或APP的去重用户数;\n4、转化率=支付订单数 / UV,反映流量转化效率;",
    "Status": "RELEASED",
    "ReleaseTime": "2025-12-11T14:04:32.000+00:00",
    "OfflineTime": "2025-12-11T14:04:32.000+00:00",
    "Modifier": "20372822********",
    "WorkspaceId": "56kv1pvl9uvt9**********bb",
    "Region": "cn-hangzhou",
    "AliyunUid": "20372822********\n",
    "AliyunParentUid": "16738266********",
    "DmsUnit": "cn-hangzhou",
    "GmtCreated": "2025-12-11T14:04:32.000+00:00",
    "GmtModified": "2025-12-11T14:04:32.000+00:00",
    "KnowledgeConfigList": [
      {
        "AccessType": "mcp",
        "McpServerId": "nhdpt9adf6ac**********ca",
        "KbUuid": ""
      }
    ],
    "ExecutionConfig": {
      "SkipPlan": true,
      "SkipSqlConfirm": true,
      "SkipWebReportConfirm": true,
      "SkipAskHuman": true
    },
    "TextReportConfig": "文字报告要求所有数字不使用阿拉伯数字,全部转为中文数字",
    "WebReportConfig": "网页报告要求所有数字不使用阿拉伯数字,全部转为中文数字",
    "CreatorUserName": "HaoY*****",
    "ModifierUserName": "HaoY*****",
    "DMSUnit": "cn-hangzhou",
    "IsScheduleTask": false,
    "NextRuntime": 1767715200,
    "ScheduleTaskConfig": {
      "RelatedSessionId": "4m24*****mg7j2v",
      "CronExpression": "0 0 0 ? * 1-7",
      "Query": "分析一下这份数据,给出简报"
    },
    "CallbackConfig": {
      "Type": "",
      "ToolId": "",
      "CallbackPrompt": "",
      "CallbackArgs": "",
      "CallbackTime": 0
    },
    "RelatedSessionId": ""
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.