Skip to main content

Update Agent

Update the Agent name, description, or draft config

POST
/api/v1/indices/rag/app/update
cURL
curl -X POST "https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/indices/rag/app/update" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "aid-8f3a1b2c4d5e6f70",
    "agent_name": "Customer Service Q&A Assistant v2",
    "agent_config": {
        "agent_policy": "agentic",
        "agent_model": "qwen3.6-plus",
        "enable_session_file": "false",
        "enable_refusal": "true",
        "enable_anti_leak": "true",
        "enable_rich_text": "false",
        "enable_citation": "true",
        "temperature": 0.7,
        "max_num_llm_calls": 10,
        "kb_search_configs": [
            {
                "id": "pipeline-xxxxxx",
                "weight": 1,
                "dense_similarity_top_k": 15,
                "rerank_top_n": 5,
                "rerank": {
                    "model_name": "gte-rerank-hybrid",
                    "rerank_mode": "custom",
                    "rerank_instruct": "Rank documents by relevance according to the technical domain of the user's question"
                }
            }
        ]
    }
}'
{
  "request_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "status_code": 200,
  "code": "Success",
  "message": "",
  "status": "SUCCESS",
  "success": true,
  "data": {
    "agent_id": "aid-8f3a1b2c4d5e6f70"
  }
}
Update the Agent's name, description, or draft config.
Updating an Agent requires Knowledge Base - Modify permission.
agent_config can only modify the beta draft version; published versions can only modify the agent_version_desc field. To modify a published version's config, first call the update endpoint to update the beta draft, then call the deploy endpoint to publish a new version.
The agent_config structure is the same as Create Agent.

Authorizations

string
header
required

DashScope API Key, obtained from the API Key page in the console.

Body

application/json
string
required

Agent ID.

string

New Agent name, up to 200 characters.

length <= 200
string

New Agent description, up to 1000 characters.

length <= 1000
string

Agent version number, defaults to beta. When a published version number is passed, only agent_version_desc can be modified.

string

Version description.

object

Agent configuration object. If not provided, default configuration is used.

Response

200-application/json
string

Unique request identifier. Provide this ID when troubleshooting issues.

integer

HTTP status code.

string

Response code. Success on success.

string

Informational message.

enum<string>

Request status: SUCCESS or FAILED.

SUCCESS,FAILED
boolean

Whether the request succeeded.

object