You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

536 lines
50 KiB

  1. # Conversation API
  2. * API v1: 🏁 Removed with API v4: until Nextcloud 21
  3. * API v2: 🏁 Removed with API v4: Nextcloud 19 - 21
  4. * API v3: 🏁 Removed with API v4: Nextcloud 21 only
  5. * API v4: Base endpoint `/ocs/v2.php/apps/spreed/api/v4`: since Nextcloud 22
  6. ## Get user´s conversations
  7. !!! note
  8. Due to the structure of the `lastMessage.reactions` array the response is not valid in XML.
  9. It is therefor recommended to use `format=json` or send the `Accept: application/json` header,
  10. to receive a JSON response.
  11. !!! note
  12. When `modifiedSince` is provided only conversations with a newer `lastActivity` are returned. If `includeStatus` is set to `true` all one-to-one conversations will be returned to make sure the latest user status is returned.
  13. Due to the nature of the data structure we can not return information that a conversation was deleted
  14. or the user removed from a conversation. Therefore it is recommended to do a full refresh:
  15. * Every 5 minutes
  16. * When a signaling message of type `delete` or `disinvite` was received
  17. * Internal signaling mode is used
  18. * Method: `GET`
  19. * Endpoint: `/room`
  20. * Data:
  21. | field | type | Description |
  22. |------------------|------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  23. | `noStatusUpdate` | int | When the user status should not be automatically set to online set to 1 (default 0) |
  24. | `includeStatus` | bool | Whether the user status information of all one-to-one conversations should be loaded (default false) |
  25. | `modifiedSince` | int | **Use with care as per note above.** When provided only conversations with a newer `lastActivity` (and one-to-one conversations when `includeStatus` is provided) are returned. |
  26. * Response:
  27. - Status code:
  28. + `200 OK`
  29. + `401 Unauthorized` when the user is not logged in
  30. - Header:
  31. | field | type | Description |
  32. |---------------------------------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  33. | `X-Nextcloud-Talk-Hash` | string | Sha1 value over some config. When you receive a different value on subsequent requests, the capabilities and the signaling settings should be refreshed. |
  34. | `X-Nextcloud-Talk-Modified-Before` | string | Timestamp from before the database request that can be used as `modifiedSince` parameter in the next request |
  35. | `X-Nextcloud-Talk-Federation-Invites` | string | *Optional:* Number of pending invites to federated conversations the user has. (Only available when the user can do federation and has at least one invite pending) |
  36. - Data:
  37. Array of conversations, each conversation has at least:
  38. | field | type | Added | Removed | Description |
  39. |-------------------------|---------|-------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  40. | `id` | int | v1 | | Numeric identifier of the conversation |
  41. | `token` | string | v1 | | Token identifier of the conversation which is used for further interaction |
  42. | `type` | int | v1 | | See list of conversation types in the [constants list](constants.md#conversation-types) |
  43. | `name` | string | v1 | | Name of the conversation (can also be empty) |
  44. | `displayName` | string | v1 | | `name` if non empty, otherwise it falls back to a list of participants |
  45. | `description` | string | v3 | | Description of the conversation (can also be empty) (only available with `room-description` capability) |
  46. | `participantType` | int | v1 | | Permissions level of the current user |
  47. | `attendeeId` | int | v3 | | Unique attendee id |
  48. | `attendeePin` | string | v3 | | Unique dial-in authentication code for this user, when the conversation has SIP enabled (see `sipEnabled` attribute) |
  49. | `actorType` | string | v3 | | Actor type of the current user (see [constants list](constants.md#attendee-types)) |
  50. | `actorId` | string | v3 | | The unique identifier for the given actor type |
  51. | `permissions` | int | v4 | | Combined final permissions for the current participant, permissions are picked in order of attendee then call then default and the first which is `Custom` will apply (see [constants list](constants.md#attendee-permissions)) |
  52. | `attendeePermissions` | int | v4 | | Dedicated permissions for the current participant, if not `Custom` this are not the resulting permissions (see [constants list](constants.md#attendee-permissions)) |
  53. | `callPermissions` | int | v4 | | Call permissions, if not `Custom` this are not the resulting permissions, if set they will reset after the end of the call (see [constants list](constants.md#attendee-permissions)) |
  54. | `defaultPermissions` | int | v4 | | Default permissions for new participants (see [constants list](constants.md#attendee-permissions)) |
  55. | `participantInCall` | bool | v1 | v2 | **Removed:** use `participantFlags` instead |
  56. | `participantFlags` | int | v1 | | "In call" flags of the user's session making the request (only available with `in-call-flags` capability) |
  57. | `readOnly` | int | v1 | | Read-only state for the current user (only available with `read-only-rooms` capability) |
  58. | `listable` | int | v3 | | Listable scope for the room (only available with `listable-rooms` capability) |
  59. | `messageExpiration` | int | v4 | | The message expiration time in seconds in this chat. Zero if disabled. (only available with `message-expiration` capability) |
  60. | `count` | int | v1 | v2 | **Removed:** Count the users on the [Get list of participants in a conversation](participant.md#get-list-of-participants-in-a-conversation) endpoint |
  61. | `numGuests` | int | v1 | v2 | **Removed:** Count the guests on the [Get list of participants in a conversation](participant.md#get-list-of-participants-in-a-conversation) endpoin |
  62. | `lastPing` | int | v1 | | Timestamp of the user's session making the request |
  63. | `sessionId` | string | v1 | | `'0'` if not connected, otherwise an up to 512 character long string that is the identifier of the user's session making the request. Should only be used to pre-check if the user joined already with this session, but this might be outdated by the time of usage, so better check via [Get list of participants in a conversation](participant.md#get-list-of-participants-in-a-conversation) |
  64. | `hasPassword` | bool | v1 | | Flag if the conversation has a password |
  65. | `hasCall` | bool | v1 | | Flag if the conversation has an active call |
  66. | `callFlag` | int | v3 | | Combined flag of all participants in the current call (see [constants list](constants.md#participant-in-call-flag), only available with `conversation-call-flags` capability) |
  67. | `canStartCall` | bool | v1 | | Flag if the user can start a new call in this conversation (joining is always possible) (only available with `start-call-flag` capability) |
  68. | `canDeleteConversation` | bool | v2 | | Flag if the user can delete the conversation for everyone (not possible without moderator permissions or in one-to-one conversations) |
  69. | `canLeaveConversation` | bool | v2 | | Flag if the user can leave the conversation (not possible for the last user with moderator permissions) |
  70. | `lastActivity` | int | v1 | | Timestamp of the last activity in the conversation, in seconds and UTC time zone |
  71. | `isFavorite` | bool | v1 | | Flag if the conversation is favorited by the user |
  72. | `notificationLevel` | int | v1 | | The notification level for the user (See [Participant notification levels](constants.md#participant-notification-levels)) |
  73. | `lobbyState` | int | v1 | | Webinar lobby restriction (0-1), if the participant is a moderator they can always join the conversation (only available with `webinary-lobby` capability) (See [Webinar lobby states](constants.md#webinar-lobby-states)) |
  74. | `lobbyTimer` | int | v1 | | Timestamp when the lobby will be automatically disabled (only available with `webinary-lobby` capability) |
  75. | `sipEnabled` | int | v3 | | SIP enable status (see [constants list](constants.md#sip-states)) |
  76. | `canEnableSIP` | int | v3 | | Whether the given user can enable SIP for this conversation. Note that when the token is not-numeric only, SIP can not be enabled even if the user is permitted and a moderator of the conversation |
  77. | `unreadMessages` | int | v1 | | Number of unread chat messages in the conversation (only available with `chat-v2` capability) |
  78. | `unreadMention` | bool | v1 | | Flag if the user was mentioned since their last visit |
  79. | `unreadMentionDirect` | bool | v4 | | Flag if the user was mentioned directly (ignoring @all mentions) since their last visit (only available with `direct-mention-flag` capability) |
  80. | `lastReadMessage` | int | v1 | | ID of the last read message in a room (only available with `chat-read-marker` capability) |
  81. | `lastCommonReadMessage` | int | v3 | | ID of the last message read by every user that has read privacy set to public in a room. When the user themself has it set to private the value is `0` (only available with `chat-read-status` capability) |
  82. | `lastMessage` | message | v1 | | Last message in a conversation if available, otherwise empty. **Note:** Even when given the message will not contain the `parent` or `reactionsSelf` attribute due to performance reasons |
  83. | `objectType` | string | v1 | | The type of object that the conversation is associated with (See [Object types](constants.md#object-types)) |
  84. | `objectId` | string | v1 | | See [Object types](constants.md#object-types) documentation for explanation |
  85. | `breakoutRoomMode` | string | v4 | | Breakout room configuration mode (see [constants list](constants.md#breakout-room-modes)) (only available with `breakout-rooms-v1` capability) |
  86. | `breakoutRoomStatus` | string | v4 | | Breakout room status (see [constants list](constants.md#breakout-room-status)) (only available with `breakout-rooms-v1` capability) |
  87. | `status` | string | v4 | | Optional: Only available for one-to-one conversations, when `includeStatus=true` is set and the user has a status |
  88. | `statusIcon` | ?string | v4 | | Optional: Only available for one-to-one conversations, when `includeStatus=true` is set and the user has a status, can still be null even with a status |
  89. | `statusMessage` | ?string | v4 | | Optional: Only available for one-to-one conversations, when `includeStatus=true` is set and the user has a status, can still be null even with a status |
  90. | `statusClearAt` | ?int | v4 | | Optional: Only available for one-to-one conversations, when `includeStatus=true` is set and the user has a status, can still be null even with a status |
  91. | `participants` | array | v1 | v2 | **Removed** |
  92. | `guestList` | string | v1 | v2 | **Removed** |
  93. | `avatarVersion` | string | v4 | | Version of conversation avatar used to easier expiration of the avatar in case a moderator updates it, since the avatar endpoint should be cached for 24 hours. (only available with `avatar` capability) |
  94. | `isCustomAvatar` | bool | v4 | | Flag if the conversation has a custom avatar (only available with `avatar` capability) |
  95. | `callStartTime` | int | v4 | | Timestamp when the call was started (only available with `recording-v1` capability) |
  96. | `callRecording` | int | v4 | | Type of call recording (see [Constants - Call recording status](constants.md#call-recording-status)) (only available with `recording-v1` capability) |
  97. | `recordingConsent` | int | v4 | | Whether recording consent is required before joining a call (Only 0 and 1 will be returned, see [constants list](constants.md#recording-consent-required)) (only available with `recording-consent` capability) |
  98. | `mentionPermissions` | int | v4 | | Whether all participants can mention using `@all` or only moderators (see [constants list](constants.md#mention-permissions)) (only available with `mention-permissions` capability) |
  99. | `isArchived` | bool | v4 | | Flag if the conversation is archived by the user (only available with `archived-conversations-v2` capability) | |
  100. ## Creating a new conversation
  101. *Note:* Creating a conversation as a child breakout room, will automatically set the lobby when breakout rooms are not started and will always overwrite the room type with the parent room type. Also, moderators of the parent conversation will be automatically added as moderators.
  102. * Method: `POST`
  103. * Endpoint: `/room`
  104. * Data:
  105. | field | type | Description |
  106. |--------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  107. | `roomType` | int | See [constants list](constants.md#conversation-types) |
  108. | `invite` | string | user id (`roomType = 1`), group id (`roomType = 2` - optional), circle id (`roomType = 2`, `source = 'circles'`], only available with `circles-support` capability)) |
  109. | `source` | string | The source for the invite, only supported on `roomType = 2` for `groups` and `circles` (only available with `circles-support` capability) |
  110. | `roomName` | string | Conversation name up to 255 characters (Not available for `roomType = 1`) |
  111. | `objectType` | string | Type of an object this room references, currently only allowed value is `room` to indicate the parent of a breakout room (See [Object types](constants.md#object-types)) |
  112. | `objectId` | string | Id of an object this room references, room token is used for the parent of a breakout room |
  113. | `password` | string | Password for the room (only available with `conversation-creation-password` capability) |
  114. * Response:
  115. - Status code:
  116. + `200 OK` When the "one to one" conversation already exists
  117. + `201 Created` When the conversation was created
  118. + `400 Bad Request` When an invalid conversation type was given
  119. + `400 Bad Request` When the conversation name is empty for `type = 3`
  120. + `400 Bad Request` When a password is required for a public room or when the password is invalid according to the password policy
  121. + `401 Unauthorized` When the user is not logged in
  122. + `404 Not Found` When the target to invite does not exist
  123. - Data: See array definition in `Get user´s conversations`
  124. ## Get single conversation (also for guests)
  125. * Method: `GET`
  126. * Endpoint: `/room/{token}`
  127. * Response:
  128. - Status code:
  129. + `200 OK`
  130. + `404 Not Found` When the conversation could not be found for the participant
  131. - Header:
  132. | field | type | Description |
  133. |-------------------------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
  134. | `X-Nextcloud-Talk-Hash` | string | Sha1 value over some config. When you receive a different value on subsequent requests, the capabilities and the signaling settings should be refreshed. |
  135. - Data: See array definition in `Get user´s conversations`
  136. ## Get "Note-to-self" conversation
  137. The conversation is like a group conversation and the user is the owner, but with the following limitations:
  138. * Can not add participants to the conversation
  139. * Can not allow guests
  140. * Can not make read-only
  141. * Can not open the conversations to users or guests
  142. * Can not change permissions
  143. * Can not set lobby
  144. * Can not enable SIP
  145. * Can not configure breakout rooms
  146. * Can not call
  147. If the conversation does not exist at the moment, it will be generated and the user added automatically.
  148. * Required capability: `note-to-self`
  149. * Method: `GET`
  150. * Endpoint: `/room/note-to-self`
  151. * Response:
  152. - Status code:
  153. + `200 OK`
  154. + `401 Unauthorized` When the user is not logged in
  155. - Header:
  156. | field | type | Description |
  157. |-------------------------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
  158. | `X-Nextcloud-Talk-Hash` | string | Sha1 value over some config. When you receive a different value on subsequent requests, the capabilities and the signaling settings should be refreshed. |
  159. - Data: See array definition in `Get user´s conversations`
  160. ## Get open conversations
  161. * Required capability: `listable-rooms`
  162. * Method: `GET`
  163. * Endpoint: `/listed-room`
  164. * Response:
  165. - Status code:
  166. + `200 OK`
  167. + `401 Unauthorized` when the user is not logged in
  168. - Header:
  169. | field | type | Description |
  170. |--------------|--------|-------------|
  171. | `searchTerm` | string | search term |
  172. - Data: See array definition in `Get user´s conversations`
  173. ## Get breakout rooms
  174. Get all (for moderators and in case of "free selection") or the assigned breakout room
  175. * Required capability: `breakout-rooms-v1`
  176. * Method: `GET`
  177. * Endpoint: `/room/{token}/breakout-rooms`
  178. * Response:
  179. - Status code:
  180. + `200 OK`
  181. + `400 Bad Request` When the conversation does not have breakout rooms configured
  182. + `400 Bad Request` When the breakout rooms are not started and the participant is not a moderator
  183. + `401 Unauthorized` When the user is not logged in
  184. + `404 Not Found` When the conversation could not be found for the participant
  185. - Data: See array definition in `Get user´s conversations`
  186. ## Rename a conversation
  187. * Method: `PUT`
  188. * Endpoint: `/room/{token}`
  189. * Data:
  190. | field | type | Description |
  191. |------------|--------|------------------------------------------------------|
  192. | `roomName` | string | New name for the conversation (up to 255 characters) |
  193. * Response:
  194. - Status code:
  195. + `200 OK`
  196. + `400 Bad Request` When the name is too long or empty
  197. + `400 Bad Request` When the conversation is a one to one conversation
  198. + `403 Forbidden` When the current user is not a moderator/owner
  199. + `404 Not Found` When the conversation could not be found for the participant
  200. ## Delete a conversation
  201. *Note:* Deleting a conversation that is the parent of breakout rooms, will also delete them.
  202. * Method: `DELETE`
  203. * Endpoint: `/room/{token}`
  204. * Response:
  205. - Status code:
  206. + `200 OK`
  207. + `400 Bad Request` When the conversation is a one-to-one conversation (Use [Remove yourself from a conversation](participant.md#Remove-yourself-from-a-conversation) instead)
  208. + `403 Forbidden` When the current user is not a moderator/owner
  209. + `404 Not Found` When the conversation could not be found for the participant
  210. ## Set description for a conversation
  211. * Required capability: `room-description`
  212. * Method: `PUT`
  213. * Endpoint: `/room/{token}/description`
  214. * Data:
  215. | field | type | Description |
  216. |---------------|--------|--------------------------------------------------------------------------------------------|
  217. | `description` | string | New description for the conversation (limited to 2.000 characters, was 500 before Talk 21) |
  218. * Response:
  219. - Status code:
  220. + `200 OK`
  221. + `400 Bad Request` When the description is too long
  222. + `400 Bad Request` When the conversation is a one to one conversation
  223. + `403 Forbidden` When the current user is not a moderator/owner
  224. + `404 Not Found` When the conversation could not be found for the participant
  225. ## Allow guests in a conversation (public conversation)
  226. * Method: `POST`
  227. * Endpoint: `/room/{token}/public`
  228. * Data:
  229. | field | type | Description |
  230. |------------|---------|-------------------------------------------------------------------------------------------------|
  231. | `password` | ?string | Password for the conversation (only available with `conversation-creation-password` capability) |
  232. * Response:
  233. - Status code:
  234. + `200 OK`
  235. + `400 Bad Request` When the conversation is not a group conversation
  236. + `403 Forbidden` When the current user is not a moderator/owner
  237. + `404 Not Found` When the conversation could not be found for the participant
  238. ## Disallow guests in a conversation (group conversation)
  239. * Method: `DELETE`
  240. * Endpoint: `/room/{token}/public`
  241. * Response:
  242. - Status code:
  243. + `200 OK`
  244. + `400 Bad Request` When the conversation is not a public conversation
  245. + `403 Forbidden` When the current user is not a moderator/owner
  246. + `404 Not Found` When the conversation could not be found for the participant
  247. ## Set read-only for a conversation
  248. * Required capability: `read-only-rooms`
  249. * Method: `PUT`
  250. * Endpoint: `/room/{token}/read-only`
  251. * Data:
  252. | field | type | Description |
  253. |---------|------|-------------------------------------------------------------------------------------|
  254. | `state` | int | New state for the conversation, see [constants list](constants.md#read-only-states) |
  255. * Response:
  256. - Status code:
  257. + `200 OK`
  258. + `400 Bad Request` When the conversation type does not support read-only (only group and public conversation)
  259. + `403 Forbidden` When the current user is not a moderator/owner or the conversation is not a public conversation
  260. + `404 Not Found` When the conversation could not be found for the participant
  261. ## Set password for a conversation
  262. * Method: `PUT`
  263. * Endpoint: `/room/{token}/password`
  264. * Data:
  265. | field | type | Description |
  266. |------------|--------|-----------------------------------|
  267. | `password` | string | New password for the conversation |
  268. * Response:
  269. - Status code:
  270. + `200 OK`
  271. + `400 Bad Request` When the password does not match the password policy. Show `ocs.data.message` to the user in this case
  272. + `400 Bad Request` When the conversation is a breakout room
  273. + `403 Forbidden` When the current user is not a moderator or owner
  274. + `403 Forbidden` When the conversation is not a public conversation
  275. + `404 Not Found` When the conversation could not be found for the participant
  276. - Data:
  277. field | type | Description
  278. ---|---|---
  279. `message` | string | Only available on `400 Bad Request`, translated error with the violated password policy rules
  280. ## Set default or call permissions for a conversation
  281. * Method: `PUT`
  282. * Endpoint: `/room/{token}/permissions/{mode}`
  283. * Data:
  284. | field | type | Description |
  285. |---------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  286. | `mode` | string | `default` or `call`, in case of call the permissions will be reset to `0` (default) after the end of a call. (🏁 `call` is no-op since Talk 20) |
  287. | `permissions` | int | New permissions for the attendees, see [constants list](constants.md#attendee-permissions). If permissions are not `0` (default), the `1` (custom) permission will always be added. Note that this will reset all custom permissions that have been given to attendees so far. |
  288. * Response:
  289. - Status code:
  290. + `200 OK`
  291. + `400 Bad Request` When the conversation type does not support setting publishing permissions, e.g. one-to-one conversations
  292. + `400 Bad Request` When the mode is invalid
  293. + `400 Bad Request` When the conversation is a breakout room
  294. + `403 Forbidden` When the current user is not a moderator, owner or guest moderator
  295. + `404 Not Found` When the conversation could not be found for the participant
  296. ## Add conversation to favorites
  297. * Required capability: `favorites`
  298. * Federation capability: `federation-v1`
  299. * Method: `POST`
  300. * Endpoint: `/room/{token}/favorite`
  301. * Response:
  302. - Status code:
  303. + `200 OK`
  304. + `401 Unauthorized` When the participant is a guest
  305. + `404 Not Found` When the conversation could not be found for the participant
  306. ## Remove conversation from favorites
  307. * Required capability: `favorites`
  308. * Federation capability: `federation-v1`
  309. * Method: `DELETE`
  310. * Endpoint: `/room/{token}/favorite`
  311. * Response:
  312. - Status code:
  313. + `200 OK`
  314. + `401 Unauthorized` When the participant is a guest
  315. + `404 Not Found` When the conversation could not be found for the participant
  316. ## Set notification level
  317. * Required capability: `notification-levels`
  318. * Federation capability: `federation-v1`
  319. * Method: `POST`
  320. * Endpoint: `/room/{token}/notify`
  321. * Data:
  322. | field | type | Description |
  323. |---------|------|--------------------------------------------------------------------------------------------------------------|
  324. | `level` | int | The notification level (See [Participant notification levels](constants.md#participant-notification-levels)) |
  325. * Response:
  326. - Status code:
  327. + `200 OK`
  328. + `400 Bad Request` When the given level is invalid
  329. + `401 Unauthorized` When the participant is a guest
  330. + `404 Not Found` When the conversation could not be found for the participant
  331. ## Set notification level for calls
  332. * Required capability: `notification-calls`
  333. * Method: `POST`
  334. * Endpoint: `/room/{token}/notify-calls`
  335. * Data:
  336. | field | type | Description |
  337. |---------|------|-----------------------------------------------------------------------------------------------------------------------------|
  338. | `level` | int | The call notification level (See [Participant call notification levels](constants.md#participant-call-notification-levels)) |
  339. * Response:
  340. - Status code:
  341. + `200 OK`
  342. + `400 Bad Request` When the given level is invalid
  343. + `401 Unauthorized` When the participant is a guest
  344. + `404 Not Found` When the conversation could not be found for the participant
  345. ## Set message expiration
  346. * Required capability: `message-expiration`
  347. * Method: `POST`
  348. * Endpoint: `/room/{token}/message-expiration`
  349. * Data:
  350. | field | type | Description |
  351. |-----------|------|---------------------------------------------------------------------------------------------|
  352. | `seconds` | int | The messages expiration in seconds. If is zero, messages will not be deleted automatically. |
  353. * Response:
  354. - Status code:
  355. + `200 OK`
  356. + `400 Bad Request` Invalid value
  357. + `400 Bad Request` When the conversation is a breakout room
  358. + `403 Forbidden` When the current user is not a moderator, owner or guest moderator
  359. + `404 Not Found` When the conversation could not be found for the participant
  360. ## Set recording consent
  361. * Required capability: `recording-consent`
  362. * Method: `PUT`
  363. * Endpoint: `/room/{token}/recording-consent`
  364. * Data:
  365. | field | type | Description |
  366. |--------------------|------|---------------------------------------------------------------------------------------------------------------------------------------------|
  367. | `recordingConsent` | int | New consent setting for the conversation (Only `0` and `1` from the [constants](constants.md#recording-consent-required) are allowed here.) |
  368. * Response:
  369. - Status code:
  370. + `200 OK`
  371. + `400 Bad Request` When the consent value is invalid
  372. + `400 Bad Request` When the consent is being enabled while a call is going on
  373. + `403 Forbidden` When the current user is not a moderator/owner
  374. + `404 Not Found` When the conversation could not be found for the participant
  375. ## Open a conversation
  376. * Required capability: `listable-rooms`
  377. * Method: `PUT`
  378. * Endpoint: `/room/{token}/listable`
  379. * Data:
  380. | field | type | Description |
  381. |---------|------|--------------------------------|
  382. | `scope` | int | The room listable scope (See [listable scopes](constants.md#listable-scope)) |
  383. * Response:
  384. - Status code:
  385. + `200 OK`
  386. + `400 Bad Request` When the conversation type does not support making it listable (only group and public conversation)
  387. + `400 Bad Request` When the conversation is a breakout room
  388. + `403 Forbidden` When the current user is not a moderator/owner or the conversation is not a public conversation
  389. + `404 Not Found` When the conversation could not be found for the participant
  390. ## Set mention permissions
  391. * Required capability: `mention-permissions`
  392. * Method: `PUT`
  393. * Endpoint: `/room/{token}/mention-permissions`
  394. * Data:
  395. | field | type | Description |
  396. |----------------------|------|-----------------------------------------------------------------------------------------------------------|
  397. | `mentionPermissions` | int | New mention permissions for the conversation (See [mention permssions](constants.md#mention-permissions)) |
  398. * Response:
  399. - Status code:
  400. + `200 OK`
  401. + `400 Bad Request` When the conversation type does not support setting mention permissions (only group and public conversation)
  402. + `400 Bad Request` When the conversation is a breakout room
  403. + `400 Bad Request` When permissions value is invalid
  404. + `403 Forbidden` When the current user is not a moderator/owner
  405. + `404 Not Found` When the conversation could not be found for the participant
  406. ## Get conversation capabilities
  407. See [Capability handling in federated conversations](https://github.com/nextcloud/spreed/issues/10680) to learn which capabilities
  408. should be considered from the local server or from the remote server.
  409. * Required capability: `federation-v1`
  410. * Method: `GET`
  411. * Endpoint: `/room/{token}/capabilities`
  412. * Response:
  413. - Status code:
  414. + `200 OK` Get capabilities
  415. + `404 Not Found` When the conversation could not be found for the participant
  416. - Header:
  417. | field | type | Description |
  418. |-------------------------------|--------|--------------------------------------------------------------------------------------------|
  419. | `X-Nextcloud-Talk-Proxy-Hash` | string | Sha1 value over the capabilities in case the conversation is hosted **on another server**. |
  420. | `X-Nextcloud-Talk-Hash` | string | Sha1 value over the capabilities in case the conversation is hosted **on this server**. |
  421. - Data: Server capabilities limited to the `spreed` sub-array or an empty array in case the app is disabled (for the user)