Update Profile Schema
Updated at:
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://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v2/apps/memory/profile_schemas/{profile_schema_id}
Replace {WorkspaceId} with your actual workspace ID.
Request parameters
| Parameter | Type | Required | Location | Description |
|---|---|---|---|---|
profile_schema_id | string | Yes | Path | Profile schema ID |
name | string | No | Body | Updated schema name, up to 32 characters |
description | string | No | Body | Updated schema description |
plan_version | string | No | Body | Billing plan: pro or lite |
extract_scene | string | No | Body | Extraction mode: efficient or intelligent |
attributes_operations | array | No | Body | List of attribute operations |
attributes_operations[].op | string | Yes | Body | Operation type: add, update, or delete |
attributes_operations[].name | string | Conditional | Body | Attribute name; required when op=add and optional when op=update |
attributes_operations[].description | string | No | Body | Attribute description; applies to add and update |
attributes_operations[].default_value | string | No | Body | Default attribute value; can be changed when op=update |
attributes_operations[].attribute_id | string | Conditional | Body | Attribute ID; required when op=update or op=delete |
memory_library_id | string | No | Body | Memory library ID |
Code examples
curl -X PATCH "https://{WorkspaceId}.cn-beijing.maas.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"
}
Is this page helpful?