Soft delete an Agent, marking status as deleted. The API is idempotent.
Prerequisites
Obtain an Alibaba Cloud Model Studio API Key and workspace ID first. For authentication, see API Authentication. Deleting an Agent requires the Knowledge Base - Delete permission, which is determined by the user's role in Workspace Member Management. See Permissions.
Endpoint
POST /api/v1/indices/rag/app/delete
Delete the specified Agent. After deletion, the Agent status becomes deleted and it can no longer be used for Q&A or retrieval. The API is idempotent: repeated deletions do not return an error.
Request body
| Field | Required | Type | Description |
|---|---|---|---|
agent_id | Yes | string | Agent ID. |
Request example
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.
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_status | string | Agent status. deleted after deletion. |
Error codes
| HTTP status code | Error code | Description |
|---|---|---|
| 400 | Index.InvalidParameter | Invalid request parameters. Please check that all parameters are complete and correctly typed. |