Update conversation metadata¶
Replace all metadata of a local conversation.
POST https://token.moi.matrixorigin.cn/v1/conversations/{conversation_id}
Before you begin¶
Prepare a personal access token with Genesis access.
Use the credential used to Create a conversation, and choose a local conversation that has not been deleted or bound to an upstream model.
Request example¶
Replace $GENESIS_ACCESS_TOKEN and $CONVERSATION_ID with your personal access token and the selected conversation ID.
curl -X POST "https://token.moi.matrixorigin.cn/v1/conversations/$CONVERSATION_ID" \
-H "Authorization: Bearer $GENESIS_ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"metadata": {
"purpose": "support"
}
}'
Path parameters¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The |
Request body¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
object |
No |
Replaces all existing metadata. Omitting this field or passing an empty object clears the metadata. |
|
any |
No |
Caller-defined keys and values, such as |
Successful response¶
A successful request returns the conversation with its replaced metadata.
{
"id": "$CONVERSATION_ID",
"object": "conversation",
"metadata": {
"purpose": "support"
},
"status": "active",
"created_at": 1780000000,
"updated_at": 1780000000
}
Field |
Type |
Description |
|---|---|---|
|
string |
Conversation identifier for retrieval, updates, and deletion. |
|
string |
Always |
|
object |
Custom conversation metadata. |
|
any |
Caller-defined keys and values, such as |
|
string |
Conversation status; |
|
integer |
Creation time as a Unix timestamp in seconds. |
|
integer |
Last update time as a Unix timestamp in seconds. |
Error response¶
The request returns 404 when the resource is missing, deleted, or inaccessible to the current credential.
{
"error": {
"message": "conversation not found",
"type": "conversation_not_found",
"code": "conversation_not_found"
}
}
Field |
Type |
Description |
|---|---|---|
|
object |
Error details. |
|
string |
Error description. |
|
string |
Error type. |
|
string |
Error code. |
Next steps¶
Use the conversation id to Retrieve a conversation and check the replaced metadata.