diff --git a/src/r0/account.rs b/src/r0/account.rs index 7bc88a7c..d33db981 100644 --- a/src/r0/account.rs +++ b/src/r0/account.rs @@ -5,3 +5,4 @@ pub mod deactivate; pub mod register; pub mod request_password_change_token; pub mod request_register_token; +pub mod whoami; diff --git a/src/r0/account/whoami.rs b/src/r0/account/whoami.rs new file mode 100644 index 00000000..199fea39 --- /dev/null +++ b/src/r0/account/whoami.rs @@ -0,0 +1,22 @@ +//! [GET /_matrix/client/r0/account/whoami](https://matrix.org/docs/spec/client_server/r0.4.0.html#get-matrix-client-r0-account-whoami) + +use ruma_api_macros::ruma_api; +use serde::{Deserialize, Serialize}; + +ruma_api! { + metadata { + description: "Get information about the owner of a given access token.", + method: GET, + name: "whoami", + path: "/_matrix/client/r0/account/whoami", + rate_limited: true, + requires_authentication: true, + } + + request {} + + response { + /// The id of the user that owns the access token. + pub user_id: String, + } +}