Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
[akkoma] / docs / API / chats.md
index 3ddc1354193226a85f593ebb233b70629af94905..ad36961aef3be69eb5aba6430816636e2fd26767 100644 (file)
@@ -43,12 +43,17 @@ you can call:
 
 `POST /api/v1/pleroma/chats/by-account-id/{account_id}`
 
-The account id is the normal FlakeId of the usre
-
+The account id is the normal FlakeId of the user
 ```
 POST /api/v1/pleroma/chats/by-account-id/someflakeid
 ```
 
+If you already have the id of a chat, you can also use
+
+```
+GET /api/v1/pleroma/chats/:id
+```
+
 There will only ever be ONE Chat for you and a given recipient, so this call
 will return the same Chat if you already have one with that user.
 
@@ -62,7 +67,8 @@ Returned data:
     ...
   },
   "id" : "1",
-  "unread" : 2
+  "unread" : 2,
+  "last_message" : {...} // The last message in that chat
 }
 ```
 
@@ -105,7 +111,8 @@ Returned data:
         ...
       },
       "id" : "1",
-      "unread" : 2
+      "unread" : 2,
+      "last_message" : {...} // The last message in that chat
    }
 ]
 ```
@@ -185,6 +192,14 @@ Returned data:
 }
 ```
 
+### Deleting a chat message
+
+Deleting a chat message for given Chat id works like this:
+
+`DELETE /api/v1/pleroma/chats/{chat_id}/messages/{message_id}`
+
+Returned data is the deleted message.
+
 ### Notifications
 
 There's a new `pleroma:chat_mention` notification, which has this form: