To create or get an existing Chat for a certain recipient (identified by Account ID)
you can call:
-`POST /api/v1/pleroma/chats/by-account-id/{account_id}`
+`POST /api/v1/pleroma/chats/by-account-id/:account_id`
The account id is the normal FlakeId of the user
```
### Marking a chat as read
-To set the `unread` count of a chat to 0, call
+To mark a number of messages in a chat up to a certain message as read, you can use
`POST /api/v1/pleroma/chats/:id/read`
+
+Parameters:
+- last_read_id: Given this id, all chat messages until this one will be marked as read. Required.
+
+
Returned data:
```json
```
The recipient of messages that are sent to this chat is given by their AP ID.
-The usual pagination options are implemented.
+No pagination is implemented for now.
### Getting the messages for a Chat
For a given Chat id, you can get the associated messages with
-`GET /api/v1/pleroma/chats/{id}/messages`
+`GET /api/v1/pleroma/chats/:id/messages`
This will return all messages, sorted by most recent to least recent. The usual
pagination options are implemented.
Posting a chat message for given Chat id works like this:
-`POST /api/v1/pleroma/chats/{id}/messages`
+`POST /api/v1/pleroma/chats/:id/messages`
Parameters:
- content: The text content of the message. Optional if media is attached.
Deleting a chat message for given Chat id works like this:
-`DELETE /api/v1/pleroma/chats/{chat_id}/messages/{message_id}`
+`DELETE /api/v1/pleroma/chats/:chat_id/messages/:message_id`
Returned data is the deleted message.