Query Custom Roles

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

Based on the device ID, query the list of custom roles of the AI agent.

API address

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

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringpathtrueThe ID of the specified device.
page_noIntegerquerytrueThe page number.
page_sizeIntegerquerytrueThe number of items returned per page.

Return parameter

Parameter nameTypeDescription
use_timbre_idStringThe ID of the specified voice tone.
role_introduceStringThe introduction to the specified role.
last_text_answerStringThe last text answer.
use_llm_nameStringThe name of the specified large language model (LLM).
role_nameStringThe name of the specified role.
use_lang_codeStringThe code of the specified language.
role_idStringThe ID of the specified role.
role_descStringThe description of the specified role.
template_idStringThe ID of the specified template.
in_bindBooleanIndicates whether a role has been bound.
role_img_urlStringThe URL of the specified role image.
use_lang_nameStringThe name of the specified language.
use_timbre_nameStringThe name of the specified voice tone.

Request example

GET: /v1.0/cloud/agent/ai/chat/b/devices/{device_id}/custom-roles
{
  "device_id": "6c3585ebfe301b40a8u***",
  "page_no": 1,
  "page_size": 10
}

Return example

{
    "result": {
        "list": [
            {
                "use_timbre_id": "clone_45701***",
                "role_introduce": "A lively ***",
                "last_text_answer": "***",
                "use_llm_name": "1.5 Pro ***",
                "role_name": "Test 1***",
                "use_lang_code": "zh",
                "role_id": "165600***",
                "role_desc": "The role description",
                "template_id": "94300***",
                "in_bind": true,
                "role_img_url": "https://images.tuyacn.com/smart/***/1748412117d6db500f***.jpeg",
                "use_lang_name": "Chinese",
                "use_timbre_name": "My Voice Tone"
            }
        ],
        "total": 2
    },
    "t": 1753693705434,
    "success": true
}

Error code

For more information, see error code.