Modify Custom Role

Last Updated on : 2026-02-26 09:15:43download

Based on the device ID and role ID, modify the specified custom role for the AI ​​agent.

API address

PUT: /v1.0/cloud/agent/ai/chat/b/devices/{device_id}/custom-roles/{role_id}

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringpathtrueThe ID of the specified device.
role_idStringpathtrueThe ID of the specified role.

Description of body

Parameter nameTypeINRequiredDescription
role_nameStringbodyfalseThe name of the specified role.
role_descStringbodyfalseThe description of the specified role.
role_introduceStringbodyfalseThe introduction to the specified role.
role_img_urlStringbodyfalseThe URL of the specified role image.
use_lang_codeStringbodyfalseThe code of the specified language.
use_timbre_idStringbodyfalseThe ID of the specified voice tone.
use_llm_idStringbodyfalseThe ID of the specified large language model.
speedStringbodyfalseThe speech speed.

Return parameter

Parameter nameTypeDescription
resultbooleanIndicates whether the operation is successful.

Request example

PUT: /v1.0/cloud/agent/ai/chat/b/devices/{device_id}/custom-roles/{role_id}
{
  "device_id": "6c3585ebfe301b40a8u***",
  "role_id": "163000***",
  "role_name": "Test***",
  "role_desc": "The role description***",
  "role_introduce": "You are a student tutor***",
  "role_img_url": "https://images.tuyacn.com/***/icon/2***.png",
  "use_lang_code": "zh",
  "use_timbre_id": "6*",
  "use_llm_id": "8*",
  "speed": "30"
}

Return example

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

Error code

For more information, see error code.