Deploy Agent
Publish the beta draft as a new version, with the version number auto-incremented.
Prerequisites
Obtain an Alibaba Cloud Model Studio API Key and workspace ID first. For authentication, see API Authentication. Deploying an Agent requires the Knowledge Base - Modify permission, which is determined by the user's role in Workspace Member Management. See Permissions.
Endpoint
POST /api/v1/indices/rag/app/deploy
Publish the beta version of the specified Agent as a formal version. After publishing, the Agent status becomes deployed and the version number is incremented to a number (e.g. 1, 2, etc.).
NoteConcurrent publishing is safe (backed by a DB unique index plus conflict retry as a fault-tolerance mechanism).
Request body
| Field | Required | Type | Description |
|---|---|---|---|
agent_id | Yes | string | Agent ID. |
agent_version_desc | No | string | Version description for this deployment. |
Request example
curl -X POST "$BASE_URL/api/v1/indices/rag/app/deploy" \
-H "Authorization: Bearer $BAILIAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "aid-8f3a1b2c4d5e6f70",
"agent_version_desc": "Added anti-leak feature, optimized retrieval parameters"
}'
BASE_URL is https://{workspace_id}.cn-beijing.maas.aliyuncs.com ({workspace_id} is the workspace ID), and BAILIAN_API_KEY is your Alibaba Cloud Model Studio API Key.
Response example
Returns 200 on success.
{
"request_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"status_code": 200,
"code": "Success",
"message": "",
"status": "SUCCESS",
"success": true,
"data": {
"agent_id": "aid-8f3a1b2c4d5e6f70",
"agent_version": "2",
"agent_status": "deployed"
}
}
Response fields
| Field | Type | Description |
|---|---|---|
request_id | string | Unique request identifier. Provide this ID when troubleshooting issues. |
status_code | integer | HTTP status code. |
code | string | Response code. Success on success. |
message | string | Informational message. |
status | string | Request status: SUCCESS or FAILED. |
success | boolean | Whether the request succeeded. |
data.agent_id | string | Agent ID. |
data.agent_version | string | Version number after deployment, e.g. 1, 2. |
data.agent_status | string | Agent status. deployed after deployment. |
Error codes
| HTTP status code | Error code | Description |
|---|---|---|
| 400 | Index.InvalidParameter | Invalid request parameters. Please check that all parameters are complete and correctly typed. |
Error response example:
{
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status_code": 400,
"code": "Index.InvalidParameter",
"message": "Invalid request parameters. Please check that all parameters are complete and correctly typed.",
"status": "FAILED",
"success": false
}