Query Variables

Last Updated on : 2026-02-26 09:17:37download

Query the list of AI agent variables based on the device ID.

API address

GET: /v1.0/cloud/agent/ai/b/devices/{device_id}/agent-variables

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.

Return parameter

Parameter nameTypeDescription
variable_keyStringThe key of the specified variable.
variable_valueStringThe value of the specified variable.

Request example

GET: /v1.0/cloud/agent/ai/b/devices/{device_id}/agent-variables
{
  "device_id": "123***"
}

Return example

{
    "result": [
        {
            "variable_value": "Obsessed with the universe and the stars, studying all kinds of astronomical knowledge",
            "variable_key": "sys.memoryInterests"
        },
        {
            "variable_value": "",
            "variable_key": "sys.roleSupplementDesc"
        },
        {
            "variable_value": "You are an astronomer",
            "variable_key": "sys.roleIntroduce"
        },
        {
            "variable_value": "99 years old",
            "variable_key": "sys.memoryAge"
        },
        {
            "variable_value": "July 7",
            "variable_key": "sys.memoryBirthday"
        },
        {
            "variable_value": "User asked ***",
            "variable_key": "sys.memoryHistoryChatSummary"
        },
        {
            "variable_value": "Test***",
            "variable_key": "sys.roleName"
        },
        {
            "variable_value": "",
            "variable_key": "sys.memoryUserFullName"
        },
        {
            "variable_value": "Astronomer",
            "variable_key": "sys.roleRemark"
        },
        {
            "variable_value": "Astronomer",
            "variable_key": "custom.roleName"
        },
        {
            "variable_value": "Test**",
            "variable_key": "custom.familyName"
        },
        {
            "variable_value": "James",
            "variable_key": "custom.userName"
        },
        {
            "variable_value": "12345***",
            "variable_key": "custom.userId"
        }
    ],
    "t": 1753790540058,
    "success": true
}

Error code

For more information, see error code.