Delete Chat History

Last Updated on : 2026-02-26 09:16:55download

Based on the device ID, delete the chat history for the specified AI agent role.

API address

DELETE: /v1.0/cloud/agent/ai/chat/b/devices/{device_id}/history

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringpathtrueThe ID of the specified device.
bind_role_typeIntegerqueryfalseThe type of role to bind. Valid values:
  • 0: Custom role
  • 1: Template-based role
  • 2: Single role (There is no role, and data is at the agent level)
When role_id has a value, this parameter value must be passed.
role_idStringqueryfalseThe ID of the specified role.
clear_all_historyBooleanquerytrueSpecifies whether to clear all history.
request_idsStringqueryfalseThe list of up to 20 request IDs, separated by commas (,).

Return parameter

Parameter nameTypeDescription
resultbooleanIndicates whether the operation is successful.

Request example

DELETE: /v1.0/cloud/agent/ai/chat/b/devices/{device_id}/history
{
  "device_id": "6c3585ebfe301b40a8u***",
  "bind_role_type": 1,
  "role_id": "94300***",
  "clear_all_history": false,
  "request_ids": "0ed72c5a-11e4-47f3-a08f-b1d4-42767***,c487de49-d08e-4fb5-a0f0-e181-***"
}

Return example

{
    "tid": "6fa034fc1a6d11f0a8212220de940dcb",
    "result": true,
    "t": 1744771778112,
    "success": true
}

Error code

For more information, see error code.