Skip to main content

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.).
Concurrent publishing is safe (backed by a DB unique index plus conflict retry as a fault-tolerance mechanism).

Request body

FieldRequiredTypeDescription
agent_idYesstringAgent ID.
agent_version_descNostringVersion 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

FieldTypeDescription
request_idstringUnique request identifier. Provide this ID when troubleshooting issues.
status_codeintegerHTTP status code.
codestringResponse code. Success on success.
messagestringInformational message.
statusstringRequest status: SUCCESS or FAILED.
successbooleanWhether the request succeeded.
data.agent_idstringAgent ID.
data.agent_versionstringVersion number after deployment, e.g. 1, 2.
data.agent_statusstringAgent status. deployed after deployment.

Error codes

HTTP status codeError codeDescription
400Index.InvalidParameterInvalid 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
}
Managed Agent API
Flow Agent API
Sandbox API
RAG API
Long-term Memory
ParseX API
Security API
Framework Integration