aiAgentsDelete
AiFileOperationWrapper aiAgentsDelete(id, AiAgentsDeleteRequest)
DELETE /api/2.0/ai/agents/{id}
Delete an agent
Deletes an AI agent room. The ID has to be the room's integer identifier, and the body is forwarded to the DocSpace AI service unchanged, so it accepts the same options as deleting an ordinary room - deleteAfter among them. Deletion is asynchronous there: the answer is a file-operation payload to poll, not a completed result. The agent's model binding is deliberately left behind, because the upstream assignment API has no per-entry delete, so an orphaned assignment row survives the room.
Parameters
| Name | In | Type | Description | Notes |
|---|---|---|---|---|
| id | path | String | The agent identifier. | [required] [example: 1234] |
| AiAgentsDeleteRequest | body | AiAgentsDeleteRequest | [required] |
Responses
| Status code | Description | Type | Response headers |
|---|---|---|---|
| 200 | The queued file operation. Deletion runs asynchronously, so poll DocSpace for its outcome. | AiFileOperationWrapper | - |
| 400 | The agent ID is not a positive integer. | AiErrorResponse | - |
| 401 | Missing asc_auth_key cookie or Authorization header. | AiErrorResponse | - |
| 403 | AI is disabled for this portal, the caller is a guest, or the room named by entityId is one the caller cannot open. Relayed from the DocSpace AI service or the Files API. | AiErrorResponse | - |
| 413 | The request body is larger than 100 KB, the JSON parser's limit on this route. | AiErrorResponse | - |
| 500 | Unhandled failure. The reason is logged server-side and never echoed back. | AiErrorResponse | - |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json