Skip to main content

Get User Profile

Get the profile attributes of a specified user

Gets the profile attributes of a specified user. Profile extraction is asynchronous. After calling AddMemory, the first query may not contain attribute values, so retry according to your application's retry policy.
If all returned attribute values are empty, verify that AddMemory was called with the same profile_schema. Without that parameter, profile extraction is not triggered.

Method and endpoint

GET https://dashscope.aliyuncs.com/api/v2/apps/memory/profile_schemas/{profile_schema_id}/user_profile

Request parameters

ParameterTypeRequiredLocationDescription
profile_schema_idstringYesPathProfile schema ID
user_idstringYesQueryMemory entity ID
memory_library_idstringNoQueryMemory library ID

Response

FieldTypeDescription
request_idstringRequest ID
profile.schema_namestringProfile schema name
profile.schema_descriptionstringProfile schema description
profile.attributesarrayProfile attribute list
profile.attributes[].idstringAttribute ID
profile.attributes[].namestringAttribute name
profile.attributes[].valuestringAttribute value

Code examples

curl -X GET "https://dashscope.aliyuncs.com/api/v2/apps/memory/profile_schemas/{profile_schema_id}/user_profile?user_id=user_001" \
  --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
  --header "Content-Type: application/json"

Response example

{
  "profile": {
    "attributes": [
      {"id": "bb28e6cd522443fc9bf7e75b1377bf9d", "name": "Age", "value": "28"},
      {"id": "04eb06f5f04a437b82d07ceb088103f9", "name": "Hobbies", "value": "Playing football"},
      {"id": "2eff4652a6bc47b0803635033b1e08dd", "name": "Occupation", "value": "Software engineer"}
    ],
    "schema_description": "User information including age and interests",
    "schema_name": "Basic user profile"
  },
  "request_id": "78cb6090-a7a5-9897-861c-082a64b43d97"
}
For the complete profile workflow, see Using User Profiles.
Managed Agent API
Flow Agent API
Sandbox API
RAG API
ParseX API
Security API
Framework Integration