Skip to main content

Update Profile Schema

Update the name, description, or plan version of a profile schema

Updates a profile schema. After modifying plan_version, newly written memories follow the new version rule, while already written memories are not affected. The request body must include at least one of name, description, plan_version, extract_scene, or attributes_operations.

Method and endpoint

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

Request parameters

ParameterTypeRequiredLocationDescription
profile_schema_idstringYesPathProfile schema ID
namestringNoBodyUpdated schema name, up to 32 characters
descriptionstringNoBodyUpdated schema description
plan_versionstringNoBodyBilling plan: pro or lite
extract_scenestringNoBodyExtraction mode: efficient or intelligent
attributes_operationsarrayNoBodyList of attribute operations
attributes_operations[].opstringYesBodyOperation type: add, update, or delete
attributes_operations[].namestringConditionalBodyAttribute name; required when op=add and optional when op=update
attributes_operations[].descriptionstringNoBodyAttribute description; applies to add and update
attributes_operations[].default_valuestringNoBodyDefault attribute value; can be changed when op=update
attributes_operations[].attribute_idstringConditionalBodyAttribute ID; required when op=update or op=delete
memory_library_idstringNoBodyMemory library ID

Code examples

cURL
curl -X PATCH "https://dashscope.aliyuncs.com/api/v2/apps/memory/profile_schemas/{profile_schema_id}" \
  --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "name": "Updated basic user profile",
    "description": "Stable user attributes and preference information",
    "plan_version": "lite",
    "extract_scene": "intelligent",
    "attributes_operations": [
      {"op": "add", "name": "Favorite music", "description": "Preferred music genres"},
      {"op": "update", "attribute_id": "attr_002", "name": "Regular exercise", "default_value": "Running"},
      {"op": "delete", "attribute_id": "attr_003"}
    ]
  }'

Response example

{
  "request_id": "813e8d62-062c-97d5-877b-e10f356ca7d4"
}
Managed Agent API
Flow Agent API
Sandbox API
RAG API
ParseX API
Security API
Framework Integration