UpdateDataAgent
Updates the configuration of a specified DataAgent, including the display name, description, system prompt, assumed RAM role, and associated context models.
Operation description
Full replacement, not partial update
Optional fields omitted in the request body are reset to empty values instead of retaining their original values. For example, if you only want to modify the description, you must still submit the original values of displayName and systemPrompt. Otherwise, they will be cleared.
Call GetDataAgent to retrieve the current configuration, modify it, and then submit the full replacement.
Required fields
contextModels and roleArn are required. If they are missing, a 400 error is returned. contextModels must be associated with at least one context model.
Unmodifiable name
The name in the path is only used to locate the resource and cannot be modified. To change the name, delete the DataAgent and create a new one.
PassRole permission
When you call this operation as a RAM user or by assuming a role, the caller must have the ram:PassRole permission on the role specified by roleArn. Otherwise, a 401 error is returned.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
log:UpdateDataAgent |
update |
*DataAgent
|
None | None |
Request syntax
PUT /dataagents/{name} HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| name |
string |
No |
The name of the DataAgent. It is passed in the request path to locate the DataAgent to be updated. The name itself cannot be modified. |
order-analysis-agent |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
Yes |
The request body in JSON format. This operation performs a full replacement. Optional fields omitted in the request body are reset to empty values instead of retaining their original values. |
|
| contextModels |
array |
Yes |
The list of names of context models associated with the DataAgent. This parameter is required and must contain at least one context model. The update performs a full replacement. The list submitted in this request becomes the complete set of associations after the update. |
|
|
string |
No |
The name of a single context model, which must be created under the current account. |
order-context |
|
| description |
string |
No |
The description of the DataAgent. It is used to describe its scope of responsibilities and applicable scenarios. It is only for display and search purposes and does not affect runtime behavior. If this parameter is not passed or an empty string is passed, the description is cleared. The keyword parameter in the list operation performs a fuzzy match with this description. |
Analyzes order and revenue-related logs and outputs daily summary reports |
| displayName |
string |
No |
The display name, which can be up to 256 characters in length and can contain Chinese characters. This operation performs a full replacement: omitting this field is equivalent to passing an empty string, which clears the existing display name. To retain the existing display name, submit it together with its original value. |
Order analysis assistant |
| roleArn |
string |
Yes |
The ARN of the RAM role assumed by DataAgent to access resources in your account. The format is acs:ram::<Alibaba Cloud account ID>:role/<role name>. This parameter is required. If you call this operation as a RAM user or by assuming a role, the caller must also have the ram:PassRole permission on this role. Otherwise, a 401 error is returned. |
acs:ram::123456789012****:role/sls-dataagent-role |
| systemPrompt |
string |
No |
The system prompt of the DataAgent. It is used to set its role positioning, capability boundaries, and response style. If this parameter is not passed or an empty string is passed, the system prompt is cleared. |
You are a data analysis assistant in the order domain. Only answer questions related to orders and revenue. When uncertain, explain the reason instead of guessing |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response body. It returns the updated DataAgent configuration, with fields consistent with the request body. |
||
| contextModels |
array |
The list of names of context models associated with the DataAgent after the update. |
|
|
string |
The name of a single context model. |
order-context |
|
| createdAt |
string |
The creation time in ISO 8601 format in the UTC time zone, accurate to seconds. |
2026-08-14T10:00:03Z |
| description |
string |
The updated description of the DataAgent. An empty string is returned if it is not set. |
Analyzes order and revenue-related logs and outputs daily summary reports |
| displayName |
string |
The updated display name. An empty string |
Order analysis assistant |
| name |
string |
The name of the DataAgent, which is the same as the name passed in the request path. |
order-analysis-agent |
| roleArn |
string |
The ARN of the RAM role assumed by the DataAgent after the update. The format is acs:ram::123456789012****:role/ |
acs:ram::123456789012****:role/sls-dataagent-role |
| systemPrompt |
string |
The updated system prompt. An empty string is returned if it is not set. |
You are a data analysis assistant in the order domain. Only answer questions related to orders and revenue. When uncertain, explain the reason instead of guessing |
| updatedAt |
string |
The time when this update takes effect. The format is the same as createdAt. |
2026-08-14T11:20:35Z |
| userId |
string |
The ID of the Alibaba Cloud account to which the DataAgent belongs. |
123456789012**** |
Examples
Success response
JSON format
{
"contextModels": [
"order-context"
],
"createdAt": "2026-08-14T10:00:03Z",
"description": "Responsible for analyzing order and revenue-related logs and generating daily summary reports",
"displayName": "Order Analysis Assistant",
"name": "order-analysis-agent",
"roleArn": "acs:ram::123456789012****:role/sls-dataagent-role",
"systemPrompt": "You are a data analysis assistant for the order domain. Only answer questions related to orders and revenue. If you are unsure, explain the reason instead of guessing",
"updatedAt": "2026-08-14T11:20:35Z",
"userId": "123456789012****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.