]> Untitled Git - lemmy.git/blobdiff - docs/src/contributing_websocket_http_api.md
Isomorphic docker (#1124)
[lemmy.git] / docs / src / contributing_websocket_http_api.md
index f228f94e02fcda379bb661eb5f0e2d2457b28b43..ca2cceba6c5ee31f51c5b1c729665dffd4d5c9c3 100644 (file)
@@ -1,6 +1,6 @@
 # Lemmy API
 
-*Note: this may lag behind the actual API endpoints [here](../server/src/api).*
+*Note: this may lag behind the actual API endpoints [here](../src/api). The API should be considered unstable and may change any time.*
 
 <!-- toc -->
 
@@ -17,6 +17,7 @@
 - [Errors](#errors)
 - [API documentation](#api-documentation)
   * [Sort Types](#sort-types)
+  * [Undoing actions](#undoing-actions)
   * [Websocket vs HTTP](#websocket-vs-http)
   * [User / Authentication / Admin actions](#user--authentication--admin-actions)
     + [Login](#login)
       - [Request](#request-1)
       - [Response](#response-1)
       - [HTTP](#http-2)
-    + [Get User Details](#get-user-details)
+    + [Get Captcha](#get-captcha)
       - [Request](#request-2)
       - [Response](#response-2)
       - [HTTP](#http-3)
-    + [Save User Settings](#save-user-settings)
+    + [Get User Details](#get-user-details)
       - [Request](#request-3)
       - [Response](#response-3)
       - [HTTP](#http-4)
-    + [Get Replies / Inbox](#get-replies--inbox)
+    + [Save User Settings](#save-user-settings)
       - [Request](#request-4)
       - [Response](#response-4)
       - [HTTP](#http-5)
-    + [Get User Mentions](#get-user-mentions)
+    + [Get Replies / Inbox](#get-replies--inbox)
       - [Request](#request-5)
       - [Response](#response-5)
       - [HTTP](#http-6)
-    + [Edit User Mention](#edit-user-mention)
+    + [Get User Mentions](#get-user-mentions)
       - [Request](#request-6)
       - [Response](#response-6)
       - [HTTP](#http-7)
-    + [Mark All As Read](#mark-all-as-read)
+    + [Mark User Mention as read](#mark-user-mention-as-read)
       - [Request](#request-7)
       - [Response](#response-7)
       - [HTTP](#http-8)
-    + [Delete Account](#delete-account)
+    + [Get Private Messages](#get-private-messages)
       - [Request](#request-8)
       - [Response](#response-8)
       - [HTTP](#http-9)
-    + [Add admin](#add-admin)
+    + [Create Private Message](#create-private-message)
       - [Request](#request-9)
       - [Response](#response-9)
       - [HTTP](#http-10)
-    + [Ban user](#ban-user)
+    + [Edit Private Message](#edit-private-message)
       - [Request](#request-10)
       - [Response](#response-10)
       - [HTTP](#http-11)
-  * [Site](#site)
-    + [List Categories](#list-categories)
+    + [Delete Private Message](#delete-private-message)
       - [Request](#request-11)
       - [Response](#response-11)
       - [HTTP](#http-12)
-    + [Search](#search)
+    + [Mark Private Message as Read](#mark-private-message-as-read)
       - [Request](#request-12)
       - [Response](#response-12)
       - [HTTP](#http-13)
-    + [Get Modlog](#get-modlog)
+    + [Mark All As Read](#mark-all-as-read)
       - [Request](#request-13)
       - [Response](#response-13)
       - [HTTP](#http-14)
-    + [Create Site](#create-site)
+    + [Delete Account](#delete-account)
       - [Request](#request-14)
       - [Response](#response-14)
       - [HTTP](#http-15)
-    + [Edit Site](#edit-site)
+    + [Add admin](#add-admin)
       - [Request](#request-15)
       - [Response](#response-15)
       - [HTTP](#http-16)
-    + [Get Site](#get-site)
+    + [Ban user](#ban-user)
       - [Request](#request-16)
       - [Response](#response-16)
       - [HTTP](#http-17)
-    + [Transfer Site](#transfer-site)
+    + [User Join](#user-join)
       - [Request](#request-17)
       - [Response](#response-17)
       - [HTTP](#http-18)
-    + [Get Site Config](#get-site-config)
+  * [Site](#site)
+    + [List Categories](#list-categories)
       - [Request](#request-18)
       - [Response](#response-18)
       - [HTTP](#http-19)
-    + [Save Site Config](#save-site-config)
+    + [Search](#search)
       - [Request](#request-19)
       - [Response](#response-19)
       - [HTTP](#http-20)
-  * [Community](#community)
-    + [Get Community](#get-community)
+    + [Get Modlog](#get-modlog)
       - [Request](#request-20)
       - [Response](#response-20)
       - [HTTP](#http-21)
-    + [Create Community](#create-community)
+    + [Create Site](#create-site)
       - [Request](#request-21)
       - [Response](#response-21)
       - [HTTP](#http-22)
-    + [List Communities](#list-communities)
+    + [Edit Site](#edit-site)
       - [Request](#request-22)
       - [Response](#response-22)
       - [HTTP](#http-23)
-    + [Ban from Community](#ban-from-community)
+    + [Get Site](#get-site)
       - [Request](#request-23)
       - [Response](#response-23)
       - [HTTP](#http-24)
-    + [Add Mod to Community](#add-mod-to-community)
+    + [Transfer Site](#transfer-site)
       - [Request](#request-24)
       - [Response](#response-24)
       - [HTTP](#http-25)
-    + [Edit Community](#edit-community)
+    + [Get Site Config](#get-site-config)
       - [Request](#request-25)
       - [Response](#response-25)
       - [HTTP](#http-26)
-    + [Follow Community](#follow-community)
+    + [Save Site Config](#save-site-config)
       - [Request](#request-26)
       - [Response](#response-26)
       - [HTTP](#http-27)
-    + [Get Followed Communities](#get-followed-communities)
+  * [Community](#community)
+    + [Get Community](#get-community)
       - [Request](#request-27)
       - [Response](#response-27)
       - [HTTP](#http-28)
-    + [Transfer Community](#transfer-community)
+    + [Create Community](#create-community)
       - [Request](#request-28)
       - [Response](#response-28)
       - [HTTP](#http-29)
-  * [Post](#post)
-    + [Create Post](#create-post)
+    + [List Communities](#list-communities)
       - [Request](#request-29)
       - [Response](#response-29)
       - [HTTP](#http-30)
-    + [Get Post](#get-post)
+    + [Ban from Community](#ban-from-community)
       - [Request](#request-30)
       - [Response](#response-30)
       - [HTTP](#http-31)
-    + [Get Posts](#get-posts)
+    + [Add Mod to Community](#add-mod-to-community)
       - [Request](#request-31)
       - [Response](#response-31)
       - [HTTP](#http-32)
-    + [Create Post Like](#create-post-like)
+    + [Edit Community](#edit-community)
       - [Request](#request-32)
       - [Response](#response-32)
       - [HTTP](#http-33)
-    + [Edit Post](#edit-post)
+    + [Delete Community](#delete-community)
       - [Request](#request-33)
       - [Response](#response-33)
       - [HTTP](#http-34)
-    + [Save Post](#save-post)
+    + [Remove Community](#remove-community)
       - [Request](#request-34)
       - [Response](#response-34)
       - [HTTP](#http-35)
-  * [Comment](#comment)
-    + [Create Comment](#create-comment)
+    + [Follow Community](#follow-community)
       - [Request](#request-35)
       - [Response](#response-35)
       - [HTTP](#http-36)
-    + [Edit Comment](#edit-comment)
+    + [Get Followed Communities](#get-followed-communities)
       - [Request](#request-36)
       - [Response](#response-36)
       - [HTTP](#http-37)
-    + [Save Comment](#save-comment)
+    + [Transfer Community](#transfer-community)
       - [Request](#request-37)
       - [Response](#response-37)
       - [HTTP](#http-38)
-    + [Create Comment Like](#create-comment-like)
+    + [Community Join](#community-join)
       - [Request](#request-38)
       - [Response](#response-38)
       - [HTTP](#http-39)
+  * [Post](#post)
+    + [Create Post](#create-post)
+      - [Request](#request-39)
+      - [Response](#response-39)
+      - [HTTP](#http-40)
+    + [Get Post](#get-post)
+      - [Request](#request-40)
+      - [Response](#response-40)
+      - [HTTP](#http-41)
+    + [Get Posts](#get-posts)
+      - [Request](#request-41)
+      - [Response](#response-41)
+      - [HTTP](#http-42)
+    + [Create Post Like](#create-post-like)
+      - [Request](#request-42)
+      - [Response](#response-42)
+      - [HTTP](#http-43)
+    + [Edit Post](#edit-post)
+      - [Request](#request-43)
+      - [Response](#response-43)
+      - [HTTP](#http-44)
+    + [Delete Post](#delete-post)
+      - [Request](#request-44)
+      - [Response](#response-44)
+      - [HTTP](#http-45)
+    + [Remove Post](#remove-post)
+      - [Request](#request-45)
+      - [Response](#response-45)
+      - [HTTP](#http-46)
+    + [Lock Post](#lock-post)
+      - [Request](#request-46)
+      - [Response](#response-46)
+      - [HTTP](#http-47)
+    + [Sticky Post](#sticky-post)
+      - [Request](#request-47)
+      - [Response](#response-47)
+      - [HTTP](#http-48)
+    + [Save Post](#save-post)
+      - [Request](#request-48)
+      - [Response](#response-48)
+      - [HTTP](#http-49)
+    + [Post Join](#post-join)
+      - [Request](#request-49)
+      - [Response](#response-49)
+      - [HTTP](#http-50)
+  * [Comment](#comment)
+    + [Create Comment](#create-comment)
+      - [Request](#request-50)
+      - [Response](#response-50)
+      - [HTTP](#http-51)
+    + [Edit Comment](#edit-comment)
+      - [Request](#request-51)
+      - [Response](#response-51)
+      - [HTTP](#http-52)
+    + [Delete Comment](#delete-comment)
+      - [Request](#request-52)
+      - [Response](#response-52)
+      - [HTTP](#http-53)
+    + [Remove Comment](#remove-comment)
+      - [Request](#request-53)
+      - [Response](#response-53)
+      - [HTTP](#http-54)
+    + [Get Comments](#get-comments)
+      - [Request](#request-54)
+      - [Response](#response-54)
+      - [HTTP](#http-55)
+    + [Mark Comment as Read](#mark-comment-as-read)
+      - [Request](#request-55)
+      - [Response](#response-55)
+      - [HTTP](#http-56)
+    + [Save Comment](#save-comment)
+      - [Request](#request-56)
+      - [Response](#response-56)
+      - [HTTP](#http-57)
+    + [Create Comment Like](#create-comment-like)
+      - [Request](#request-57)
+      - [Response](#response-57)
+      - [HTTP](#http-58)
   * [RSS / Atom feeds](#rss--atom-feeds)
     + [All](#all)
     + [Community](#community-1)
 - <code>Option<***SomeType***></code> designates an option which may be omitted in requests and not be present in responses. It will be of type ***SomeType***.
 - <code>Vec<***SomeType***></code> is a list which contains objects of type ***SomeType***.
 - `chrono::NaiveDateTime` is a timestamp string in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Timestamps will be UTC.
-- Other data types are listed [here](../server/src/db).
+- Other data types are listed [here](../src/db).
 
 ## Basic usage
 
@@ -204,6 +281,12 @@ Connect to <code>ws://***host***/api/v1/ws</code> to get started.
 
 If the ***`host`*** supports secure connections, you can use <code>wss://***host***/api/v1/ws</code>.
 
+To receive websocket messages, you must join a room / context. The three available are:
+
+- [UserJoin](#user-join). Receives replies, private messages, etc.
+- [PostJoin](#post-join). Receives new comments on a post.
+- [CommunityJoin](#community-join). Receives front page / community posts.
+
 #### Testing with Websocat
 
 [Websocat link](https://github.com/vi/websocat)
@@ -273,7 +356,8 @@ curl -i -H \
 
 These go wherever there is a `sort` field. The available sort types are:
 
-- `Hot` - the hottest posts/communities, depending on votes, views, comments and publish date
+- `Active` - the hottest posts/communities, depending on votes, and newest comment publish date.
+- `Hot` - the hottest posts/communities, depending on votes and publish date.
 - `New` - the newest posts/communities
 - `TopDay` - the most upvoted posts/communities of the current day.
 - `TopWeek` - the most upvoted posts/communities of the current week.
@@ -281,6 +365,10 @@ These go wherever there is a `sort` field. The available sort types are:
 - `TopYear` - the most upvoted posts/communities of the current year.
 - `TopAll` - the most upvoted posts/communities on the current instance.
 
+### Undoing actions
+
+Whenever you see a `deleted: bool`, `removed: bool`, `read: bool`, `locked: bool`, etc, you can undo this action by sending `false`.
+
 ### Websocket vs HTTP
 
 - Below are the websocket JSON requests / responses. For HTTP, ignore all fields except those inside `data`.
@@ -329,7 +417,9 @@ Only the first user will be able to be the admin.
     email: Option<String>,
     password: String,
     password_verify: String,
-    admin: bool
+    admin: bool,
+    captcha_uuid: Option<String>, // Only checked if these are enabled in the server
+    captcha_answer: Option<String>,
   }
 }
 ```
@@ -347,6 +437,34 @@ Only the first user will be able to be the admin.
 
 `POST /user/register`
 
+#### Get Captcha
+
+These expire after 10 minutes.
+
+##### Request
+```rust
+{
+  op: "GetCaptcha",
+}
+```
+##### Response
+```rust
+{
+  op: "GetCaptcha",
+  data: {
+    ok?: { // Will be undefined if captchas are disabled
+      png: String, // A Base64 encoded png
+      wav: Option<String>, // A Base64 encoded wav audio file
+      uuid: String,
+    }
+  }
+}
+```
+
+##### HTTP
+
+`GET /user/get_captcha`
+
 #### Get User Details
 ##### Request
 ```rust
@@ -391,7 +509,19 @@ Only the first user will be able to be the admin.
     theme: String, // Default 'darkly'
     default_sort_type: i16, // The Sort types from above, zero indexed as a number
     default_listing_type: i16, // Post listing types are `All, Subscribed, Community`
-    auth: String
+    lang: String,
+    avatar: Option<String>,
+    banner: Option<String>,
+    preferred_username: Option<String>,
+    email: Option<String>,
+    bio: Option<String>,
+    matrix_user_id: Option<String>,
+    new_password: Option<String>,
+    new_password_verify: Option<String>,
+    old_password: Option<String>,
+    show_avatars: bool,
+    send_notifications_to_email: bool,
+    auth: String,
   }
 }
 ```
@@ -406,7 +536,7 @@ Only the first user will be able to be the admin.
 ```
 ##### HTTP
 
-`PUT /save_user_settings`
+`PUT /user/save_user_settings`
 
 #### Get Replies / Inbox
 ##### Request
@@ -462,16 +592,19 @@ Only the first user will be able to be the admin.
 
 ##### HTTP
 
-`GET /user/mentions`
+`GET /user/mention`
+
+#### Mark User Mention as read
+
+Only the recipient can do this.
 
-#### Edit User Mention
 ##### Request
 ```rust
 {
-  op: "EditUserMention",
+  op: "MarkUserMentionAsRead",
   data: {
     user_mention_id: i32,
-    read: Option<bool>,
+    read: bool,
     auth: String,
   }
 }
@@ -479,7 +612,7 @@ Only the first user will be able to be the admin.
 ##### Response
 ```rust
 {
-  op: "EditUserMention",
+  op: "MarkUserMentionAsRead",
   data: {
     mention: UserMentionView,
   }
@@ -487,7 +620,141 @@ Only the first user will be able to be the admin.
 ```
 ##### HTTP
 
-`PUT /user/mention`
+`POST /user/mention/mark_as_read`
+
+#### Get Private Messages
+##### Request
+```rust
+{
+  op: "GetPrivateMessages",
+  data: {
+    unread_only: bool,
+    page: Option<i64>,
+    limit: Option<i64>,
+    auth: String,
+  }
+}
+```
+##### Response
+```rust
+{
+  op: "GetPrivateMessages",
+  data: {
+    messages: Vec<PrivateMessageView>,
+  }
+}
+```
+
+##### HTTP
+
+`GET /private_message/list`
+
+#### Create Private Message
+##### Request
+```rust
+{
+  op: "CreatePrivateMessage",
+  data: {
+    content: String,
+    recipient_id: i32,
+    auth: String,
+  }
+}
+```
+##### Response
+```rust
+{
+  op: "CreatePrivateMessage",
+  data: {
+    message: PrivateMessageView,
+  }
+}
+```
+
+##### HTTP
+
+`POST /private_message`
+
+#### Edit Private Message
+##### Request
+```rust
+{
+  op: "EditPrivateMessage",
+  data: {
+    edit_id: i32,
+    content: String,
+    auth: String,
+  }
+}
+```
+##### Response
+```rust
+{
+  op: "EditPrivateMessage",
+  data: {
+    message: PrivateMessageView,
+  }
+}
+```
+
+##### HTTP
+
+`PUT /private_message`
+
+#### Delete Private Message
+##### Request
+```rust
+{
+  op: "DeletePrivateMessage",
+  data: {
+    edit_id: i32,
+    deleted: bool,
+    auth: String,
+  }
+}
+```
+##### Response
+```rust
+{
+  op: "DeletePrivateMessage",
+  data: {
+    message: PrivateMessageView,
+  }
+}
+```
+
+##### HTTP
+
+`POST /private_message/delete`
+
+#### Mark Private Message as Read
+
+Only the recipient can do this.
+
+##### Request
+```rust
+{
+  op: "MarkPrivateMessageAsRead",
+  data: {
+    edit_id: i32,
+    read: bool,
+    auth: String,
+  }
+}
+```
+##### Response
+```rust
+{
+  op: "MarkPrivateMessageAsRead",
+  data: {
+    message: PrivateMessageView,
+  }
+}
+```
+
+##### HTTP
+
+`POST /private_message/mark_as_read`
 
 #### Mark All As Read
 
@@ -518,7 +785,7 @@ Marks all user replies and mentions as read.
 
 #### Delete Account
 
-*Permananently deletes your posts and comments*
+*Permanently deletes your posts and comments*
 
 ##### Request
 ```rust
@@ -577,6 +844,7 @@ Marks all user replies and mentions as read.
   data: {
     user_id: i32,
     ban: bool,
+    remove_data: Option<bool>, // Removes/Restores their comments, posts, and communities
     reason: Option<String>,
     expires: Option<i64>,
     auth: String
@@ -597,6 +865,29 @@ Marks all user replies and mentions as read.
 
 `POST /user/ban`
 
+#### User Join
+##### Request
+```rust
+{
+  op: "UserJoin",
+  data: {
+    auth: String
+  }
+}
+```
+##### Response
+```rust
+{
+  op: "UserJoin",
+  data: {
+    joined: bool,
+  }
+}
+```
+##### HTTP
+
+`POST /user/join`
+
 ### Site
 #### List Categories
 ##### Request
@@ -652,7 +943,7 @@ Search types are `All, Comments, Posts, Communities, Users, Url`
 ```
 ##### HTTP
 
-`POST /search`
+`GET /search`
 
 #### Get Modlog
 ##### Request
@@ -696,6 +987,8 @@ Search types are `All, Comments, Posts, Communities, Users, Url`
   data: {
     name: String,
     description: Option<String>,
+    icon: Option<String>,
+    banner: Option<String>,
     auth: String
   }
 }
@@ -722,6 +1015,8 @@ Search types are `All, Comments, Posts, Communities, Users, Url`
   data: {
     name: String,
     description: Option<String>,
+    icon: Option<String>,
+    banner: Option<String>,
     auth: String
   }
 }
@@ -744,6 +1039,10 @@ Search types are `All, Comments, Posts, Communities, Users, Url`
 ```rust
 {
   op: "GetSite"
+  data: {
+    auth: Option<String>,
+  }
+
 }
 ```
 ##### Response
@@ -754,6 +1053,9 @@ Search types are `All, Comments, Posts, Communities, Users, Url`
     site: Option<SiteView>,
     admins: Vec<UserView>,
     banned: Vec<UserView>,
+    online: usize, // This is currently broken
+    version: String,
+    my_user: Option<User_>, // Gives back your user and settings if logged in
   }
 }
 ```
@@ -854,7 +1156,6 @@ Search types are `All, Comments, Posts, Communities, Users, Url`
   data: {
     community: CommunityView,
     moderators: Vec<CommunityModeratorView>,
-    admins: Vec<UserView>,
   }
 }
 ```
@@ -871,6 +1172,8 @@ Search types are `All, Comments, Posts, Communities, Users, Url`
     name: String,
     title: String,
     description: Option<String>,
+    icon: Option<String>,
+    banner: Option<String>,
     category_id: i32 ,
     auth: String
   }
@@ -924,6 +1227,7 @@ Search types are `All, Comments, Posts, Communities, Users, Url`
     community_id: i32,
     user_id: i32,
     ban: bool,
+    remove_data: Option<bool>, // Removes/Restores their comments and posts for that community
     reason: Option<String>,
     expires: Option<i64>,
     auth: String
@@ -971,7 +1275,7 @@ Search types are `All, Comments, Posts, Communities, Users, Url`
 `POST /community/mod`
 
 #### Edit Community
-Mods and admins can remove and lock a community, creators can delete it.
+Only mods can edit a community.
 
 ##### Request
 ```rust
@@ -979,14 +1283,11 @@ Mods and admins can remove and lock a community, creators can delete it.
   op: "EditCommunity",
   data: {
     edit_id: i32,
-    name: String,
     title: String,
     description: Option<String>,
+    icon: Option<String>,
+    banner: Option<String>,
     category_id: i32,
-    removed: Option<bool>,
-    deleted: Option<bool>,
-    reason: Option<String>,
-    expires: Option<i64>,
     auth: String
   }
 }
@@ -1004,22 +1305,24 @@ Mods and admins can remove and lock a community, creators can delete it.
 
 `PUT /community`
 
-#### Follow Community
+#### Delete Community
+Only a creator can delete a community
+
 ##### Request
 ```rust
 {
-  op: "FollowCommunity",
+  op: "DeleteCommunity",
   data: {
-    community_id: i32,
-    follow: bool,
-    auth: String
+    edit_id: i32,
+    deleted: bool,
+    auth: String,
   }
 }
 ```
 ##### Response
 ```rust
 {
-  op: "FollowCommunity",
+  op: "DeleteCommunity",
   data: {
     community: CommunityView
   }
@@ -1027,15 +1330,69 @@ Mods and admins can remove and lock a community, creators can delete it.
 ```
 ##### HTTP
 
-`POST /community/follow`
+`POST /community/delete`
+
+#### Remove Community
+Only admins can remove a community.
 
-#### Get Followed Communities
 ##### Request
 ```rust
 {
-  op: "GetFollowedCommunities",
+  op: "RemoveCommunity",
   data: {
-    auth: String
+    edit_id: i32,
+    removed: bool,
+    reason: Option<String>,
+    expires: Option<i64>,
+    auth: String,
+  }
+}
+```
+##### Response
+```rust
+{
+  op: "RemoveCommunity",
+  data: {
+    community: CommunityView
+  }
+}
+```
+##### HTTP
+
+`POST /community/remove`
+
+#### Follow Community
+##### Request
+```rust
+{
+  op: "FollowCommunity",
+  data: {
+    community_id: i32,
+    follow: bool,
+    auth: String
+  }
+}
+```
+##### Response
+```rust
+{
+  op: "FollowCommunity",
+  data: {
+    community: CommunityView
+  }
+}
+```
+##### HTTP
+
+`POST /community/follow`
+
+#### Get Followed Communities
+##### Request
+```rust
+{
+  op: "GetFollowedCommunities",
+  data: {
+    auth: String
   }
 }
 ```
@@ -1079,6 +1436,32 @@ Mods and admins can remove and lock a community, creators can delete it.
 
 `POST /community/transfer`
 
+#### Community Join
+
+The main / frontpage community is `community_id: 0`.
+
+##### Request
+```rust
+{
+  op: "CommunityJoin",
+  data: {
+    community_id: i32
+  }
+}
+```
+##### Response
+```rust
+{
+  op: "CommunityJoin",
+  data: {
+    joined: bool,
+  }
+}
+```
+##### HTTP
+
+`POST /community/join`
+
 ### Post
 #### Create Post
 ##### Request
@@ -1089,8 +1472,9 @@ Mods and admins can remove and lock a community, creators can delete it.
     name: String,
     url: Option<String>,
     body: Option<String>,
+    nsfw: bool,
     community_id: i32,
-    auth: String
+    auth: String,
   }
 }
 ```
@@ -1127,7 +1511,6 @@ Mods and admins can remove and lock a community, creators can delete it.
     comments: Vec<CommentView>,
     community: CommunityView,
     moderators: Vec<CommunityModeratorView>,
-    admins: Vec<UserView>,
   }
 }
 ```
@@ -1149,6 +1532,7 @@ Post listing types are `All, Subscribed, Community`
     page: Option<i64>,
     limit: Option<i64>,
     community_id: Option<i32>,
+    community_name: Option<String>,
     auth: Option<String>
   }
 }
@@ -1195,25 +1579,17 @@ Post listing types are `All, Subscribed, Community`
 `POST /post/like`
 
 #### Edit Post
-
-Mods and admins can remove and lock a post, creators can delete it.
-
 ##### Request
 ```rust
 {
   op: "EditPost",
   data: {
     edit_id: i32,
-    creator_id: i32,
-    community_id: i32,
     name: String,
     url: Option<String>,
     body: Option<String>,
-    removed: Option<bool>,
-    deleted: Option<bool>,
-    locked: Option<bool>,
-    reason: Option<String>,
-    auth: String
+    nsfw: bool,
+    auth: String,
   }
 }
 ```
@@ -1231,6 +1607,120 @@ Mods and admins can remove and lock a post, creators can delete it.
 
 `PUT /post`
 
+#### Delete Post
+##### Request
+```rust
+{
+  op: "DeletePost",
+  data: {
+    edit_id: i32,
+    deleted: bool,
+    auth: String,
+  }
+}
+```
+##### Response
+```rust
+{
+  op: "DeletePost",
+  data: {
+    post: PostView
+  }
+}
+```
+
+##### HTTP
+
+`POST /post/delete`
+
+#### Remove Post
+
+Only admins and mods can remove a post.
+
+##### Request
+```rust
+{
+  op: "RemovePost",
+  data: {
+    edit_id: i32,
+    removed: bool,
+    reason: Option<String>,
+    auth: String,
+  }
+}
+```
+##### Response
+```rust
+{
+  op: "RemovePost",
+  data: {
+    post: PostView
+  }
+}
+```
+
+##### HTTP
+
+`POST /post/remove`
+
+#### Lock Post
+
+Only admins and mods can lock a post.
+
+##### Request
+```rust
+{
+  op: "LockPost",
+  data: {
+    edit_id: i32,
+    locked: bool,
+    auth: String,
+  }
+}
+```
+##### Response
+```rust
+{
+  op: "LockPost",
+  data: {
+    post: PostView
+  }
+}
+```
+
+##### HTTP
+
+`POST /post/lock`
+
+#### Sticky Post
+
+Only admins and mods can sticky a post.
+
+##### Request
+```rust
+{
+  op: "StickyPost",
+  data: {
+    edit_id: i32,
+    stickied: bool,
+    auth: String,
+  }
+}
+```
+##### Response
+```rust
+{
+  op: "StickyPost",
+  data: {
+    post: PostView
+  }
+}
+```
+
+##### HTTP
+
+`POST /post/sticky`
+
 #### Save Post
 ##### Request
 ```rust
@@ -1256,6 +1746,29 @@ Mods and admins can remove and lock a post, creators can delete it.
 
 `POST /post/save`
 
+#### Post Join
+##### Request
+```rust
+{
+  op: "PostJoin",
+  data: {
+    post_id: i32
+  }
+}
+```
+##### Response
+```rust
+{
+  op: "PostJoin",
+  data: {
+    joined: bool,
+  }
+}
+```
+##### HTTP
+
+`POST /post/join`
+
 ### Comment
 #### Create Comment
 ##### Request
@@ -1265,8 +1778,8 @@ Mods and admins can remove and lock a post, creators can delete it.
   data: {
     content: String,
     parent_id: Option<i32>,
-    edit_id: Option<i32>,
     post_id: i32,
+    form_id: Option<String>, // An optional form id, so you know which message came back
     auth: String
   }
 }
@@ -1287,7 +1800,7 @@ Mods and admins can remove and lock a post, creators can delete it.
 
 #### Edit Comment
 
-Mods and admins can remove a comment, creators can delete it.
+Only the creator can edit the comment.
 
 ##### Request
 ```rust
@@ -1295,15 +1808,9 @@ Mods and admins can remove a comment, creators can delete it.
   op: "EditComment",
   data: {
     content: String,
-    parent_id: Option<i32>,
     edit_id: i32,
-    creator_id: i32,
-    post_id: i32,
-    removed: Option<bool>,
-    deleted: Option<bool>,
-    reason: Option<String>,
-    read: Option<bool>,
-    auth: String
+    form_id: Option<String>,
+    auth: String,
   }
 }
 ```
@@ -1320,6 +1827,124 @@ Mods and admins can remove a comment, creators can delete it.
 
 `PUT /comment`
 
+#### Delete Comment
+
+Only the creator can delete the comment.
+
+##### Request
+```rust
+{
+  op: "DeleteComment",
+  data: {
+    edit_id: i32,
+    deleted: bool,
+    auth: String,
+  }
+}
+```
+##### Response
+```rust
+{
+  op: "DeleteComment",
+  data: {
+    comment: CommentView
+  }
+}
+```
+##### HTTP
+
+`POST /comment/delete`
+
+
+#### Remove Comment
+
+Only a mod or admin can remove the comment.
+
+##### Request
+```rust
+{
+  op: "RemoveComment",
+  data: {
+    edit_id: i32,
+    removed: bool,
+    reason: Option<String>,
+    auth: String,
+  }
+}
+```
+##### Response
+```rust
+{
+  op: "RemoveComment",
+  data: {
+    comment: CommentView
+  }
+}
+```
+##### HTTP
+
+`POST /comment/remove`
+
+#### Get Comments
+
+Comment listing types are `All, Subscribed, Community`
+
+##### Request
+```rust
+{
+  op: "GetComments",
+  data: {
+    type_: String,
+    sort: String,
+    page: Option<i64>,
+    limit: Option<i64>,
+    community_id: Option<i32>,
+    community_name: Option<String>,
+    auth: Option<String>
+  }
+}
+```
+##### Response
+```rust
+{
+  op: "GetComments",
+  data: {
+    comments: Vec<CommentView>,
+  }
+}
+```
+##### HTTP
+
+`GET /comment/list`
+
+#### Mark Comment as Read
+
+Only the recipient can do this.
+
+##### Request
+```rust
+{
+  op: "MarkCommentAsRead",
+  data: {
+    edit_id: i32,
+    read: bool,
+    auth: String,
+  }
+}
+```
+##### Response
+```rust
+{
+  op: "MarkCommentAsRead",
+  data: {
+    comment: CommentView
+  }
+}
+```
+##### HTTP
+
+`POST /comment/mark_as_read`
+
 #### Save Comment
 ##### Request
 ```rust
@@ -1343,7 +1968,7 @@ Mods and admins can remove a comment, creators can delete it.
 ```
 ##### HTTP
 
-`POST /comment/save`
+`PUT /comment/save`
 
 #### Create Comment Like
 
@@ -1355,7 +1980,6 @@ Mods and admins can remove a comment, creators can delete it.
   op: "CreateCommentLike",
   data: {
     comment_id: i32,
-    post_id: i32,
     score: i16,
     auth: String
   }