Conversations

Update Conversation Variable

Available for: Chatflow, Chatbot, Legacy Agent apps.

Updates a conversation variable's value. The new value must match the variable's existing type.

put/conversations/{conversation_id}/variables/{variable_id}

Request

  • Base URL
    https://api.dify.ai/v1
  • URL
    https://api.dify.ai/v1/conversations/{conversation_id}/variables/{variable_id}
  • Auth
    HTTP bearer

Path parameters

conversation_idstring uuid required

ID of the conversation that owns the variable. Get conversation IDs from List Conversations.

variable_idstring uuid required

ID of the variable to update. Get variable IDs from List Conversation Variables.

Request body

userstring

End-user identifier, defined by your app and unique within it. See End User Identity.

valueunknown required

Response

Variable updated successfully.

created_atinteger

Creation timestamp.

descriptionstring

Variable description.

idstring uuid

Variable ID.

namestring

Variable name.

updated_atinteger

Last update timestamp.

valuestring

Variable value (can be a JSON string for complex types).

value_typestring

Variable value type. Possible values: string, number, object, secret, file, boolean, array[any], array[string], array[number], array[object], array[file], array[boolean].

Changes

No recorded changes to this operation across all 17 revisions of this API.