Skip to content

Proposal to add a GET method to read account data #1339

@ananace

Description

@ananace

The spec provides a PUT method for setting account data, but the only way to read the data back is from the sync queries.
This is very nice if you want to be able to get a stream of data between clients, but in the case of bots that just use the account data to store configuration / state between restarts - or use the HS as a key-value store - then it's more of a nuisance.

Adding GET methods that will directly retrieve the latest data in the given id would be helpful for those use cases;

GET /_matrix/client/r0/user/%40alice%3Aexample.com/account_data/org.example.custom.config
Content-Type: application/json

{
  "custom_account_data_key": "custom_config_value"
}
GET /_matrix/client/r0/user/%40alice%3Aexample.com/rooms/%21726s6s6q%3Aexample.com/account_data/org.example.custom.room.config
Content-Type: application/json

{
  "custom_account_data_key": "custom_account_data_value"
}

A Last-Modified header could be nice to have, but most definitely not a necessity for the feature.

Metadata

Metadata

Assignees

Labels

kind:maintenanceMSC which clarifies/updates existing specmergedA proposal whose PR has merged into the spec!proposalA matrix spec change proposal

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions