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.

Endpoint

PATCHhttps://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v2/apps/memory/profile_schemas/{profile_schema_id}

Replace {WorkspaceId} with your actual workspace ID.

Path parameters

profile_schema_idstringRequired

Profile schema ID

Location: Path

Request body

namestringOptional

Updated schema name, up to 32 characters

Location: Body
descriptionstringOptional

Updated schema description

Location: Body
plan_versionstringOptional

Billing plan: pro or lite

Location: Body
extract_scenestringOptional

Extraction mode: efficient or intelligent

Location: Body
attributes_operationsarrayOptional

List of attribute operations

Location: Body
attributes_operations[].opstringRequired

Operation type: add, update, or delete

Location: Body
attributes_operations[].namestringConditional

Attribute name; required when op=add and optional when op=update

Location: Body
attributes_operations[].descriptionstringOptional

Attribute description; applies to add and update

Location: Body
attributes_operations[].default_valuestringOptional

Default attribute value; can be changed when op=update

Location: Body
attributes_operations[].attribute_idstringConditional

Attribute ID; required when op=update or op=delete

Location: Body
memory_library_idstringOptional

Memory library ID

Location: Body

Request 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"
}