liveblocks 3.16.0a0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. liveblocks-3.16.0a0/PKG-INFO +2531 -0
  2. liveblocks-3.16.0a0/README.md +2521 -0
  3. liveblocks-3.16.0a0/liveblocks/__init__.py +12 -0
  4. liveblocks-3.16.0a0/liveblocks/api/__init__.py +1 -0
  5. liveblocks-3.16.0a0/liveblocks/api/ai/__init__.py +1 -0
  6. liveblocks-3.16.0a0/liveblocks/api/ai/create_ai_copilot.py +124 -0
  7. liveblocks-3.16.0a0/liveblocks/api/ai/create_file_knowledge_source.py +80 -0
  8. liveblocks-3.16.0a0/liveblocks/api/ai/create_web_knowledge_source.py +74 -0
  9. liveblocks-3.16.0a0/liveblocks/api/ai/delete_ai_copilot.py +58 -0
  10. liveblocks-3.16.0a0/liveblocks/api/ai/delete_file_knowledge_source.py +64 -0
  11. liveblocks-3.16.0a0/liveblocks/api/ai/delete_web_knowledge_source.py +64 -0
  12. liveblocks-3.16.0a0/liveblocks/api/ai/get_ai_copilot.py +100 -0
  13. liveblocks-3.16.0a0/liveblocks/api/ai/get_ai_copilots.py +74 -0
  14. liveblocks-3.16.0a0/liveblocks/api/ai/get_file_knowledge_source_markdown.py +67 -0
  15. liveblocks-3.16.0a0/liveblocks/api/ai/get_knowledge_source.py +84 -0
  16. liveblocks-3.16.0a0/liveblocks/api/ai/get_knowledge_sources.py +82 -0
  17. liveblocks-3.16.0a0/liveblocks/api/ai/get_web_knowledge_source_links.py +88 -0
  18. liveblocks-3.16.0a0/liveblocks/api/ai/update_ai_copilot.py +113 -0
  19. liveblocks-3.16.0a0/liveblocks/api/auth/__init__.py +1 -0
  20. liveblocks-3.16.0a0/liveblocks/api/auth/authorize_user.py +66 -0
  21. liveblocks-3.16.0a0/liveblocks/api/auth/identify_user.py +66 -0
  22. liveblocks-3.16.0a0/liveblocks/api/comments/__init__.py +1 -0
  23. liveblocks-3.16.0a0/liveblocks/api/comments/add_comment_reaction.py +86 -0
  24. liveblocks-3.16.0a0/liveblocks/api/comments/create_comment.py +80 -0
  25. liveblocks-3.16.0a0/liveblocks/api/comments/create_thread.py +74 -0
  26. liveblocks-3.16.0a0/liveblocks/api/comments/delete_comment.py +70 -0
  27. liveblocks-3.16.0a0/liveblocks/api/comments/delete_thread.py +64 -0
  28. liveblocks-3.16.0a0/liveblocks/api/comments/edit_comment.py +86 -0
  29. liveblocks-3.16.0a0/liveblocks/api/comments/edit_comment_metadata.py +86 -0
  30. liveblocks-3.16.0a0/liveblocks/api/comments/edit_thread_metadata.py +80 -0
  31. liveblocks-3.16.0a0/liveblocks/api/comments/get_comment.py +73 -0
  32. liveblocks-3.16.0a0/liveblocks/api/comments/get_thread.py +67 -0
  33. liveblocks-3.16.0a0/liveblocks/api/comments/get_thread_participants.py +0 -0
  34. liveblocks-3.16.0a0/liveblocks/api/comments/get_thread_subscriptions.py +67 -0
  35. liveblocks-3.16.0a0/liveblocks/api/comments/get_threads.py +75 -0
  36. liveblocks-3.16.0a0/liveblocks/api/comments/mark_thread_as_resolved.py +80 -0
  37. liveblocks-3.16.0a0/liveblocks/api/comments/mark_thread_as_unresolved.py +80 -0
  38. liveblocks-3.16.0a0/liveblocks/api/comments/remove_comment_reaction.py +85 -0
  39. liveblocks-3.16.0a0/liveblocks/api/comments/subscribe_to_thread.py +80 -0
  40. liveblocks-3.16.0a0/liveblocks/api/comments/unsubscribe_from_thread.py +77 -0
  41. liveblocks-3.16.0a0/liveblocks/api/groups/__init__.py +1 -0
  42. liveblocks-3.16.0a0/liveblocks/api/groups/add_group_members.py +74 -0
  43. liveblocks-3.16.0a0/liveblocks/api/groups/create_group.py +68 -0
  44. liveblocks-3.16.0a0/liveblocks/api/groups/delete_group.py +58 -0
  45. liveblocks-3.16.0a0/liveblocks/api/groups/get_group.py +61 -0
  46. liveblocks-3.16.0a0/liveblocks/api/groups/get_groups.py +74 -0
  47. liveblocks-3.16.0a0/liveblocks/api/groups/get_user_groups.py +82 -0
  48. liveblocks-3.16.0a0/liveblocks/api/groups/remove_group_members.py +74 -0
  49. liveblocks-3.16.0a0/liveblocks/api/management/__init__.py +1 -0
  50. liveblocks-3.16.0a0/liveblocks/api/management/activate_project_public_api_key.py +58 -0
  51. liveblocks-3.16.0a0/liveblocks/api/management/create_management_project.py +66 -0
  52. liveblocks-3.16.0a0/liveblocks/api/management/create_management_webhook.py +74 -0
  53. liveblocks-3.16.0a0/liveblocks/api/management/deactivate_project_public_api_key.py +58 -0
  54. liveblocks-3.16.0a0/liveblocks/api/management/delete_management_project.py +58 -0
  55. liveblocks-3.16.0a0/liveblocks/api/management/delete_management_webhook.py +64 -0
  56. liveblocks-3.16.0a0/liveblocks/api/management/delete_management_webhook_additional_headers.py +80 -0
  57. liveblocks-3.16.0a0/liveblocks/api/management/get_management_project.py +61 -0
  58. liveblocks-3.16.0a0/liveblocks/api/management/get_management_projects.py +74 -0
  59. liveblocks-3.16.0a0/liveblocks/api/management/get_management_webhook.py +67 -0
  60. liveblocks-3.16.0a0/liveblocks/api/management/get_management_webhook_additional_headers.py +67 -0
  61. liveblocks-3.16.0a0/liveblocks/api/management/get_management_webhooks.py +82 -0
  62. liveblocks-3.16.0a0/liveblocks/api/management/recover_failed_webhook_messages.py +79 -0
  63. liveblocks-3.16.0a0/liveblocks/api/management/roll_management_webhook_secret.py +67 -0
  64. liveblocks-3.16.0a0/liveblocks/api/management/roll_project_public_api_key.py +76 -0
  65. liveblocks-3.16.0a0/liveblocks/api/management/roll_project_secret_api_key.py +78 -0
  66. liveblocks-3.16.0a0/liveblocks/api/management/send_test_webhook.py +80 -0
  67. liveblocks-3.16.0a0/liveblocks/api/management/update_management_project.py +74 -0
  68. liveblocks-3.16.0a0/liveblocks/api/management/update_management_webhook.py +80 -0
  69. liveblocks-3.16.0a0/liveblocks/api/management/upsert_management_webhook_additional_headers.py +80 -0
  70. liveblocks-3.16.0a0/liveblocks/api/notifications/__init__.py +1 -0
  71. liveblocks-3.16.0a0/liveblocks/api/notifications/delete_all_inbox_notifications.py +58 -0
  72. liveblocks-3.16.0a0/liveblocks/api/notifications/delete_inbox_notification.py +64 -0
  73. liveblocks-3.16.0a0/liveblocks/api/notifications/delete_notification_settings.py +58 -0
  74. liveblocks-3.16.0a0/liveblocks/api/notifications/delete_room_notification_settings.py +0 -0
  75. liveblocks-3.16.0a0/liveblocks/api/notifications/delete_room_subscription_settings.py +64 -0
  76. liveblocks-3.16.0a0/liveblocks/api/notifications/get_inbox_notification.py +84 -0
  77. liveblocks-3.16.0a0/liveblocks/api/notifications/get_inbox_notifications.py +96 -0
  78. liveblocks-3.16.0a0/liveblocks/api/notifications/get_notification_settings.py +61 -0
  79. liveblocks-3.16.0a0/liveblocks/api/notifications/get_room_notification_settings.py +0 -0
  80. liveblocks-3.16.0a0/liveblocks/api/notifications/get_room_subscription_settings.py +67 -0
  81. liveblocks-3.16.0a0/liveblocks/api/notifications/get_user_room_subscription_settings.py +89 -0
  82. liveblocks-3.16.0a0/liveblocks/api/notifications/trigger_inbox_notification.py +65 -0
  83. liveblocks-3.16.0a0/liveblocks/api/notifications/update_notification_settings.py +74 -0
  84. liveblocks-3.16.0a0/liveblocks/api/notifications/update_room_notification_settings.py +0 -0
  85. liveblocks-3.16.0a0/liveblocks/api/notifications/update_room_subscription_settings.py +80 -0
  86. liveblocks-3.16.0a0/liveblocks/api/room/__init__.py +1 -0
  87. liveblocks-3.16.0a0/liveblocks/api/room/broadcast_event.py +70 -0
  88. liveblocks-3.16.0a0/liveblocks/api/room/create_room.py +79 -0
  89. liveblocks-3.16.0a0/liveblocks/api/room/delete_room.py +58 -0
  90. liveblocks-3.16.0a0/liveblocks/api/room/get_active_users.py +61 -0
  91. liveblocks-3.16.0a0/liveblocks/api/room/get_room.py +61 -0
  92. liveblocks-3.16.0a0/liveblocks/api/room/get_rooms.py +102 -0
  93. liveblocks-3.16.0a0/liveblocks/api/room/prewarm_room.py +58 -0
  94. liveblocks-3.16.0a0/liveblocks/api/room/set_presence.py +71 -0
  95. liveblocks-3.16.0a0/liveblocks/api/room/update_room.py +74 -0
  96. liveblocks-3.16.0a0/liveblocks/api/room/update_room_id.py +76 -0
  97. liveblocks-3.16.0a0/liveblocks/api/room/upsert_room.py +74 -0
  98. liveblocks-3.16.0a0/liveblocks/api/storage/__init__.py +1 -0
  99. liveblocks-3.16.0a0/liveblocks/api/storage/delete_storage_document.py +58 -0
  100. liveblocks-3.16.0a0/liveblocks/api/storage/get_storage_document.py +80 -0
  101. liveblocks-3.16.0a0/liveblocks/api/storage/initialize_storage_document.py +76 -0
  102. liveblocks-3.16.0a0/liveblocks/api/storage/patch_storage_document.py +125 -0
  103. liveblocks-3.16.0a0/liveblocks/api/yjs/__init__.py +1 -0
  104. liveblocks-3.16.0a0/liveblocks/api/yjs/create_yjs_version.py +61 -0
  105. liveblocks-3.16.0a0/liveblocks/api/yjs/get_yjs_document.py +94 -0
  106. liveblocks-3.16.0a0/liveblocks/api/yjs/get_yjs_document_as_binary_update.py +75 -0
  107. liveblocks-3.16.0a0/liveblocks/api/yjs/get_yjs_version.py +68 -0
  108. liveblocks-3.16.0a0/liveblocks/api/yjs/get_yjs_versions.py +82 -0
  109. liveblocks-3.16.0a0/liveblocks/api/yjs/send_yjs_binary_update.py +83 -0
  110. liveblocks-3.16.0a0/liveblocks/client.py +6822 -0
  111. liveblocks-3.16.0a0/liveblocks/errors.py +52 -0
  112. liveblocks-3.16.0a0/liveblocks/models/__init__.py +391 -0
  113. liveblocks-3.16.0a0/liveblocks/models/active_users_response.py +76 -0
  114. liveblocks-3.16.0a0/liveblocks/models/active_users_response_data_item.py +96 -0
  115. liveblocks-3.16.0a0/liveblocks/models/active_users_response_data_item_info.py +45 -0
  116. liveblocks-3.16.0a0/liveblocks/models/add_comment_reaction_request_body.py +68 -0
  117. liveblocks-3.16.0a0/liveblocks/models/add_group_members_request_body.py +62 -0
  118. liveblocks-3.16.0a0/liveblocks/models/add_json_patch_operation.py +58 -0
  119. liveblocks-3.16.0a0/liveblocks/models/ai_copilot_anthropic.py +192 -0
  120. liveblocks-3.16.0a0/liveblocks/models/ai_copilot_base.py +154 -0
  121. liveblocks-3.16.0a0/liveblocks/models/ai_copilot_google.py +192 -0
  122. liveblocks-3.16.0a0/liveblocks/models/ai_copilot_open_ai.py +173 -0
  123. liveblocks-3.16.0a0/liveblocks/models/ai_copilot_open_ai_compatible.py +189 -0
  124. liveblocks-3.16.0a0/liveblocks/models/ai_copilot_provider_settings.py +117 -0
  125. liveblocks-3.16.0a0/liveblocks/models/anthropic_model.py +13 -0
  126. liveblocks-3.16.0a0/liveblocks/models/anthropic_provider_options.py +48 -0
  127. liveblocks-3.16.0a0/liveblocks/models/anthropic_provider_options_anthropic.py +120 -0
  128. liveblocks-3.16.0a0/liveblocks/models/anthropic_provider_options_anthropic_anthropic_thinking_disabled.py +42 -0
  129. liveblocks-3.16.0a0/liveblocks/models/anthropic_provider_options_anthropic_anthropic_thinking_enabled.py +50 -0
  130. liveblocks-3.16.0a0/liveblocks/models/anthropic_provider_options_anthropic_anthropic_web_search.py +61 -0
  131. liveblocks-3.16.0a0/liveblocks/models/authorization.py +62 -0
  132. liveblocks-3.16.0a0/liveblocks/models/authorize_user_request_body.py +87 -0
  133. liveblocks-3.16.0a0/liveblocks/models/authorize_user_request_body_permissions.py +52 -0
  134. liveblocks-3.16.0a0/liveblocks/models/authorize_user_request_body_user_info.py +45 -0
  135. liveblocks-3.16.0a0/liveblocks/models/authorize_user_response.py +43 -0
  136. liveblocks-3.16.0a0/liveblocks/models/comment.py +206 -0
  137. liveblocks-3.16.0a0/liveblocks/models/comment_attachment.py +77 -0
  138. liveblocks-3.16.0a0/liveblocks/models/comment_body.py +65 -0
  139. liveblocks-3.16.0a0/liveblocks/models/comment_body_content_item.py +45 -0
  140. liveblocks-3.16.0a0/liveblocks/models/comment_metadata.py +59 -0
  141. liveblocks-3.16.0a0/liveblocks/models/comment_reaction.py +58 -0
  142. liveblocks-3.16.0a0/liveblocks/models/copy_json_patch_operation.py +58 -0
  143. liveblocks-3.16.0a0/liveblocks/models/create_ai_copilot_options_anthropic.py +167 -0
  144. liveblocks-3.16.0a0/liveblocks/models/create_ai_copilot_options_base.py +110 -0
  145. liveblocks-3.16.0a0/liveblocks/models/create_ai_copilot_options_google.py +167 -0
  146. liveblocks-3.16.0a0/liveblocks/models/create_ai_copilot_options_open_ai.py +147 -0
  147. liveblocks-3.16.0a0/liveblocks/models/create_ai_copilot_options_open_ai_compatible.py +164 -0
  148. liveblocks-3.16.0a0/liveblocks/models/create_comment_request_body.py +104 -0
  149. liveblocks-3.16.0a0/liveblocks/models/create_file_knowledge_source_response_200.py +59 -0
  150. liveblocks-3.16.0a0/liveblocks/models/create_group_request_body.py +87 -0
  151. liveblocks-3.16.0a0/liveblocks/models/create_group_request_body_scopes.py +59 -0
  152. liveblocks-3.16.0a0/liveblocks/models/create_management_project_request_body.py +92 -0
  153. liveblocks-3.16.0a0/liveblocks/models/create_management_webhook_request_body.py +134 -0
  154. liveblocks-3.16.0a0/liveblocks/models/create_management_webhook_request_body_additional_headers.py +45 -0
  155. liveblocks-3.16.0a0/liveblocks/models/create_room_request_body.py +148 -0
  156. liveblocks-3.16.0a0/liveblocks/models/create_room_request_body_engine.py +9 -0
  157. liveblocks-3.16.0a0/liveblocks/models/create_thread_request_body.py +85 -0
  158. liveblocks-3.16.0a0/liveblocks/models/create_thread_request_body_comment.py +93 -0
  159. liveblocks-3.16.0a0/liveblocks/models/create_web_knowledge_source_request_body.py +80 -0
  160. liveblocks-3.16.0a0/liveblocks/models/create_web_knowledge_source_request_body_type.py +7 -0
  161. liveblocks-3.16.0a0/liveblocks/models/create_web_knowledge_source_response.py +43 -0
  162. liveblocks-3.16.0a0/liveblocks/models/create_yjs_version_response.py +48 -0
  163. liveblocks-3.16.0a0/liveblocks/models/create_yjs_version_response_data.py +40 -0
  164. liveblocks-3.16.0a0/liveblocks/models/delete_management_webhook_headers_request_body.py +43 -0
  165. liveblocks-3.16.0a0/liveblocks/models/delete_management_webhook_headers_response.py +48 -0
  166. liveblocks-3.16.0a0/liveblocks/models/edit_comment_metadata_request_body.py +73 -0
  167. liveblocks-3.16.0a0/liveblocks/models/edit_comment_metadata_request_body_metadata.py +58 -0
  168. liveblocks-3.16.0a0/liveblocks/models/edit_comment_request_body.py +96 -0
  169. liveblocks-3.16.0a0/liveblocks/models/edit_thread_metadata_request_body.py +92 -0
  170. liveblocks-3.16.0a0/liveblocks/models/edit_thread_metadata_request_body_metadata.py +58 -0
  171. liveblocks-3.16.0a0/liveblocks/models/error.py +86 -0
  172. liveblocks-3.16.0a0/liveblocks/models/get_ai_copilots_response.py +126 -0
  173. liveblocks-3.16.0a0/liveblocks/models/get_file_knowledge_source_markdown_response.py +51 -0
  174. liveblocks-3.16.0a0/liveblocks/models/get_groups_response.py +72 -0
  175. liveblocks-3.16.0a0/liveblocks/models/get_inbox_notifications_response.py +98 -0
  176. liveblocks-3.16.0a0/liveblocks/models/get_knowledge_sources_response.py +98 -0
  177. liveblocks-3.16.0a0/liveblocks/models/get_management_projects_response.py +82 -0
  178. liveblocks-3.16.0a0/liveblocks/models/get_management_webhook_headers_response.py +48 -0
  179. liveblocks-3.16.0a0/liveblocks/models/get_management_webhooks_response.py +81 -0
  180. liveblocks-3.16.0a0/liveblocks/models/get_room_subscription_settings_response.py +72 -0
  181. liveblocks-3.16.0a0/liveblocks/models/get_rooms_response.py +74 -0
  182. liveblocks-3.16.0a0/liveblocks/models/get_storage_document_format.py +6 -0
  183. liveblocks-3.16.0a0/liveblocks/models/get_storage_document_response.py +51 -0
  184. liveblocks-3.16.0a0/liveblocks/models/get_thread_participants_response.py +0 -0
  185. liveblocks-3.16.0a0/liveblocks/models/get_thread_subscriptions_response.py +57 -0
  186. liveblocks-3.16.0a0/liveblocks/models/get_threads_response.py +60 -0
  187. liveblocks-3.16.0a0/liveblocks/models/get_user_groups_response.py +72 -0
  188. liveblocks-3.16.0a0/liveblocks/models/get_web_knowledge_source_links_response.py +72 -0
  189. liveblocks-3.16.0a0/liveblocks/models/get_yjs_document_response.py +49 -0
  190. liveblocks-3.16.0a0/liveblocks/models/get_yjs_document_type.py +9 -0
  191. liveblocks-3.16.0a0/liveblocks/models/get_yjs_versions_response.py +72 -0
  192. liveblocks-3.16.0a0/liveblocks/models/google_model.py +9 -0
  193. liveblocks-3.16.0a0/liveblocks/models/google_provider_options.py +48 -0
  194. liveblocks-3.16.0a0/liveblocks/models/google_provider_options_google.py +71 -0
  195. liveblocks-3.16.0a0/liveblocks/models/google_provider_options_google_thinking_config.py +59 -0
  196. liveblocks-3.16.0a0/liveblocks/models/group.py +131 -0
  197. liveblocks-3.16.0a0/liveblocks/models/group_member.py +72 -0
  198. liveblocks-3.16.0a0/liveblocks/models/group_scopes.py +59 -0
  199. liveblocks-3.16.0a0/liveblocks/models/identify_user_request_body.py +87 -0
  200. liveblocks-3.16.0a0/liveblocks/models/identify_user_request_body_user_info.py +45 -0
  201. liveblocks-3.16.0a0/liveblocks/models/identify_user_response.py +43 -0
  202. liveblocks-3.16.0a0/liveblocks/models/inbox_notification_activity.py +66 -0
  203. liveblocks-3.16.0a0/liveblocks/models/inbox_notification_activity_data.py +56 -0
  204. liveblocks-3.16.0a0/liveblocks/models/inbox_notification_custom_data.py +141 -0
  205. liveblocks-3.16.0a0/liveblocks/models/inbox_notification_thread_data.py +103 -0
  206. liveblocks-3.16.0a0/liveblocks/models/initialize_storage_document_body.py +82 -0
  207. liveblocks-3.16.0a0/liveblocks/models/initialize_storage_document_body_data.py +45 -0
  208. liveblocks-3.16.0a0/liveblocks/models/initialize_storage_document_response.py +86 -0
  209. liveblocks-3.16.0a0/liveblocks/models/initialize_storage_document_response_data.py +45 -0
  210. liveblocks-3.16.0a0/liveblocks/models/knowledge_source_base.py +90 -0
  211. liveblocks-3.16.0a0/liveblocks/models/knowledge_source_base_status.py +7 -0
  212. liveblocks-3.16.0a0/liveblocks/models/knowledge_source_file_source.py +133 -0
  213. liveblocks-3.16.0a0/liveblocks/models/knowledge_source_file_source_file.py +67 -0
  214. liveblocks-3.16.0a0/liveblocks/models/knowledge_source_web_source.py +114 -0
  215. liveblocks-3.16.0a0/liveblocks/models/knowledge_source_web_source_link.py +69 -0
  216. liveblocks-3.16.0a0/liveblocks/models/knowledge_source_web_source_link_type.py +7 -0
  217. liveblocks-3.16.0a0/liveblocks/models/management_project.py +173 -0
  218. liveblocks-3.16.0a0/liveblocks/models/management_project_public_key.py +80 -0
  219. liveblocks-3.16.0a0/liveblocks/models/management_project_region.py +7 -0
  220. liveblocks-3.16.0a0/liveblocks/models/management_project_roll_project_secret_api_key_response_secret_key_response.py +49 -0
  221. liveblocks-3.16.0a0/liveblocks/models/management_project_secret_key.py +72 -0
  222. liveblocks-3.16.0a0/liveblocks/models/management_project_type.py +6 -0
  223. liveblocks-3.16.0a0/liveblocks/models/management_webhook.py +173 -0
  224. liveblocks-3.16.0a0/liveblocks/models/management_webhook_additional_headers.py +49 -0
  225. liveblocks-3.16.0a0/liveblocks/models/management_webhook_event.py +22 -0
  226. liveblocks-3.16.0a0/liveblocks/models/management_webhook_headers_delete.py +62 -0
  227. liveblocks-3.16.0a0/liveblocks/models/management_webhook_secret.py +62 -0
  228. liveblocks-3.16.0a0/liveblocks/models/mark_thread_as_resolved_request_body.py +43 -0
  229. liveblocks-3.16.0a0/liveblocks/models/mark_thread_as_unresolved_request_body.py +43 -0
  230. liveblocks-3.16.0a0/liveblocks/models/move_json_patch_operation.py +58 -0
  231. liveblocks-3.16.0a0/liveblocks/models/notification_channel_settings.py +71 -0
  232. liveblocks-3.16.0a0/liveblocks/models/notification_settings.py +110 -0
  233. liveblocks-3.16.0a0/liveblocks/models/open_ai_model.py +23 -0
  234. liveblocks-3.16.0a0/liveblocks/models/open_ai_provider_options.py +48 -0
  235. liveblocks-3.16.0a0/liveblocks/models/open_ai_provider_options_openai.py +69 -0
  236. liveblocks-3.16.0a0/liveblocks/models/open_ai_provider_options_openai_reasoning_effort.py +7 -0
  237. liveblocks-3.16.0a0/liveblocks/models/open_ai_provider_options_openai_web_search.py +42 -0
  238. liveblocks-3.16.0a0/liveblocks/models/recover_management_webhook_failed_messages_request_body.py +45 -0
  239. liveblocks-3.16.0a0/liveblocks/models/remove_comment_reaction_request_body.py +68 -0
  240. liveblocks-3.16.0a0/liveblocks/models/remove_group_members_request_body.py +62 -0
  241. liveblocks-3.16.0a0/liveblocks/models/remove_json_patch_operation.py +50 -0
  242. liveblocks-3.16.0a0/liveblocks/models/replace_json_patch_operation.py +79 -0
  243. liveblocks-3.16.0a0/liveblocks/models/roll_project_public_api_key_request_body.py +56 -0
  244. liveblocks-3.16.0a0/liveblocks/models/roll_project_public_api_key_request_body_expiration_in.py +17 -0
  245. liveblocks-3.16.0a0/liveblocks/models/roll_project_public_api_key_response.py +49 -0
  246. liveblocks-3.16.0a0/liveblocks/models/roll_project_secret_api_key_request_body.py +56 -0
  247. liveblocks-3.16.0a0/liveblocks/models/roll_project_secret_api_key_request_body_expiration_in.py +17 -0
  248. liveblocks-3.16.0a0/liveblocks/models/room.py +140 -0
  249. liveblocks-3.16.0a0/liveblocks/models/room_accesses.py +66 -0
  250. liveblocks-3.16.0a0/liveblocks/models/room_accesses_additional_property_item.py +8 -0
  251. liveblocks-3.16.0a0/liveblocks/models/room_metadata.py +72 -0
  252. liveblocks-3.16.0a0/liveblocks/models/room_permission_item.py +8 -0
  253. liveblocks-3.16.0a0/liveblocks/models/room_subscription_settings.py +54 -0
  254. liveblocks-3.16.0a0/liveblocks/models/room_subscription_settings_text_mentions.py +6 -0
  255. liveblocks-3.16.0a0/liveblocks/models/room_subscription_settings_threads.py +7 -0
  256. liveblocks-3.16.0a0/liveblocks/models/room_type.py +5 -0
  257. liveblocks-3.16.0a0/liveblocks/models/rotate_management_webhook_secret_response.py +75 -0
  258. liveblocks-3.16.0a0/liveblocks/models/set_presence_request_body.py +87 -0
  259. liveblocks-3.16.0a0/liveblocks/models/set_presence_request_body_data.py +45 -0
  260. liveblocks-3.16.0a0/liveblocks/models/set_presence_request_body_user_info.py +78 -0
  261. liveblocks-3.16.0a0/liveblocks/models/subscribe_to_thread_request_body.py +43 -0
  262. liveblocks-3.16.0a0/liveblocks/models/subscription.py +61 -0
  263. liveblocks-3.16.0a0/liveblocks/models/test_json_patch_operation.py +58 -0
  264. liveblocks-3.16.0a0/liveblocks/models/test_management_webhook_request_body.py +64 -0
  265. liveblocks-3.16.0a0/liveblocks/models/test_management_webhook_response.py +48 -0
  266. liveblocks-3.16.0a0/liveblocks/models/test_management_webhook_response_message.py +74 -0
  267. liveblocks-3.16.0a0/liveblocks/models/thread.py +142 -0
  268. liveblocks-3.16.0a0/liveblocks/models/thread_metadata.py +59 -0
  269. liveblocks-3.16.0a0/liveblocks/models/trigger_inbox_notification_request_body.py +115 -0
  270. liveblocks-3.16.0a0/liveblocks/models/trigger_inbox_notification_request_body_activity_data.py +56 -0
  271. liveblocks-3.16.0a0/liveblocks/models/unsubscribe_from_thread_request_body.py +43 -0
  272. liveblocks-3.16.0a0/liveblocks/models/update_ai_copilot_request_body.py +253 -0
  273. liveblocks-3.16.0a0/liveblocks/models/update_ai_copilot_request_body_provider.py +8 -0
  274. liveblocks-3.16.0a0/liveblocks/models/update_management_project_request_body.py +80 -0
  275. liveblocks-3.16.0a0/liveblocks/models/update_management_webhook_request_body.py +121 -0
  276. liveblocks-3.16.0a0/liveblocks/models/update_notification_settings_request_body.py +108 -0
  277. liveblocks-3.16.0a0/liveblocks/models/update_room_id_request_body.py +43 -0
  278. liveblocks-3.16.0a0/liveblocks/models/update_room_request_body.py +139 -0
  279. liveblocks-3.16.0a0/liveblocks/models/update_room_request_body_groups_accesses.py +95 -0
  280. liveblocks-3.16.0a0/liveblocks/models/update_room_request_body_groups_accesses_additional_property_type_0_item.py +8 -0
  281. liveblocks-3.16.0a0/liveblocks/models/update_room_request_body_metadata.py +70 -0
  282. liveblocks-3.16.0a0/liveblocks/models/update_room_request_body_users_accesses.py +93 -0
  283. liveblocks-3.16.0a0/liveblocks/models/update_room_request_body_users_accesses_additional_property_type_0_item.py +8 -0
  284. liveblocks-3.16.0a0/liveblocks/models/update_room_subscription_settings_request_body.py +73 -0
  285. liveblocks-3.16.0a0/liveblocks/models/update_room_subscription_settings_request_body_text_mentions.py +6 -0
  286. liveblocks-3.16.0a0/liveblocks/models/update_room_subscription_settings_request_body_threads.py +7 -0
  287. liveblocks-3.16.0a0/liveblocks/models/upsert_management_webhook_headers_request_body.py +48 -0
  288. liveblocks-3.16.0a0/liveblocks/models/upsert_management_webhook_headers_response.py +52 -0
  289. liveblocks-3.16.0a0/liveblocks/models/upsert_management_webhook_headers_response_headers.py +45 -0
  290. liveblocks-3.16.0a0/liveblocks/models/upsert_room_request_body.py +72 -0
  291. liveblocks-3.16.0a0/liveblocks/models/user_room_subscription_settings.py +62 -0
  292. liveblocks-3.16.0a0/liveblocks/models/user_room_subscription_settings_text_mentions.py +6 -0
  293. liveblocks-3.16.0a0/liveblocks/models/user_room_subscription_settings_threads.py +7 -0
  294. liveblocks-3.16.0a0/liveblocks/models/user_subscription.py +91 -0
  295. liveblocks-3.16.0a0/liveblocks/models/web_knowledge_source_link.py +80 -0
  296. liveblocks-3.16.0a0/liveblocks/models/web_knowledge_source_link_status.py +7 -0
  297. liveblocks-3.16.0a0/liveblocks/models/yjs_version.py +121 -0
  298. liveblocks-3.16.0a0/liveblocks/models/yjs_version_authors_item.py +59 -0
  299. liveblocks-3.16.0a0/liveblocks/py.typed +1 -0
  300. liveblocks-3.16.0a0/liveblocks/session.py +189 -0
  301. liveblocks-3.16.0a0/liveblocks/types.py +39 -0
  302. liveblocks-3.16.0a0/liveblocks/webhooks.py +525 -0
  303. liveblocks-3.16.0a0/pyproject.toml +61 -0
@@ -0,0 +1,2531 @@
1
+ Metadata-Version: 2.3
2
+ Name: liveblocks
3
+ Version: 3.16.0a0
4
+ Summary: A client library for accessing Liveblocks API
5
+ Requires-Dist: httpx>=0.23.0,<0.29.0
6
+ Requires-Dist: attrs>=22.2.0
7
+ Requires-Dist: python-dateutil>=2.8.0,<3
8
+ Requires-Python: >=3.11
9
+ Description-Content-Type: text/markdown
10
+
11
+ # @liveblocks/python
12
+
13
+ `@liveblocks/python` provides you with a Python client for accessing the Liveblocks API. This library is only intended for use in your Python back end.
14
+
15
+ ## Installation
16
+
17
+ Install the Liveblocks package to get started.
18
+
19
+ ```bash
20
+ pip install liveblocks
21
+ ```
22
+
23
+ ## Quickstart
24
+
25
+ All API calls require a Liveblocks client set up with your secret key. Find your key in the [Liveblocks Dashboard](https://liveblocks.io/dashboard/apikeys).
26
+
27
+ ### Synchronous
28
+
29
+ ```python
30
+ from liveblocks import Liveblocks
31
+
32
+ client = Liveblocks(secret="{{SECRET_KEY}}")
33
+
34
+ with client:
35
+ rooms = client.get_rooms()
36
+ print(rooms)
37
+ ```
38
+
39
+ ### Asynchronous
40
+
41
+ ```python
42
+ from liveblocks import AsyncLiveblocks
43
+
44
+ client = AsyncLiveblocks(secret="{{SECRET_KEY}}")
45
+
46
+ async with client:
47
+ rooms = await client.get_rooms()
48
+ print(rooms)
49
+ ```
50
+
51
+ ---
52
+
53
+ ## API Reference
54
+
55
+ ### Room
56
+
57
+ #### `get_rooms`
58
+
59
+ This endpoint returns a list of your rooms. The rooms are returned sorted by creation date, from newest to oldest. You can filter rooms by room ID prefixes, metadata, users accesses, and groups accesses. Corresponds to [`liveblocks.getRooms`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-rooms).
60
+
61
+ There is a pagination system where the cursor to the next page is returned in the response as `nextCursor`, which can be combined with `startingAfter`.
62
+ You can also limit the number of rooms by query.
63
+
64
+ Filtering by metadata works by giving key values like `metadata.color=red`. Of course you can combine multiple metadata clauses to refine the response like `metadata.color=red&metadata.type=text`. Notice here the operator AND is applied between each clauses.
65
+
66
+ Filtering by groups or userId works by giving a list of groups like `groupIds=marketing,GZo7tQ,product` or/and a userId like `userId=user1`.
67
+ Notice here the operator OR is applied between each `groupIds` and the `userId`.
68
+
69
+
70
+ **Example**
71
+ ```python
72
+ result = client.get_rooms(
73
+ # limit=20,
74
+ # starting_after="eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
75
+ # organization_id="org_123456789",
76
+ # query="metadata[\"color\"]:\"blue\"",
77
+ # user_id="user-123",
78
+ # group_ids="group1,group2",
79
+ )
80
+ print(result)
81
+ ```
82
+ **Parameters:**
83
+
84
+ | Name | Type | Required | Description |
85
+ |------|------|----------|-------------|
86
+ | `limit` | `int \| Unset` | No | A limit on the number of rooms to be returned. The limit can range between 1 and 100, and defaults to 20. *(default: `20`)* |
87
+ | `starting_after` | `str \| Unset` | No | A cursor used for pagination. Get the value from the `nextCursor` response of the previous page. |
88
+ | `organization_id` | `str \| Unset` | No | A filter on organization ID. |
89
+ | `query` | `str \| Unset` | No | Query to filter rooms. You can filter by `roomId` and `metadata`, for example, `metadata["roomType"]:"whiteboard" AND roomId^"liveblocks:engineering"`. Learn more about [filtering rooms with query language](https://liveblocks.io/docs/guides/how-to-filter-rooms-using-query-language). |
90
+ | `user_id` | `str \| Unset` | No | A filter on users accesses. |
91
+ | `group_ids` | `str \| Unset` | No | A filter on groups accesses. Multiple groups can be used. |
92
+
93
+
94
+ ---
95
+
96
+ #### `create_room`
97
+
98
+ This endpoint creates a new room. `id` and `defaultAccesses` are required. When provided with a `?idempotent` query argument, will not return a 409 when the room already exists, but instead return the existing room as-is. Corresponds to [`liveblocks.createRoom`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-rooms), or to [`liveblocks.getOrCreateRoom`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-or-create-rooms-roomId) when `?idempotent` is provided.
99
+ - `defaultAccesses` could be `[]` or `["room:write"]` (private or public).
100
+ - `metadata` could be key/value as `string` or `string[]`. `metadata` supports maximum 50 entries. Key length has a limit of 40 characters maximum. Value length has a limit of 256 characters maximum. `metadata` is optional field.
101
+ - `usersAccesses` could be `[]` or `["room:write"]` for every records. `usersAccesses` can contain 1000 ids maximum. Id length has a limit of 256 characters. `usersAccesses` is optional field.
102
+ - `groupsAccesses` are optional fields.
103
+
104
+
105
+ **Example**
106
+ ```python
107
+ from liveblocks.models import CreateRoomRequestBody
108
+
109
+ result = client.create_room(
110
+ body=CreateRoomRequestBody(
111
+ id="...",
112
+ default_accesses=[],
113
+ # users_accesses=...,
114
+ # groups_accesses=...,
115
+ # metadata=...,
116
+ ),
117
+ # idempotent=True,
118
+ )
119
+ print(result)
120
+ ```
121
+ **Parameters:**
122
+
123
+ | Name | Type | Required | Description |
124
+ |------|------|----------|-------------|
125
+ | `idempotent` | `bool \| Unset` | No | When provided, will not return a 409 when the room already exists, but instead return the existing room as-is. Corresponds to [`liveblocks.getOrCreateRoom`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-or-create-rooms-roomId). |
126
+ | `body` | `CreateRoomRequestBody` | Yes | Request body (application/json) |
127
+
128
+
129
+ ---
130
+
131
+ #### `get_room`
132
+
133
+ This endpoint returns a room by its ID. Corresponds to [`liveblocks.getRoom`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-rooms-roomid).
134
+
135
+ **Example**
136
+ ```python
137
+ result = client.get_room(
138
+ room_id="my-room-id",
139
+ )
140
+ print(result)
141
+ ```
142
+ **Parameters:**
143
+
144
+ | Name | Type | Required | Description |
145
+ |------|------|----------|-------------|
146
+ | `room_id` | `str` | Yes | ID of the room |
147
+
148
+
149
+ ---
150
+
151
+ #### `update_room`
152
+
153
+ This endpoint updates specific properties of a room. Corresponds to [`liveblocks.updateRoom`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-rooms-roomid).
154
+
155
+ It’s not necessary to provide the entire room’s information.
156
+ Setting a property to `null` means to delete this property. For example, if you want to remove access to a specific user without losing other users:
157
+ ``{
158
+ "usersAccesses": {
159
+ "john": null
160
+ }
161
+ }``
162
+ `defaultAccesses`, `metadata`, `usersAccesses`, `groupsAccesses` can be updated.
163
+
164
+ - `defaultAccesses` could be `[]` or `["room:write"]` (private or public).
165
+ - `metadata` could be key/value as `string` or `string[]`. `metadata` supports maximum 50 entries. Key length has a limit of 40 characters maximum. Value length has a limit of 256 characters maximum. `metadata` is optional field.
166
+ - `usersAccesses` could be `[]` or `["room:write"]` for every records. `usersAccesses` can contain 1000 ids maximum. Id length has a limit of 256 characters. `usersAccesses` is optional field.
167
+ - `groupsAccesses` could be `[]` or `["room:write"]` for every records. `groupsAccesses` can contain 1000 ids maximum. Id length has a limit of 256 characters. `groupsAccesses` is optional field.
168
+
169
+ **Example**
170
+ ```python
171
+ from liveblocks.models import UpdateRoomRequestBody
172
+
173
+ result = client.update_room(
174
+ room_id="my-room-id",
175
+ body=UpdateRoomRequestBody(
176
+ # default_accesses=[],
177
+ # users_accesses=...,
178
+ # groups_accesses=...,
179
+ ),
180
+ )
181
+ print(result)
182
+ ```
183
+ **Parameters:**
184
+
185
+ | Name | Type | Required | Description |
186
+ |------|------|----------|-------------|
187
+ | `room_id` | `str` | Yes | ID of the room |
188
+ | `body` | `UpdateRoomRequestBody` | Yes | Request body (application/json) |
189
+
190
+
191
+ ---
192
+
193
+ #### `delete_room`
194
+
195
+ This endpoint deletes a room. A deleted room is no longer accessible from the API or the dashboard and it cannot be restored. Corresponds to [`liveblocks.deleteRoom`](https://liveblocks.io/docs/api-reference/liveblocks-node#delete-rooms-roomid).
196
+
197
+ **Example**
198
+ ```python
199
+ client.delete_room(
200
+ room_id="my-room-id",
201
+ )
202
+ ```
203
+ **Parameters:**
204
+
205
+ | Name | Type | Required | Description |
206
+ |------|------|----------|-------------|
207
+ | `room_id` | `str` | Yes | ID of the room |
208
+
209
+
210
+ ---
211
+
212
+ #### `prewarm_room`
213
+
214
+ Speeds up connecting to a room for the next 10 seconds. Use this when you know a user will be connecting to a room with [`RoomProvider`](https://liveblocks.io/docs/api-reference/liveblocks-react#RoomProvider) or [`enterRoom`](https://liveblocks.io/docs/api-reference/liveblocks-client#Client.enterRoom) within 10 seconds, and the room will load quicker. Corresponds to [`liveblocks.prewarmRoom`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-rooms-roomid-prewarm).
215
+
216
+ **Example**
217
+ ```python
218
+ client.prewarm_room(
219
+ room_id="my-room-id",
220
+ )
221
+ ```
222
+ **Parameters:**
223
+
224
+ | Name | Type | Required | Description |
225
+ |------|------|----------|-------------|
226
+ | `room_id` | `str` | Yes | ID of the room |
227
+
228
+
229
+ ---
230
+
231
+ #### `upsert_room`
232
+
233
+ This endpoint updates specific properties of a room. Corresponds to [`liveblocks.upsertRoom`](https://liveblocks.io/docs/api-reference/liveblocks-node#upsert-rooms-roomId).
234
+
235
+ It’s not necessary to provide the entire room’s information.
236
+ Setting a property to `null` means to delete this property. For example, if you want to remove access to a specific user without losing other users:
237
+ ``{
238
+ "usersAccesses": {
239
+ "john": null
240
+ }
241
+ }``
242
+ `defaultAccesses`, `metadata`, `usersAccesses`, `groupsAccesses` can be updated.
243
+
244
+ - `defaultAccesses` could be `[]` or `["room:write"]` (private or public).
245
+ - `metadata` could be key/value as `string` or `string[]`. `metadata` supports maximum 50 entries. Key length has a limit of 40 characters maximum. Value length has a limit of 256 characters maximum. `metadata` is optional field.
246
+ - `usersAccesses` could be `[]` or `["room:write"]` for every records. `usersAccesses` can contain 1000 ids maximum. Id length has a limit of 256 characters. `usersAccesses` is optional field.
247
+ - `groupsAccesses` could be `[]` or `["room:write"]` for every records. `groupsAccesses` can contain 1000 ids maximum. Id length has a limit of 256 characters. `groupsAccesses` is optional field.
248
+
249
+ **Example**
250
+ ```python
251
+ from liveblocks.models import UpsertRoomRequestBody
252
+
253
+ result = client.upsert_room(
254
+ room_id="my-room-id",
255
+ body=UpsertRoomRequestBody(
256
+ update=...,
257
+ # create=...,
258
+ ),
259
+ )
260
+ print(result)
261
+ ```
262
+ **Parameters:**
263
+
264
+ | Name | Type | Required | Description |
265
+ |------|------|----------|-------------|
266
+ | `room_id` | `str` | Yes | ID of the room |
267
+ | `body` | `UpsertRoomRequestBody` | Yes | Request body (application/json) |
268
+
269
+
270
+ ---
271
+
272
+ #### `update_room_id`
273
+
274
+ This endpoint permanently updates the room’s ID. All existing references to the old room ID will need to be updated. Returns the updated room. Corresponds to [`liveblocks.updateRoomId`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-rooms-roomid-update-room-id).
275
+
276
+ **Example**
277
+ ```python
278
+ result = client.update_room_id(
279
+ room_id="my-room-id",
280
+ )
281
+ print(result)
282
+ ```
283
+ **Parameters:**
284
+
285
+ | Name | Type | Required | Description |
286
+ |------|------|----------|-------------|
287
+ | `room_id` | `str` | Yes | The new ID for the room |
288
+ | `body` | `UpdateRoomIdRequestBody \| Unset` | No | Request body (application/json) |
289
+
290
+
291
+ ---
292
+
293
+ #### `get_active_users`
294
+
295
+ This endpoint returns a list of users currently present in the requested room. Corresponds to [`liveblocks.getActiveUsers`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-rooms-roomid-active-users).
296
+
297
+ For optimal performance, we recommend calling this endpoint no more than once every 10 seconds.
298
+ Duplicates can occur if a user is in the requested room with multiple browser tabs opened.
299
+
300
+ **Example**
301
+ ```python
302
+ result = client.get_active_users(
303
+ room_id="my-room-id",
304
+ )
305
+ print(result)
306
+ ```
307
+ **Parameters:**
308
+
309
+ | Name | Type | Required | Description |
310
+ |------|------|----------|-------------|
311
+ | `room_id` | `str` | Yes | ID of the room |
312
+
313
+
314
+ ---
315
+
316
+ #### `set_presence`
317
+
318
+ This endpoint sets ephemeral presence for a user in a room without requiring a WebSocket connection. The presence data will automatically expire after the specified TTL (time-to-live). This is useful for scenarios like showing an AI agent's presence in a room. The presence will be broadcast to all connected users in the room. Corresponds to [`liveblocks.setPresence`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-rooms-roomId-presence).
319
+
320
+ **Example**
321
+ ```python
322
+ from liveblocks.models import SetPresenceRequestBody
323
+
324
+ client.set_presence(
325
+ room_id="my-room-id",
326
+ body=SetPresenceRequestBody(
327
+ user_id="...",
328
+ data=...,
329
+ # user_info=...,
330
+ # ttl=0,
331
+ ),
332
+ )
333
+ ```
334
+ **Parameters:**
335
+
336
+ | Name | Type | Required | Description |
337
+ |------|------|----------|-------------|
338
+ | `room_id` | `str` | Yes | ID of the room |
339
+ | `body` | `SetPresenceRequestBody` | Yes | Request body (application/json) |
340
+
341
+
342
+ ---
343
+
344
+ #### `broadcast_event`
345
+
346
+ This endpoint enables the broadcast of an event to a room without having to connect to it via the `client` from `@liveblocks/client`. It takes any valid JSON as a request body. The `connectionId` passed to event listeners is `-1` when using this API. Corresponds to [`liveblocks.broadcastEvent`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-broadcast-event).
347
+
348
+ **Example**
349
+ ```python
350
+ client.broadcast_event(
351
+ room_id="my-room-id",
352
+ body=...,
353
+ )
354
+ ```
355
+ **Parameters:**
356
+
357
+ | Name | Type | Required | Description |
358
+ |------|------|----------|-------------|
359
+ | `room_id` | `str` | Yes | ID of the room |
360
+ | `body` | `Any` | Yes | Request body (application/json) |
361
+
362
+
363
+ ---
364
+
365
+ ### Storage
366
+
367
+ #### `get_storage_document`
368
+
369
+ Returns the contents of the room’s Storage tree. Corresponds to [`liveblocks.getStorageDocument`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-rooms-roomId-storage).
370
+
371
+ The default outputted format is called “plain LSON”, which includes information on the Live data structures in the tree. These nodes show up in the output as objects with two properties, for example:
372
+
373
+ ```json
374
+ {
375
+ "liveblocksType": "LiveObject",
376
+ "data": ...
377
+ }
378
+ ```
379
+
380
+ If you’re not interested in this information, you can use the simpler `?format=json` query param, see below.
381
+
382
+ **Example**
383
+ ```python
384
+ result = client.get_storage_document(
385
+ room_id="my-room-id",
386
+ # format_=...,
387
+ )
388
+ print(result)
389
+ ```
390
+ **Parameters:**
391
+
392
+ | Name | Type | Required | Description |
393
+ |------|------|----------|-------------|
394
+ | `room_id` | `str` | Yes | ID of the room |
395
+ | `format_` | `GetStorageDocumentFormat \| Unset` | No | Use the `json` format to output a simplified JSON representation of the Storage tree. In that format, each LiveObject and LiveMap will be formatted as a simple JSON object, and each LiveList will be formatted as a simple JSON array. This is a lossy format because information about the original data structures is not retained, but it may be easier to work with. |
396
+
397
+
398
+ ---
399
+
400
+ #### `initialize_storage_document`
401
+
402
+ This endpoint initializes or reinitializes a room’s Storage. The room must already exist. Calling this endpoint will disconnect all users from the room if there are any, triggering a reconnect. Corresponds to [`liveblocks.initializeStorageDocument`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-rooms-roomId-storage).
403
+
404
+ The format of the request body is the same as what’s returned by the get Storage endpoint.
405
+
406
+ For each Liveblocks data structure that you want to create, you need a JSON element having two properties:
407
+ - `"liveblocksType"` => `"LiveObject" | "LiveList" | "LiveMap"`
408
+ - `"data"` => contains the nested data structures (children) and data.
409
+
410
+ The root’s type can only be LiveObject.
411
+
412
+ A utility function, `toPlainLson` is included in `@liveblocks/client` from `1.0.9` to help convert `LiveObject`, `LiveList`, and `LiveMap` to the structure expected by the endpoint.
413
+
414
+ **Example**
415
+ ```python
416
+ result = client.initialize_storage_document(
417
+ room_id="my-room-id",
418
+ )
419
+ print(result)
420
+ ```
421
+ **Parameters:**
422
+
423
+ | Name | Type | Required | Description |
424
+ |------|------|----------|-------------|
425
+ | `room_id` | `str` | Yes | ID of the room |
426
+ | `body` | `InitializeStorageDocumentBody \| Unset` | No | Request body (application/json) |
427
+
428
+
429
+ ---
430
+
431
+ #### `delete_storage_document`
432
+
433
+ This endpoint deletes all of the room’s Storage data. Calling this endpoint will disconnect all users from the room if there are any. Corresponds to [`liveblocks.deleteStorageDocument`](https://liveblocks.io/docs/api-reference/liveblocks-node#delete-rooms-roomId-storage).
434
+
435
+
436
+ **Example**
437
+ ```python
438
+ client.delete_storage_document(
439
+ room_id="my-room-id",
440
+ )
441
+ ```
442
+ **Parameters:**
443
+
444
+ | Name | Type | Required | Description |
445
+ |------|------|----------|-------------|
446
+ | `room_id` | `str` | Yes | ID of the room |
447
+
448
+
449
+ ---
450
+
451
+ #### `patch_storage_document`
452
+
453
+ Applies a sequence of [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) operations to the room's Storage document, useful for modifying Storage. Operations are applied in order; if any operation fails, the document is not changed and a 422 response with a helpful message is returned.
454
+
455
+ **Paths and data types:** Be as specific as possible with your target path. Every parent in the chain of path segments must be a LiveObject, LiveList, or LiveMap. Complex nested objects passed in `add` or `replace` operations are automatically converted to LiveObjects and LiveLists.
456
+
457
+ **Performance:** For large Storage documents, applying a patch can be expensive because the full state is reconstructed on the server to apply the operations. Very large documents may not be suitable for this endpoint.
458
+
459
+ For a **full guide with examples**, see [Modifying storage via REST API with JSON Patch](https://liveblocks.io/docs/guides/modifying-storage-via-rest-api-with-json-patch).
460
+
461
+ **Example**
462
+ ```python
463
+ client.patch_storage_document(
464
+ room_id="my-room-id",
465
+ body=...,
466
+ )
467
+ ```
468
+ **Parameters:**
469
+
470
+ | Name | Type | Required | Description |
471
+ |------|------|----------|-------------|
472
+ | `room_id` | `str` | Yes | ID of the room |
473
+ | `body` | `list[AddJsonPatchOperation \| CopyJsonPatchOperation \| MoveJsonPatchOperation \| RemoveJsonPatchOperation \| ReplaceJsonPatchOperation \| TestJsonPatchOperation]` | Yes | Request body (application/json) |
474
+
475
+
476
+ ---
477
+
478
+ ### Yjs
479
+
480
+ #### `get_yjs_document`
481
+
482
+ This endpoint returns a JSON representation of the room’s Yjs document. Corresponds to [`liveblocks.getYjsDocument`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-rooms-roomId-ydoc).
483
+
484
+ **Example**
485
+ ```python
486
+ result = client.get_yjs_document(
487
+ room_id="my-room-id",
488
+ # formatting=True,
489
+ # key="root",
490
+ # type_=...,
491
+ )
492
+ print(result)
493
+ ```
494
+ **Parameters:**
495
+
496
+ | Name | Type | Required | Description |
497
+ |------|------|----------|-------------|
498
+ | `room_id` | `str` | Yes | ID of the room |
499
+ | `formatting` | `bool \| Unset` | No | If present, YText will return formatting. |
500
+ | `key` | `str \| Unset` | No | Returns only a single key’s value, e.g. `doc.get(key).toJSON()`. |
501
+ | `type_` | `GetYjsDocumentType \| Unset` | No | Used with key to override the inferred type, i.e. `"ymap"` will return `doc.get(key, Y.Map)`. |
502
+
503
+
504
+ ---
505
+
506
+ #### `send_yjs_binary_update`
507
+
508
+ This endpoint is used to send a Yjs binary update to the room’s Yjs document. You can use this endpoint to initialize Yjs data for the room or to update the room’s Yjs document. To send an update to a subdocument instead of the main document, pass its `guid`. Corresponds to [`liveblocks.sendYjsBinaryUpdate`](https://liveblocks.io/docs/api-reference/liveblocks-node#put-rooms-roomId-ydoc).
509
+
510
+ The update is typically obtained by calling `Y.encodeStateAsUpdate(doc)`. See the [Yjs documentation](https://docs.yjs.dev/api/document-updates) for more details. When manually making this HTTP call, set the HTTP header `Content-Type` to `application/octet-stream`, and send the binary update (a `Uint8Array`) in the body of the HTTP request. This endpoint does not accept JSON, unlike most other endpoints.
511
+
512
+ **Example**
513
+ ```python
514
+ client.send_yjs_binary_update(
515
+ room_id="my-room-id",
516
+ body=...,
517
+ # guid="subdoc-guid-123",
518
+ )
519
+ ```
520
+ **Parameters:**
521
+
522
+ | Name | Type | Required | Description |
523
+ |------|------|----------|-------------|
524
+ | `room_id` | `str` | Yes | ID of the room |
525
+ | `guid` | `str \| Unset` | No | ID of the subdocument |
526
+ | `body` | `File` | Yes | Request body (application/octet-stream) |
527
+
528
+
529
+ ---
530
+
531
+ #### `get_yjs_document_as_binary_update`
532
+
533
+ This endpoint returns the room's Yjs document encoded as a single binary update. This can be used by `Y.applyUpdate(responseBody)` to get a copy of the document in your back end. See [Yjs documentation](https://docs.yjs.dev/api/document-updates) for more information on working with updates. To return a subdocument instead of the main document, pass its `guid`. Corresponds to [`liveblocks.getYjsDocumentAsBinaryUpdate`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-rooms-roomId-ydoc-binary).
534
+
535
+ **Example**
536
+ ```python
537
+ result = client.get_yjs_document_as_binary_update(
538
+ room_id="my-room-id",
539
+ # guid="subdoc-guid-123",
540
+ )
541
+ print(result)
542
+ ```
543
+ **Parameters:**
544
+
545
+ | Name | Type | Required | Description |
546
+ |------|------|----------|-------------|
547
+ | `room_id` | `str` | Yes | ID of the room |
548
+ | `guid` | `str \| Unset` | No | ID of the subdocument |
549
+
550
+
551
+ ---
552
+
553
+ #### `get_yjs_versions`
554
+
555
+ This endpoint returns a list of version history snapshots for the room's Yjs document. The versions are returned sorted by creation date, from newest to oldest.
556
+
557
+ **Example**
558
+ ```python
559
+ result = client.get_yjs_versions(
560
+ room_id="my-room-id",
561
+ # limit=20,
562
+ # cursor="eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
563
+ )
564
+ print(result)
565
+ ```
566
+ **Parameters:**
567
+
568
+ | Name | Type | Required | Description |
569
+ |------|------|----------|-------------|
570
+ | `room_id` | `str` | Yes | ID of the room |
571
+ | `limit` | `int \| Unset` | No | A limit on the number of versions to be returned. The limit can range between 1 and 100, and defaults to 20. *(default: `20`)* |
572
+ | `cursor` | `str \| Unset` | No | A cursor used for pagination. Get the value from the `nextCursor` response of the previous page. |
573
+
574
+
575
+ ---
576
+
577
+ #### `get_yjs_version`
578
+
579
+ This endpoint returns a specific version of the room's Yjs document encoded as a binary Yjs update.
580
+
581
+ **Example**
582
+ ```python
583
+ result = client.get_yjs_version(
584
+ room_id="my-room-id",
585
+ version_id="vh_abc123",
586
+ )
587
+ print(result)
588
+ ```
589
+ **Parameters:**
590
+
591
+ | Name | Type | Required | Description |
592
+ |------|------|----------|-------------|
593
+ | `room_id` | `str` | Yes | ID of the room |
594
+ | `version_id` | `str` | Yes | ID of the version |
595
+
596
+
597
+ ---
598
+
599
+ #### `create_yjs_version`
600
+
601
+ This endpoint creates a new version history snapshot for the room's Yjs document.
602
+
603
+ **Example**
604
+ ```python
605
+ result = client.create_yjs_version(
606
+ room_id="my-room-id",
607
+ )
608
+ print(result)
609
+ ```
610
+ **Parameters:**
611
+
612
+ | Name | Type | Required | Description |
613
+ |------|------|----------|-------------|
614
+ | `room_id` | `str` | Yes | ID of the room |
615
+
616
+
617
+ ---
618
+
619
+ ### Comments
620
+
621
+ #### `get_threads`
622
+
623
+ This endpoint returns the threads in the requested room. Corresponds to [`liveblocks.getThreads`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-rooms-roomId-threads).
624
+
625
+ **Example**
626
+ ```python
627
+ result = client.get_threads(
628
+ room_id="my-room-id",
629
+ # query="metadata[\"color\"]:\"blue\"",
630
+ )
631
+ print(result)
632
+ ```
633
+ **Parameters:**
634
+
635
+ | Name | Type | Required | Description |
636
+ |------|------|----------|-------------|
637
+ | `room_id` | `str` | Yes | ID of the room |
638
+ | `query` | `str \| Unset` | No | Query to filter threads. You can filter by `metadata` and `resolved`, for example, `metadata["status"]:"open" AND metadata["color"]:"red" AND resolved:true`. Learn more about [filtering threads with query language](https://liveblocks.io/docs/guides/how-to-filter-threads-using-query-language). |
639
+
640
+
641
+ ---
642
+
643
+ #### `create_thread`
644
+
645
+ This endpoint creates a new thread and the first comment in the thread. Corresponds to [`liveblocks.createThread`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-rooms-roomId-threads).
646
+
647
+ A comment’s body is an array of paragraphs, each containing child nodes. Here’s an example of how to construct a comment’s body, which can be submitted under `comment.body`.
648
+
649
+ ```json
650
+ {
651
+ "version": 1,
652
+ "content": [
653
+ {
654
+ "type": "paragraph",
655
+ "children": [{ "text": "Hello " }, { "text": "world", "bold": true }]
656
+ }
657
+ ]
658
+ }
659
+ ```
660
+
661
+ `metadata` supports maximum 50 entries. Key length has a limit of 40 characters maximum. Value length has a limit of 4000 characters maximum for strings.
662
+
663
+ **Example**
664
+ ```python
665
+ from liveblocks.models import CreateThreadRequestBody
666
+
667
+ result = client.create_thread(
668
+ room_id="my-room-id",
669
+ body=CreateThreadRequestBody(
670
+ comment=...,
671
+ # metadata=...,
672
+ ),
673
+ )
674
+ print(result)
675
+ ```
676
+ **Parameters:**
677
+
678
+ | Name | Type | Required | Description |
679
+ |------|------|----------|-------------|
680
+ | `room_id` | `str` | Yes | ID of the room |
681
+ | `body` | `CreateThreadRequestBody` | Yes | Request body (application/json) |
682
+
683
+
684
+ ---
685
+
686
+ #### `get_thread`
687
+
688
+ This endpoint returns a thread by its ID. Corresponds to [`liveblocks.getThread`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-rooms-roomId-threads-threadId).
689
+
690
+ **Example**
691
+ ```python
692
+ result = client.get_thread(
693
+ room_id="my-room-id",
694
+ thread_id="th_abc123",
695
+ )
696
+ print(result)
697
+ ```
698
+ **Parameters:**
699
+
700
+ | Name | Type | Required | Description |
701
+ |------|------|----------|-------------|
702
+ | `room_id` | `str` | Yes | ID of the room |
703
+ | `thread_id` | `str` | Yes | ID of the thread |
704
+
705
+
706
+ ---
707
+
708
+ #### `delete_thread`
709
+
710
+ This endpoint deletes a thread by its ID. Corresponds to [`liveblocks.deleteThread`](https://liveblocks.io/docs/api-reference/liveblocks-node#delete-rooms-roomId-threads-threadId).
711
+
712
+ **Example**
713
+ ```python
714
+ client.delete_thread(
715
+ room_id="my-room-id",
716
+ thread_id="th_abc123",
717
+ )
718
+ ```
719
+ **Parameters:**
720
+
721
+ | Name | Type | Required | Description |
722
+ |------|------|----------|-------------|
723
+ | `room_id` | `str` | Yes | ID of the room |
724
+ | `thread_id` | `str` | Yes | ID of the thread |
725
+
726
+
727
+ ---
728
+
729
+ #### `get_thread_participants`
730
+
731
+ **Deprecated.** Prefer using [thread subscriptions](#get-rooms-roomId-threads-threadId-subscriptions) instead.
732
+
733
+ This endpoint returns the list of thread participants. It is a list of unique user IDs representing all the thread comment authors and mentioned users in comments. Corresponds to [`liveblocks.getThreadParticipants`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-rooms-roomId-threads-threadId-participants).
734
+
735
+ **Example**
736
+ ```python
737
+ result = client.get_thread_participants(
738
+ room_id="my-room-id",
739
+ thread_id="th_abc123",
740
+ )
741
+ print(result)
742
+ ```
743
+ **Parameters:**
744
+
745
+ | Name | Type | Required | Description |
746
+ |------|------|----------|-------------|
747
+ | `room_id` | `str` | Yes | ID of the room |
748
+ | `thread_id` | `str` | Yes | ID of the thread |
749
+
750
+
751
+ ---
752
+
753
+ #### `edit_thread_metadata`
754
+
755
+ This endpoint edits the metadata of a thread. The metadata is a JSON object that can be used to store any information you want about the thread, in `string`, `number`, or `boolean` form. Set a property to `null` to remove it. Corresponds to [`liveblocks.editThreadMetadata`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-rooms-roomId-threads-threadId-metadata).
756
+
757
+ `metadata` supports maximum 50 entries. Key length has a limit of 40 characters maximum. Value length has a limit of 4000 characters maximum for strings.
758
+
759
+ **Example**
760
+ ```python
761
+ from liveblocks.models import EditThreadMetadataRequestBody
762
+
763
+ result = client.edit_thread_metadata(
764
+ room_id="my-room-id",
765
+ thread_id="th_abc123",
766
+ body=EditThreadMetadataRequestBody(
767
+ metadata=...,
768
+ user_id="...",
769
+ # updated_at=...,
770
+ ),
771
+ )
772
+ print(result)
773
+ ```
774
+ **Parameters:**
775
+
776
+ | Name | Type | Required | Description |
777
+ |------|------|----------|-------------|
778
+ | `room_id` | `str` | Yes | ID of the room |
779
+ | `thread_id` | `str` | Yes | ID of the thread |
780
+ | `body` | `EditThreadMetadataRequestBody` | Yes | Request body (application/json) |
781
+
782
+
783
+ ---
784
+
785
+ #### `mark_thread_as_resolved`
786
+
787
+ This endpoint marks a thread as resolved. The request body must include a `userId` to identify who resolved the thread. Returns the updated thread. Corresponds to [`liveblocks.markThreadAsResolved`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-rooms-roomId-threads-threadId-mark-as-resolved).
788
+
789
+ **Example**
790
+ ```python
791
+ from liveblocks.models import MarkThreadAsResolvedRequestBody
792
+
793
+ result = client.mark_thread_as_resolved(
794
+ room_id="my-room-id",
795
+ thread_id="th_abc123",
796
+ body=MarkThreadAsResolvedRequestBody(
797
+ user_id="...",
798
+ ),
799
+ )
800
+ print(result)
801
+ ```
802
+ **Parameters:**
803
+
804
+ | Name | Type | Required | Description |
805
+ |------|------|----------|-------------|
806
+ | `room_id` | `str` | Yes | ID of the room |
807
+ | `thread_id` | `str` | Yes | ID of the thread |
808
+ | `body` | `MarkThreadAsResolvedRequestBody` | Yes | Request body (application/json) |
809
+
810
+
811
+ ---
812
+
813
+ #### `mark_thread_as_unresolved`
814
+
815
+ This endpoint marks a thread as unresolved. The request body must include a `userId` to identify who unresolved the thread. Returns the updated thread. Corresponds to [`liveblocks.markThreadAsUnresolved`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-rooms-roomId-threads-threadId-mark-as-unresolved).
816
+
817
+ **Example**
818
+ ```python
819
+ from liveblocks.models import MarkThreadAsUnresolvedRequestBody
820
+
821
+ result = client.mark_thread_as_unresolved(
822
+ room_id="my-room-id",
823
+ thread_id="th_abc123",
824
+ body=MarkThreadAsUnresolvedRequestBody(
825
+ user_id="...",
826
+ ),
827
+ )
828
+ print(result)
829
+ ```
830
+ **Parameters:**
831
+
832
+ | Name | Type | Required | Description |
833
+ |------|------|----------|-------------|
834
+ | `room_id` | `str` | Yes | ID of the room |
835
+ | `thread_id` | `str` | Yes | ID of the thread |
836
+ | `body` | `MarkThreadAsUnresolvedRequestBody` | Yes | Request body (application/json) |
837
+
838
+
839
+ ---
840
+
841
+ #### `subscribe_to_thread`
842
+
843
+ This endpoint subscribes to a thread. Corresponds to [`liveblocks.subscribeToThread`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-rooms-roomId-threads-threadId-subscribe).
844
+
845
+ **Example**
846
+ ```python
847
+ from liveblocks.models import SubscribeToThreadRequestBody
848
+
849
+ result = client.subscribe_to_thread(
850
+ room_id="my-room-id",
851
+ thread_id="th_abc123",
852
+ body=SubscribeToThreadRequestBody(
853
+ user_id="...",
854
+ ),
855
+ )
856
+ print(result)
857
+ ```
858
+ **Parameters:**
859
+
860
+ | Name | Type | Required | Description |
861
+ |------|------|----------|-------------|
862
+ | `room_id` | `str` | Yes | ID of the room |
863
+ | `thread_id` | `str` | Yes | ID of the thread |
864
+ | `body` | `SubscribeToThreadRequestBody` | Yes | Request body (application/json) |
865
+
866
+
867
+ ---
868
+
869
+ #### `unsubscribe_from_thread`
870
+
871
+ This endpoint unsubscribes from a thread. Corresponds to [`liveblocks.unsubscribeFromThread`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-rooms-roomId-threads-threadId-unsubscribe).
872
+
873
+ **Example**
874
+ ```python
875
+ from liveblocks.models import UnsubscribeFromThreadRequestBody
876
+
877
+ client.unsubscribe_from_thread(
878
+ room_id="my-room-id",
879
+ thread_id="th_abc123",
880
+ body=UnsubscribeFromThreadRequestBody(
881
+ user_id="...",
882
+ ),
883
+ )
884
+ ```
885
+ **Parameters:**
886
+
887
+ | Name | Type | Required | Description |
888
+ |------|------|----------|-------------|
889
+ | `room_id` | `str` | Yes | ID of the room |
890
+ | `thread_id` | `str` | Yes | ID of the thread |
891
+ | `body` | `UnsubscribeFromThreadRequestBody` | Yes | Request body (application/json) |
892
+
893
+
894
+ ---
895
+
896
+ #### `get_thread_subscriptions`
897
+
898
+ This endpoint gets the list of subscriptions to a thread. Corresponds to [`liveblocks.getThreadSubscriptions`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-rooms-roomId-threads-threadId-subscriptions).
899
+
900
+ **Example**
901
+ ```python
902
+ result = client.get_thread_subscriptions(
903
+ room_id="my-room-id",
904
+ thread_id="th_abc123",
905
+ )
906
+ print(result)
907
+ ```
908
+ **Parameters:**
909
+
910
+ | Name | Type | Required | Description |
911
+ |------|------|----------|-------------|
912
+ | `room_id` | `str` | Yes | ID of the room |
913
+ | `thread_id` | `str` | Yes | ID of the thread |
914
+
915
+
916
+ ---
917
+
918
+ #### `create_comment`
919
+
920
+ This endpoint creates a new comment, adding it as a reply to a thread. Corresponds to [`liveblocks.createComment`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-rooms-roomId-threads-threadId-comments).
921
+
922
+ A comment’s body is an array of paragraphs, each containing child nodes. Here’s an example of how to construct a comment’s body, which can be submitted under `body`.
923
+
924
+ ```json
925
+ {
926
+ "version": 1,
927
+ "content": [
928
+ {
929
+ "type": "paragraph",
930
+ "children": [{ "text": "Hello " }, { "text": "world", "bold": true }]
931
+ }
932
+ ]
933
+ }
934
+ ```
935
+
936
+ `metadata` supports maximum 50 entries. Key length has a limit of 40 characters maximum. Value length has a limit of 4000 characters maximum for strings.
937
+
938
+ **Example**
939
+ ```python
940
+ from liveblocks.models import CreateCommentRequestBody
941
+
942
+ result = client.create_comment(
943
+ room_id="my-room-id",
944
+ thread_id="th_abc123",
945
+ body=CreateCommentRequestBody(
946
+ user_id="...",
947
+ body=...,
948
+ # created_at=...,
949
+ # metadata=...,
950
+ # attachment_ids=[],
951
+ ),
952
+ )
953
+ print(result)
954
+ ```
955
+ **Parameters:**
956
+
957
+ | Name | Type | Required | Description |
958
+ |------|------|----------|-------------|
959
+ | `room_id` | `str` | Yes | ID of the room |
960
+ | `thread_id` | `str` | Yes | ID of the thread |
961
+ | `body` | `CreateCommentRequestBody` | Yes | Request body (application/json) |
962
+
963
+
964
+ ---
965
+
966
+ #### `get_comment`
967
+
968
+ This endpoint returns a comment by its ID. Corresponds to [`liveblocks.getComment`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-rooms-roomId-threads-threadId-comments-commentId).
969
+
970
+ **Example**
971
+ ```python
972
+ result = client.get_comment(
973
+ room_id="my-room-id",
974
+ thread_id="th_abc123",
975
+ comment_id="cm_abc123",
976
+ )
977
+ print(result)
978
+ ```
979
+ **Parameters:**
980
+
981
+ | Name | Type | Required | Description |
982
+ |------|------|----------|-------------|
983
+ | `room_id` | `str` | Yes | ID of the room |
984
+ | `thread_id` | `str` | Yes | ID of the thread |
985
+ | `comment_id` | `str` | Yes | ID of the comment |
986
+
987
+
988
+ ---
989
+
990
+ #### `edit_comment`
991
+
992
+ This endpoint edits the specified comment. Corresponds to [`liveblocks.editComment`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-rooms-roomId-threads-threadId-comments-commentId).
993
+
994
+ A comment’s body is an array of paragraphs, each containing child nodes. Here’s an example of how to construct a comment’s body, which can be submitted under `body`.
995
+
996
+ ```json
997
+ {
998
+ "version": 1,
999
+ "content": [
1000
+ {
1001
+ "type": "paragraph",
1002
+ "children": [{ "text": "Hello " }, { "text": "world", "bold": true }]
1003
+ }
1004
+ ]
1005
+ }
1006
+ ```
1007
+
1008
+ **Example**
1009
+ ```python
1010
+ from liveblocks.models import EditCommentRequestBody
1011
+
1012
+ result = client.edit_comment(
1013
+ room_id="my-room-id",
1014
+ thread_id="th_abc123",
1015
+ comment_id="cm_abc123",
1016
+ body=EditCommentRequestBody(
1017
+ body=...,
1018
+ # edited_at=...,
1019
+ # metadata=...,
1020
+ # attachment_ids=[],
1021
+ ),
1022
+ )
1023
+ print(result)
1024
+ ```
1025
+ **Parameters:**
1026
+
1027
+ | Name | Type | Required | Description |
1028
+ |------|------|----------|-------------|
1029
+ | `room_id` | `str` | Yes | ID of the room |
1030
+ | `thread_id` | `str` | Yes | ID of the thread |
1031
+ | `comment_id` | `str` | Yes | ID of the comment |
1032
+ | `body` | `EditCommentRequestBody` | Yes | Request body (application/json) |
1033
+
1034
+
1035
+ ---
1036
+
1037
+ #### `delete_comment`
1038
+
1039
+ This endpoint deletes a comment. A deleted comment is no longer accessible from the API or the dashboard and it cannot be restored. Corresponds to [`liveblocks.deleteComment`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-rooms-roomId-threads-threadId-comments-commentId).
1040
+
1041
+ **Example**
1042
+ ```python
1043
+ client.delete_comment(
1044
+ room_id="my-room-id",
1045
+ thread_id="th_abc123",
1046
+ comment_id="cm_abc123",
1047
+ )
1048
+ ```
1049
+ **Parameters:**
1050
+
1051
+ | Name | Type | Required | Description |
1052
+ |------|------|----------|-------------|
1053
+ | `room_id` | `str` | Yes | ID of the room |
1054
+ | `thread_id` | `str` | Yes | ID of the thread |
1055
+ | `comment_id` | `str` | Yes | ID of the comment |
1056
+
1057
+
1058
+ ---
1059
+
1060
+ #### `add_comment_reaction`
1061
+
1062
+ This endpoint adds a reaction to a comment. Corresponds to [`liveblocks.addCommentReaction`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-rooms-roomId-threads-threadId-comments-commentId-add-reaction).
1063
+
1064
+ **Example**
1065
+ ```python
1066
+ from liveblocks.models import AddCommentReactionRequestBody
1067
+
1068
+ result = client.add_comment_reaction(
1069
+ room_id="my-room-id",
1070
+ thread_id="th_abc123",
1071
+ comment_id="cm_abc123",
1072
+ body=AddCommentReactionRequestBody(
1073
+ user_id="...",
1074
+ emoji="...",
1075
+ # created_at=...,
1076
+ ),
1077
+ )
1078
+ print(result)
1079
+ ```
1080
+ **Parameters:**
1081
+
1082
+ | Name | Type | Required | Description |
1083
+ |------|------|----------|-------------|
1084
+ | `room_id` | `str` | Yes | ID of the room |
1085
+ | `thread_id` | `str` | Yes | ID of the thread |
1086
+ | `comment_id` | `str` | Yes | ID of the comment |
1087
+ | `body` | `AddCommentReactionRequestBody` | Yes | Request body (application/json) |
1088
+
1089
+
1090
+ ---
1091
+
1092
+ #### `remove_comment_reaction`
1093
+
1094
+ This endpoint removes a comment reaction. A deleted comment reaction is no longer accessible from the API or the dashboard and it cannot be restored. Corresponds to [`liveblocks.removeCommentReaction`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-rooms-roomId-threads-threadId-comments-commentId-add-reaction).
1095
+
1096
+ **Example**
1097
+ ```python
1098
+ client.remove_comment_reaction(
1099
+ room_id="my-room-id",
1100
+ thread_id="th_abc123",
1101
+ comment_id="cm_abc123",
1102
+ )
1103
+ ```
1104
+ **Parameters:**
1105
+
1106
+ | Name | Type | Required | Description |
1107
+ |------|------|----------|-------------|
1108
+ | `room_id` | `str` | Yes | ID of the room |
1109
+ | `thread_id` | `str` | Yes | ID of the thread |
1110
+ | `comment_id` | `str` | Yes | ID of the comment |
1111
+ | `body` | `RemoveCommentReactionRequestBody \| Unset` | No | Request body (application/json) |
1112
+
1113
+
1114
+ ---
1115
+
1116
+ #### `edit_comment_metadata`
1117
+
1118
+ This endpoint edits the metadata of a comment. The metadata is a JSON object that can be used to store any information you want about the comment, in `string`, `number`, or `boolean` form. Set a property to `null` to remove it. Corresponds to [`liveblocks.editCommentMetadata`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-rooms-roomId-threads-threadId-comments-commentId-metadata).
1119
+
1120
+ `metadata` supports maximum 50 entries. Key length has a limit of 40 characters maximum. Value length has a limit of 4000 characters maximum for strings.
1121
+
1122
+ **Example**
1123
+ ```python
1124
+ from liveblocks.models import EditCommentMetadataRequestBody
1125
+
1126
+ result = client.edit_comment_metadata(
1127
+ room_id="my-room-id",
1128
+ thread_id="th_abc123",
1129
+ comment_id="cm_abc123",
1130
+ body=EditCommentMetadataRequestBody(
1131
+ metadata=...,
1132
+ user_id="...",
1133
+ # updated_at=...,
1134
+ ),
1135
+ )
1136
+ print(result)
1137
+ ```
1138
+ **Parameters:**
1139
+
1140
+ | Name | Type | Required | Description |
1141
+ |------|------|----------|-------------|
1142
+ | `room_id` | `str` | Yes | ID of the room |
1143
+ | `thread_id` | `str` | Yes | ID of the thread |
1144
+ | `comment_id` | `str` | Yes | ID of the comment |
1145
+ | `body` | `EditCommentMetadataRequestBody` | Yes | Request body (application/json) |
1146
+
1147
+
1148
+ ---
1149
+
1150
+ ### Auth
1151
+
1152
+ #### `authorize_user`
1153
+
1154
+ This endpoint lets your application server (your back end) obtain a token that one of its clients (your frontend) can use to enter a Liveblocks room. You use this endpoint to implement your own application’s custom authentication endpoint. When making this request, you’ll have to use your secret key.
1155
+
1156
+ **Important:** The difference with an [ID token](#post-identify-user) is that an access token holds all the permissions, and is the source of truth. With ID tokens, permissions are set in the Liveblocks back end (through REST API calls) and "checked at the door" every time they are used to enter a room.
1157
+
1158
+ **Note:** When using the `@liveblocks/node` package, you can use [`Liveblocks.prepareSession`](https://liveblocks.io/docs/api-reference/liveblocks-node#access-tokens) in your back end to build this request.
1159
+
1160
+ You can pass the property `userId` in the request’s body. This can be whatever internal identifier you use for your user accounts as long as it uniquely identifies an account. The property `userId` is used by Liveblocks to calculate your account’s Monthly Active Users. One unique `userId` corresponds to one MAU.
1161
+
1162
+ Additionally, you can set custom metadata to the token, which will be publicly accessible by other clients through the `user.info` property. This is useful for storing static data like avatar images or the user’s display name.
1163
+
1164
+ Lastly, you’ll specify the exact permissions to give to the user using the `permissions` field. This is done in an object where the keys are room names, or room name patterns (ending in a `*`), and a list of permissions to assign the user for any room that matches that name exactly (or starts with the pattern’s prefix). For tips, see [Manage permissions with access tokens](https://liveblocks.io/docs/authentication/access-token).
1165
+
1166
+ **Example**
1167
+ ```python
1168
+ from liveblocks.models import AuthorizeUserRequestBody
1169
+
1170
+ result = client.authorize_user(
1171
+ body=AuthorizeUserRequestBody(
1172
+ user_id="...",
1173
+ permissions=...,
1174
+ # user_info=...,
1175
+ # organization_id="...",
1176
+ ),
1177
+ )
1178
+ print(result)
1179
+ ```
1180
+ **Parameters:**
1181
+
1182
+ | Name | Type | Required | Description |
1183
+ |------|------|----------|-------------|
1184
+ | `body` | `AuthorizeUserRequestBody` | Yes | Request body (application/json) |
1185
+
1186
+
1187
+ ---
1188
+
1189
+ #### `identify_user`
1190
+
1191
+ This endpoint lets your application server (your back end) obtain a token that one of its clients (your frontend) can use to enter a Liveblocks room. You use this endpoint to implement your own application’s custom authentication endpoint. When using this endpoint to obtain ID tokens, you should manage your permissions by assigning user and/or group permissions to rooms explicitly, see our [Manage permissions with ID tokens](https://liveblocks.io/docs/authentication/id-token) section.
1192
+
1193
+ **Important:** The difference with an [access token](#post-authorize-user) is that an ID token doesn’t hold any permissions itself. With ID tokens, permissions are set in the Liveblocks back end (through REST API calls) and "checked at the door" every time they are used to enter a room. With access tokens, all permissions are set in the token itself, and thus controlled from your back end entirely.
1194
+
1195
+ **Note:** When using the `@liveblocks/node` package, you can use [`Liveblocks.identifyUser`](https://liveblocks.io/docs/api-reference/liveblocks-node) in your back end to build this request.
1196
+
1197
+ You can pass the property `userId` in the request’s body. This can be whatever internal identifier you use for your user accounts as long as it uniquely identifies an account. The property `userId` is used by Liveblocks to calculate your account’s Monthly Active Users. One unique `userId` corresponds to one MAU.
1198
+
1199
+ If you want to use group permissions, you can also declare which `groupIds` this user belongs to. The group ID values are yours, but they will have to match the group IDs you assign permissions to when assigning permissions to rooms, see [Manage permissions with ID tokens](https://liveblocks.io/docs/authentication/id-token)).
1200
+
1201
+ Additionally, you can set custom metadata to the token, which will be publicly accessible by other clients through the `user.info` property. This is useful for storing static data like avatar images or the user’s display name.
1202
+
1203
+ **Example**
1204
+ ```python
1205
+ from liveblocks.models import IdentifyUserRequestBody
1206
+
1207
+ result = client.identify_user(
1208
+ body=IdentifyUserRequestBody(
1209
+ user_id="...",
1210
+ # organization_id="...",
1211
+ # group_ids=[],
1212
+ # user_info=...,
1213
+ ),
1214
+ )
1215
+ print(result)
1216
+ ```
1217
+ **Parameters:**
1218
+
1219
+ | Name | Type | Required | Description |
1220
+ |------|------|----------|-------------|
1221
+ | `body` | `IdentifyUserRequestBody` | Yes | Request body (application/json) |
1222
+
1223
+
1224
+ ---
1225
+
1226
+ ### Notifications
1227
+
1228
+ #### `get_inbox_notification`
1229
+
1230
+ This endpoint returns a user’s inbox notification by its ID. Corresponds to [`liveblocks.getInboxNotification`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-users-userId-inboxNotifications-inboxNotificationId).
1231
+
1232
+ **Example**
1233
+ ```python
1234
+ result = client.get_inbox_notification(
1235
+ user_id="user-123",
1236
+ inbox_notification_id="in_abc123",
1237
+ )
1238
+ print(result)
1239
+ ```
1240
+ **Parameters:**
1241
+
1242
+ | Name | Type | Required | Description |
1243
+ |------|------|----------|-------------|
1244
+ | `user_id` | `str` | Yes | ID of the user |
1245
+ | `inbox_notification_id` | `str` | Yes | ID of the inbox notification |
1246
+
1247
+
1248
+ ---
1249
+
1250
+ #### `delete_inbox_notification`
1251
+
1252
+ This endpoint deletes a user’s inbox notification by its ID. Corresponds to [`liveblocks.deleteInboxNotification`](https://liveblocks.io/docs/api-reference/liveblocks-node#delete-users-userId-inbox-notifications-inboxNotificationId).
1253
+
1254
+ **Example**
1255
+ ```python
1256
+ client.delete_inbox_notification(
1257
+ user_id="user-123",
1258
+ inbox_notification_id="in_abc123",
1259
+ )
1260
+ ```
1261
+ **Parameters:**
1262
+
1263
+ | Name | Type | Required | Description |
1264
+ |------|------|----------|-------------|
1265
+ | `user_id` | `str` | Yes | ID of the user |
1266
+ | `inbox_notification_id` | `str` | Yes | ID of the inbox notification |
1267
+
1268
+
1269
+ ---
1270
+
1271
+ #### `get_inbox_notifications`
1272
+
1273
+ This endpoint returns all the user’s inbox notifications. Corresponds to [`liveblocks.getInboxNotifications`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-users-userId-inboxNotifications).
1274
+
1275
+ **Example**
1276
+ ```python
1277
+ result = client.get_inbox_notifications(
1278
+ user_id="user-123",
1279
+ # organization_id="org_123456789",
1280
+ # query="metadata[\"color\"]:\"blue\"",
1281
+ # limit=20,
1282
+ # starting_after="eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
1283
+ )
1284
+ print(result)
1285
+ ```
1286
+ **Parameters:**
1287
+
1288
+ | Name | Type | Required | Description |
1289
+ |------|------|----------|-------------|
1290
+ | `user_id` | `str` | Yes | ID of the user |
1291
+ | `organization_id` | `str \| Unset` | No | The organization ID to filter notifications for. |
1292
+ | `query` | `str \| Unset` | No | Query to filter notifications. You can filter by `unread`, for example, `unread:true`. |
1293
+ | `limit` | `int \| Unset` | No | A limit on the number of inbox notifications to be returned. The limit can range between 1 and 50, and defaults to 50. *(default: `50`)* |
1294
+ | `starting_after` | `str \| Unset` | No | A cursor used for pagination. Get the value from the `nextCursor` response of the previous page. |
1295
+
1296
+
1297
+ ---
1298
+
1299
+ #### `delete_all_inbox_notifications`
1300
+
1301
+ This endpoint deletes all the user’s inbox notifications. Corresponds to [`liveblocks.deleteAllInboxNotifications`](https://liveblocks.io/docs/api-reference/liveblocks-node#delete-users-userId-inbox-notifications).
1302
+
1303
+ **Example**
1304
+ ```python
1305
+ client.delete_all_inbox_notifications(
1306
+ user_id="user-123",
1307
+ )
1308
+ ```
1309
+ **Parameters:**
1310
+
1311
+ | Name | Type | Required | Description |
1312
+ |------|------|----------|-------------|
1313
+ | `user_id` | `str` | Yes | ID of the user |
1314
+
1315
+
1316
+ ---
1317
+
1318
+ #### `get_notification_settings`
1319
+
1320
+ This endpoint returns a user's notification settings for the project. Corresponds to [`liveblocks.getNotificationSettings`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-users-userId-notification-settings).
1321
+
1322
+ **Example**
1323
+ ```python
1324
+ result = client.get_notification_settings(
1325
+ user_id="user-123",
1326
+ )
1327
+ print(result)
1328
+ ```
1329
+ **Parameters:**
1330
+
1331
+ | Name | Type | Required | Description |
1332
+ |------|------|----------|-------------|
1333
+ | `user_id` | `str` | Yes | ID of the user |
1334
+
1335
+
1336
+ ---
1337
+
1338
+ #### `update_notification_settings`
1339
+
1340
+ This endpoint updates a user's notification settings for the project. Corresponds to [`liveblocks.updateNotificationSettings`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-users-userId-notification-settings).
1341
+
1342
+ **Example**
1343
+ ```python
1344
+ from liveblocks.models import UpdateNotificationSettingsRequestBody
1345
+
1346
+ result = client.update_notification_settings(
1347
+ user_id="user-123",
1348
+ body=UpdateNotificationSettingsRequestBody(
1349
+ # email=...,
1350
+ # slack=...,
1351
+ # teams=...,
1352
+ ),
1353
+ )
1354
+ print(result)
1355
+ ```
1356
+ **Parameters:**
1357
+
1358
+ | Name | Type | Required | Description |
1359
+ |------|------|----------|-------------|
1360
+ | `user_id` | `str` | Yes | ID of the user |
1361
+ | `body` | `UpdateNotificationSettingsRequestBody` | Yes | Request body (application/json) |
1362
+
1363
+
1364
+ ---
1365
+
1366
+ #### `delete_notification_settings`
1367
+
1368
+ This endpoint deletes a user's notification settings for the project. Corresponds to [`liveblocks.deleteNotificationSettings`](https://liveblocks.io/docs/api-reference/liveblocks-node#delete-users-userId-notification-settings).
1369
+
1370
+ **Example**
1371
+ ```python
1372
+ client.delete_notification_settings(
1373
+ user_id="user-123",
1374
+ )
1375
+ ```
1376
+ **Parameters:**
1377
+
1378
+ | Name | Type | Required | Description |
1379
+ |------|------|----------|-------------|
1380
+ | `user_id` | `str` | Yes | ID of the user |
1381
+
1382
+
1383
+ ---
1384
+
1385
+ #### `get_room_subscription_settings`
1386
+
1387
+ This endpoint returns a user’s subscription settings for a specific room. Corresponds to [`liveblocks.getRoomSubscriptionSettings`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-rooms-roomId-users-userId-subscription-settings).
1388
+
1389
+ **Example**
1390
+ ```python
1391
+ result = client.get_room_subscription_settings(
1392
+ room_id="my-room-id",
1393
+ user_id="user-123",
1394
+ )
1395
+ print(result)
1396
+ ```
1397
+ **Parameters:**
1398
+
1399
+ | Name | Type | Required | Description |
1400
+ |------|------|----------|-------------|
1401
+ | `room_id` | `str` | Yes | ID of the room |
1402
+ | `user_id` | `str` | Yes | ID of the user |
1403
+
1404
+
1405
+ ---
1406
+
1407
+ #### `update_room_subscription_settings`
1408
+
1409
+ This endpoint updates a user’s subscription settings for a specific room. Corresponds to [`liveblocks.updateRoomSubscriptionSettings`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-rooms-roomId-users-userId-subscription-settings).
1410
+
1411
+ **Example**
1412
+ ```python
1413
+ from liveblocks.models import UpdateRoomSubscriptionSettingsRequestBody
1414
+
1415
+ result = client.update_room_subscription_settings(
1416
+ room_id="my-room-id",
1417
+ user_id="user-123",
1418
+ body=UpdateRoomSubscriptionSettingsRequestBody(
1419
+ # threads=...,
1420
+ # text_mentions=...,
1421
+ ),
1422
+ )
1423
+ print(result)
1424
+ ```
1425
+ **Parameters:**
1426
+
1427
+ | Name | Type | Required | Description |
1428
+ |------|------|----------|-------------|
1429
+ | `room_id` | `str` | Yes | ID of the room |
1430
+ | `user_id` | `str` | Yes | ID of the user |
1431
+ | `body` | `UpdateRoomSubscriptionSettingsRequestBody` | Yes | Request body (application/json) |
1432
+
1433
+
1434
+ ---
1435
+
1436
+ #### `delete_room_subscription_settings`
1437
+
1438
+ This endpoint deletes a user’s subscription settings for a specific room. Corresponds to [`liveblocks.deleteRoomSubscriptionSettings`](https://liveblocks.io/docs/api-reference/liveblocks-node#delete-rooms-roomId-users-userId-subscription-settings).
1439
+
1440
+ **Example**
1441
+ ```python
1442
+ client.delete_room_subscription_settings(
1443
+ room_id="my-room-id",
1444
+ user_id="user-123",
1445
+ )
1446
+ ```
1447
+ **Parameters:**
1448
+
1449
+ | Name | Type | Required | Description |
1450
+ |------|------|----------|-------------|
1451
+ | `room_id` | `str` | Yes | ID of the room |
1452
+ | `user_id` | `str` | Yes | ID of the user |
1453
+
1454
+
1455
+ ---
1456
+
1457
+ #### `get_user_room_subscription_settings`
1458
+
1459
+ This endpoint returns the list of a user's room subscription settings. Corresponds to [`liveblocks.getUserRoomSubscriptionSettings`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-users-userId-room-subscription-settings).
1460
+
1461
+ **Example**
1462
+ ```python
1463
+ result = client.get_user_room_subscription_settings(
1464
+ user_id="user-123",
1465
+ # starting_after="eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
1466
+ # limit=20,
1467
+ # organization_id="org_123456789",
1468
+ )
1469
+ print(result)
1470
+ ```
1471
+ **Parameters:**
1472
+
1473
+ | Name | Type | Required | Description |
1474
+ |------|------|----------|-------------|
1475
+ | `user_id` | `str` | Yes | ID of the user |
1476
+ | `starting_after` | `str \| Unset` | No | A cursor used for pagination. Get the value from the `nextCursor` response of the previous page. |
1477
+ | `limit` | `int \| Unset` | No | A limit on the number of elements to be returned. The limit can range between 1 and 50, and defaults to 50. *(default: `50`)* |
1478
+ | `organization_id` | `str \| Unset` | No | The organization ID to filter room subscription settings for. |
1479
+
1480
+
1481
+ ---
1482
+
1483
+ #### `get_room_notification_settings`
1484
+
1485
+ **Deprecated.** Renamed to [`/subscription-settings`](get-room-subscription-settings). Read more in our [migration guide](https://liveblocks.io/docs/platform/upgrading/2.24).
1486
+
1487
+ This endpoint returns a user’s subscription settings for a specific room. Corresponds to [`liveblocks.getRoomNotificationSettings`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-rooms-roomId-users-userId-notification-settings).
1488
+
1489
+ **Example**
1490
+ ```python
1491
+ result = client.get_room_notification_settings(
1492
+ room_id="my-room-id",
1493
+ user_id="user-123",
1494
+ )
1495
+ print(result)
1496
+ ```
1497
+ **Parameters:**
1498
+
1499
+ | Name | Type | Required | Description |
1500
+ |------|------|----------|-------------|
1501
+ | `room_id` | `str` | Yes | ID of the room |
1502
+ | `user_id` | `str` | Yes | ID of the user |
1503
+
1504
+
1505
+ ---
1506
+
1507
+ #### `update_room_notification_settings`
1508
+
1509
+ **Deprecated.** Renamed to [`/subscription-settings`](update-room-subscription-settings). Read more in our [migration guide](https://liveblocks.io/docs/platform/upgrading/2.24).
1510
+
1511
+ This endpoint updates a user’s notification settings for a specific room. Corresponds to [`liveblocks.updateRoomNotificationSettings`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-rooms-roomId-users-userId-notification-settings).
1512
+
1513
+ **Example**
1514
+ ```python
1515
+ result = client.update_room_notification_settings(
1516
+ room_id="my-room-id",
1517
+ user_id="user-123",
1518
+ )
1519
+ print(result)
1520
+ ```
1521
+ **Parameters:**
1522
+
1523
+ | Name | Type | Required | Description |
1524
+ |------|------|----------|-------------|
1525
+ | `room_id` | `str` | Yes | ID of the room |
1526
+ | `user_id` | `str` | Yes | ID of the user |
1527
+ | `body` | `UpdateRoomSubscriptionSettingsRequestBody \| Unset` | No | Request body (application/json) |
1528
+
1529
+
1530
+ ---
1531
+
1532
+ #### `delete_room_notification_settings`
1533
+
1534
+ **Deprecated.** Renamed to [`/subscription-settings`](delete-room-subscription-settings). Read more in our [migration guide](https://liveblocks.io/docs/platform/upgrading/2.24).
1535
+
1536
+ This endpoint deletes a user’s notification settings for a specific room. Corresponds to [`liveblocks.deleteRoomNotificationSettings`](https://liveblocks.io/docs/api-reference/liveblocks-node#delete-rooms-roomId-users-userId-notification-settings).
1537
+
1538
+ **Example**
1539
+ ```python
1540
+ client.delete_room_notification_settings(
1541
+ room_id="my-room-id",
1542
+ user_id="user-123",
1543
+ )
1544
+ ```
1545
+ **Parameters:**
1546
+
1547
+ | Name | Type | Required | Description |
1548
+ |------|------|----------|-------------|
1549
+ | `room_id` | `str` | Yes | ID of the room |
1550
+ | `user_id` | `str` | Yes | ID of the user |
1551
+
1552
+
1553
+ ---
1554
+
1555
+ #### `trigger_inbox_notification`
1556
+
1557
+ This endpoint triggers an inbox notification. Corresponds to [`liveblocks.triggerInboxNotification`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-inbox-notifications-trigger).
1558
+
1559
+ **Example**
1560
+ ```python
1561
+ client.trigger_inbox_notification()
1562
+ ```
1563
+ **Parameters:**
1564
+
1565
+ | Name | Type | Required | Description |
1566
+ |------|------|----------|-------------|
1567
+ | `body` | `TriggerInboxNotificationRequestBody \| Unset` | No | Request body (application/json) |
1568
+
1569
+
1570
+ ---
1571
+
1572
+ ### Groups
1573
+
1574
+ #### `get_groups`
1575
+
1576
+ This endpoint returns a list of all groups in your project. Corresponds to [`liveblocks.getGroups`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-groups).
1577
+
1578
+ **Example**
1579
+ ```python
1580
+ result = client.get_groups(
1581
+ # limit=20,
1582
+ # starting_after="eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
1583
+ )
1584
+ print(result)
1585
+ ```
1586
+ **Parameters:**
1587
+
1588
+ | Name | Type | Required | Description |
1589
+ |------|------|----------|-------------|
1590
+ | `limit` | `int \| Unset` | No | A limit on the number of groups to be returned. The limit can range between 1 and 100, and defaults to 20. *(default: `20`)* |
1591
+ | `starting_after` | `str \| Unset` | No | A cursor used for pagination. Get the value from the `nextCursor` response of the previous page. |
1592
+
1593
+
1594
+ ---
1595
+
1596
+ #### `create_group`
1597
+
1598
+ This endpoint creates a new group. Corresponds to [`liveblocks.createGroup`](https://liveblocks.io/docs/api-reference/liveblocks-node#create-group).
1599
+
1600
+ **Example**
1601
+ ```python
1602
+ result = client.create_group()
1603
+ print(result)
1604
+ ```
1605
+ **Parameters:**
1606
+
1607
+ | Name | Type | Required | Description |
1608
+ |------|------|----------|-------------|
1609
+ | `body` | `CreateGroupRequestBody \| Unset` | No | Request body (application/json) |
1610
+
1611
+
1612
+ ---
1613
+
1614
+ #### `get_group`
1615
+
1616
+ This endpoint returns a specific group by ID. Corresponds to [`liveblocks.getGroup`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-group).
1617
+
1618
+ **Example**
1619
+ ```python
1620
+ result = client.get_group(
1621
+ group_id="engineering",
1622
+ )
1623
+ print(result)
1624
+ ```
1625
+ **Parameters:**
1626
+
1627
+ | Name | Type | Required | Description |
1628
+ |------|------|----------|-------------|
1629
+ | `group_id` | `str` | Yes | The ID of the group to retrieve. |
1630
+
1631
+
1632
+ ---
1633
+
1634
+ #### `delete_group`
1635
+
1636
+ This endpoint deletes a group. Corresponds to [`liveblocks.deleteGroup`](https://liveblocks.io/docs/api-reference/liveblocks-node#delete-group).
1637
+
1638
+ **Example**
1639
+ ```python
1640
+ client.delete_group(
1641
+ group_id="engineering",
1642
+ )
1643
+ ```
1644
+ **Parameters:**
1645
+
1646
+ | Name | Type | Required | Description |
1647
+ |------|------|----------|-------------|
1648
+ | `group_id` | `str` | Yes | The ID of the group to delete. |
1649
+
1650
+
1651
+ ---
1652
+
1653
+ #### `add_group_members`
1654
+
1655
+ This endpoint adds new members to an existing group. Corresponds to [`liveblocks.addGroupMembers`](https://liveblocks.io/docs/api-reference/liveblocks-node#add-group-members).
1656
+
1657
+ **Example**
1658
+ ```python
1659
+ from liveblocks.models import AddGroupMembersRequestBody
1660
+
1661
+ result = client.add_group_members(
1662
+ group_id="engineering",
1663
+ body=AddGroupMembersRequestBody(
1664
+ member_ids=[],
1665
+ ),
1666
+ )
1667
+ print(result)
1668
+ ```
1669
+ **Parameters:**
1670
+
1671
+ | Name | Type | Required | Description |
1672
+ |------|------|----------|-------------|
1673
+ | `group_id` | `str` | Yes | The ID of the group to add members to. |
1674
+ | `body` | `AddGroupMembersRequestBody` | Yes | Request body (application/json) |
1675
+
1676
+
1677
+ ---
1678
+
1679
+ #### `remove_group_members`
1680
+
1681
+ This endpoint removes members from an existing group. Corresponds to [`liveblocks.removeGroupMembers`](https://liveblocks.io/docs/api-reference/liveblocks-node#remove-group-members).
1682
+
1683
+ **Example**
1684
+ ```python
1685
+ from liveblocks.models import RemoveGroupMembersRequestBody
1686
+
1687
+ result = client.remove_group_members(
1688
+ group_id="engineering",
1689
+ body=RemoveGroupMembersRequestBody(
1690
+ member_ids=[],
1691
+ ),
1692
+ )
1693
+ print(result)
1694
+ ```
1695
+ **Parameters:**
1696
+
1697
+ | Name | Type | Required | Description |
1698
+ |------|------|----------|-------------|
1699
+ | `group_id` | `str` | Yes | The ID of the group to remove members from. |
1700
+ | `body` | `RemoveGroupMembersRequestBody` | Yes | Request body (application/json) |
1701
+
1702
+
1703
+ ---
1704
+
1705
+ #### `get_user_groups`
1706
+
1707
+ This endpoint returns all groups that a specific user is a member of. Corresponds to [`liveblocks.getUserGroups`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-user-groups).
1708
+
1709
+ **Example**
1710
+ ```python
1711
+ result = client.get_user_groups(
1712
+ user_id="user-123",
1713
+ # limit=20,
1714
+ # starting_after="eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
1715
+ )
1716
+ print(result)
1717
+ ```
1718
+ **Parameters:**
1719
+
1720
+ | Name | Type | Required | Description |
1721
+ |------|------|----------|-------------|
1722
+ | `user_id` | `str` | Yes | The ID of the user to get groups for. |
1723
+ | `limit` | `int \| Unset` | No | A limit on the number of groups to be returned. The limit can range between 1 and 100, and defaults to 20. *(default: `20`)* |
1724
+ | `starting_after` | `str \| Unset` | No | A cursor used for pagination. Get the value from the `nextCursor` response of the previous page. |
1725
+
1726
+
1727
+ ---
1728
+
1729
+ ### Ai
1730
+
1731
+ #### `get_ai_copilots`
1732
+
1733
+ This endpoint returns a paginated list of AI copilots. The copilots are returned sorted by creation date, from newest to oldest. Corresponds to [`liveblocks.getAiCopilots`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-ai-copilots).
1734
+
1735
+ **Example**
1736
+ ```python
1737
+ result = client.get_ai_copilots(
1738
+ # limit=20,
1739
+ # starting_after="eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
1740
+ )
1741
+ print(result)
1742
+ ```
1743
+ **Parameters:**
1744
+
1745
+ | Name | Type | Required | Description |
1746
+ |------|------|----------|-------------|
1747
+ | `limit` | `int \| Unset` | No | A limit on the number of copilots to be returned. The limit can range between 1 and 100, and defaults to 20. *(default: `20`)* |
1748
+ | `starting_after` | `str \| Unset` | No | A cursor used for pagination. Get the value from the `nextCursor` response of the previous page. |
1749
+
1750
+
1751
+ ---
1752
+
1753
+ #### `create_ai_copilot`
1754
+
1755
+ This endpoint creates a new AI copilot with the given configuration. Corresponds to [`liveblocks.createAiCopilot`](https://liveblocks.io/docs/api-reference/liveblocks-node#create-ai-copilot).
1756
+
1757
+ **Example**
1758
+ ```python
1759
+ result = client.create_ai_copilot(
1760
+ body=...,
1761
+ )
1762
+ print(result)
1763
+ ```
1764
+ **Parameters:**
1765
+
1766
+ | Name | Type | Required | Description |
1767
+ |------|------|----------|-------------|
1768
+ | `body` | `CreateAiCopilotOptionsAnthropic \| CreateAiCopilotOptionsGoogle \| CreateAiCopilotOptionsOpenAi \| CreateAiCopilotOptionsOpenAiCompatible` | Yes | Request body (application/json) |
1769
+
1770
+
1771
+ ---
1772
+
1773
+ #### `get_ai_copilot`
1774
+
1775
+ This endpoint returns an AI copilot by its ID. Corresponds to [`liveblocks.getAiCopilot`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-ai-copilot).
1776
+
1777
+ **Example**
1778
+ ```python
1779
+ result = client.get_ai_copilot(
1780
+ copilot_id="cp_abc123",
1781
+ )
1782
+ print(result)
1783
+ ```
1784
+ **Parameters:**
1785
+
1786
+ | Name | Type | Required | Description |
1787
+ |------|------|----------|-------------|
1788
+ | `copilot_id` | `str` | Yes | ID of the AI copilot |
1789
+
1790
+
1791
+ ---
1792
+
1793
+ #### `update_ai_copilot`
1794
+
1795
+ This endpoint updates an existing AI copilot's configuration. Corresponds to [`liveblocks.updateAiCopilot`](https://liveblocks.io/docs/api-reference/liveblocks-node#update-ai-copilot).
1796
+
1797
+ This endpoint returns a 422 response if the update doesn't apply due to validation failures. For example, if the existing copilot uses the "openai" provider and you attempt to update the provider model to an incompatible value for the provider, like "gemini-2.5-pro", you'll receive a 422 response with an error message explaining where the validation failed.
1798
+
1799
+ **Example**
1800
+ ```python
1801
+ from liveblocks.models import UpdateAiCopilotRequestBody
1802
+
1803
+ result = client.update_ai_copilot(
1804
+ copilot_id="cp_abc123",
1805
+ body=UpdateAiCopilotRequestBody(
1806
+ # name="...",
1807
+ # description="...",
1808
+ # system_prompt="...",
1809
+ ),
1810
+ )
1811
+ print(result)
1812
+ ```
1813
+ **Parameters:**
1814
+
1815
+ | Name | Type | Required | Description |
1816
+ |------|------|----------|-------------|
1817
+ | `copilot_id` | `str` | Yes | ID of the AI copilot |
1818
+ | `body` | `UpdateAiCopilotRequestBody` | Yes | Request body (application/json) |
1819
+
1820
+
1821
+ ---
1822
+
1823
+ #### `delete_ai_copilot`
1824
+
1825
+ This endpoint deletes an AI copilot by its ID. A deleted copilot is no longer accessible and cannot be restored. Corresponds to [`liveblocks.deleteAiCopilot`](https://liveblocks.io/docs/api-reference/liveblocks-node#delete-ai-copilot).
1826
+
1827
+ **Example**
1828
+ ```python
1829
+ client.delete_ai_copilot(
1830
+ copilot_id="cp_abc123",
1831
+ )
1832
+ ```
1833
+ **Parameters:**
1834
+
1835
+ | Name | Type | Required | Description |
1836
+ |------|------|----------|-------------|
1837
+ | `copilot_id` | `str` | Yes | ID of the AI copilot |
1838
+
1839
+
1840
+ ---
1841
+
1842
+ #### `get_knowledge_sources`
1843
+
1844
+ This endpoint returns a paginated list of knowledge sources for a specific AI copilot. Corresponds to [`liveblocks.getKnowledgeSources`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-knowledge-sources).
1845
+
1846
+ **Example**
1847
+ ```python
1848
+ result = client.get_knowledge_sources(
1849
+ copilot_id="cp_abc123",
1850
+ # limit=20,
1851
+ # starting_after="eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
1852
+ )
1853
+ print(result)
1854
+ ```
1855
+ **Parameters:**
1856
+
1857
+ | Name | Type | Required | Description |
1858
+ |------|------|----------|-------------|
1859
+ | `copilot_id` | `str` | Yes | ID of the AI copilot |
1860
+ | `limit` | `int \| Unset` | No | A limit on the number of knowledge sources to be returned. The limit can range between 1 and 100, and defaults to 20. *(default: `20`)* |
1861
+ | `starting_after` | `str \| Unset` | No | A cursor used for pagination. Get the value from the `nextCursor` response of the previous page. |
1862
+
1863
+
1864
+ ---
1865
+
1866
+ #### `get_knowledge_source`
1867
+
1868
+ This endpoint returns a specific knowledge source by its ID. Corresponds to [`liveblocks.getKnowledgeSource`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-knowledge-source).
1869
+
1870
+ **Example**
1871
+ ```python
1872
+ result = client.get_knowledge_source(
1873
+ copilot_id="cp_abc123",
1874
+ knowledge_source_id="ks_abc123",
1875
+ )
1876
+ print(result)
1877
+ ```
1878
+ **Parameters:**
1879
+
1880
+ | Name | Type | Required | Description |
1881
+ |------|------|----------|-------------|
1882
+ | `copilot_id` | `str` | Yes | ID of the AI copilot |
1883
+ | `knowledge_source_id` | `str` | Yes | ID of the knowledge source |
1884
+
1885
+
1886
+ ---
1887
+
1888
+ #### `create_web_knowledge_source`
1889
+
1890
+ This endpoint creates a web knowledge source for an AI copilot. This allows the copilot to access and learn from web content. Corresponds to [`liveblocks.createWebKnowledgeSource`](https://liveblocks.io/docs/api-reference/liveblocks-node#create-web-knowledge-source).
1891
+
1892
+ **Example**
1893
+ ```python
1894
+ from liveblocks.models import CreateWebKnowledgeSourceRequestBody
1895
+
1896
+ result = client.create_web_knowledge_source(
1897
+ copilot_id="cp_abc123",
1898
+ body=CreateWebKnowledgeSourceRequestBody(
1899
+ copilot_id="...",
1900
+ url="...",
1901
+ type_=...,
1902
+ ),
1903
+ )
1904
+ print(result)
1905
+ ```
1906
+ **Parameters:**
1907
+
1908
+ | Name | Type | Required | Description |
1909
+ |------|------|----------|-------------|
1910
+ | `copilot_id` | `str` | Yes | ID of the AI copilot |
1911
+ | `body` | `CreateWebKnowledgeSourceRequestBody` | Yes | Request body (application/json) |
1912
+
1913
+
1914
+ ---
1915
+
1916
+ #### `create_file_knowledge_source`
1917
+
1918
+ This endpoint creates a file knowledge source for an AI copilot by uploading a file. The copilot can then reference the content of the file when responding. Corresponds to [`liveblocks.createFileKnowledgeSource`](https://liveblocks.io/docs/api-reference/liveblocks-node#create-file-knowledge-source).
1919
+
1920
+ **Example**
1921
+ ```python
1922
+ result = client.create_file_knowledge_source(
1923
+ copilot_id="cp_abc123",
1924
+ name="document.pdf",
1925
+ body=...,
1926
+ )
1927
+ print(result)
1928
+ ```
1929
+ **Parameters:**
1930
+
1931
+ | Name | Type | Required | Description |
1932
+ |------|------|----------|-------------|
1933
+ | `copilot_id` | `str` | Yes | ID of the AI copilot |
1934
+ | `name` | `str` | Yes | Name of the file |
1935
+ | `body` | `File` | Yes | Request body (application/octet-stream) |
1936
+
1937
+
1938
+ ---
1939
+
1940
+ #### `get_file_knowledge_source_markdown`
1941
+
1942
+ This endpoint returns the content of a file knowledge source as markdown. This allows you to see what content the AI copilot has access to from uploaded files. Corresponds to [`liveblocks.getFileKnowledgeSourceMarkdown`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-file-knowledge-source-markdown).
1943
+
1944
+ **Example**
1945
+ ```python
1946
+ result = client.get_file_knowledge_source_markdown(
1947
+ copilot_id="cp_abc123",
1948
+ knowledge_source_id="ks_abc123",
1949
+ )
1950
+ print(result)
1951
+ ```
1952
+ **Parameters:**
1953
+
1954
+ | Name | Type | Required | Description |
1955
+ |------|------|----------|-------------|
1956
+ | `copilot_id` | `str` | Yes | ID of the AI copilot |
1957
+ | `knowledge_source_id` | `str` | Yes | ID of the knowledge source |
1958
+
1959
+
1960
+ ---
1961
+
1962
+ #### `delete_file_knowledge_source`
1963
+
1964
+ This endpoint deletes a file knowledge source from an AI copilot. The copilot will no longer have access to the content from this file. Corresponds to [`liveblocks.deleteFileKnowledgeSource`](https://liveblocks.io/docs/api-reference/liveblocks-node#delete-file-knowledge-source).
1965
+
1966
+ **Example**
1967
+ ```python
1968
+ client.delete_file_knowledge_source(
1969
+ copilot_id="cp_abc123",
1970
+ knowledge_source_id="ks_abc123",
1971
+ )
1972
+ ```
1973
+ **Parameters:**
1974
+
1975
+ | Name | Type | Required | Description |
1976
+ |------|------|----------|-------------|
1977
+ | `copilot_id` | `str` | Yes | ID of the AI copilot |
1978
+ | `knowledge_source_id` | `str` | Yes | ID of the knowledge source |
1979
+
1980
+
1981
+ ---
1982
+
1983
+ #### `delete_web_knowledge_source`
1984
+
1985
+ This endpoint deletes a web knowledge source from an AI copilot. The copilot will no longer have access to the content from this source. Corresponds to [`liveblocks.deleteWebKnowledgeSource`](https://liveblocks.io/docs/api-reference/liveblocks-node#delete-web-knowledge-source).
1986
+
1987
+ **Example**
1988
+ ```python
1989
+ client.delete_web_knowledge_source(
1990
+ copilot_id="cp_abc123",
1991
+ knowledge_source_id="ks_abc123",
1992
+ )
1993
+ ```
1994
+ **Parameters:**
1995
+
1996
+ | Name | Type | Required | Description |
1997
+ |------|------|----------|-------------|
1998
+ | `copilot_id` | `str` | Yes | ID of the AI copilot |
1999
+ | `knowledge_source_id` | `str` | Yes | ID of the knowledge source |
2000
+
2001
+
2002
+ ---
2003
+
2004
+ #### `get_web_knowledge_source_links`
2005
+
2006
+ This endpoint returns a paginated list of links that were indexed from a web knowledge source. This is useful for understanding what content the AI copilot has access to from web sources. Corresponds to [`liveblocks.getWebKnowledgeSourceLinks`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-web-knowledge-source-links).
2007
+
2008
+ **Example**
2009
+ ```python
2010
+ result = client.get_web_knowledge_source_links(
2011
+ copilot_id="cp_abc123",
2012
+ knowledge_source_id="ks_abc123",
2013
+ # limit=20,
2014
+ # starting_after="eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
2015
+ )
2016
+ print(result)
2017
+ ```
2018
+ **Parameters:**
2019
+
2020
+ | Name | Type | Required | Description |
2021
+ |------|------|----------|-------------|
2022
+ | `copilot_id` | `str` | Yes | ID of the AI copilot |
2023
+ | `knowledge_source_id` | `str` | Yes | ID of the knowledge source |
2024
+ | `limit` | `int \| Unset` | No | A limit on the number of links to be returned. The limit can range between 1 and 100, and defaults to 20. *(default: `20`)* |
2025
+ | `starting_after` | `str \| Unset` | No | A cursor used for pagination. Get the value from the `nextCursor` response of the previous page. |
2026
+
2027
+
2028
+ ---
2029
+
2030
+ ### Management
2031
+
2032
+ #### `get_management_projects`
2033
+
2034
+ Returns a paginated list of projects. You can limit the number of projects returned per page and use the provided `nextCursor` for pagination. This endpoint requires the `read:all` scope.
2035
+
2036
+ **Example**
2037
+ ```python
2038
+ result = client.get_management_projects(
2039
+ # limit=20,
2040
+ # cursor="eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
2041
+ )
2042
+ print(result)
2043
+ ```
2044
+ **Parameters:**
2045
+
2046
+ | Name | Type | Required | Description |
2047
+ |------|------|----------|-------------|
2048
+ | `limit` | `int \| Unset` | No | A limit on the number of projects to return. The limit can range between 1 and 100, and defaults to 20. *(default: `20`)* |
2049
+ | `cursor` | `str \| Unset` | No | A cursor used for pagination. Get the value from the `nextCursor` response of the previous page. |
2050
+
2051
+
2052
+ ---
2053
+
2054
+ #### `create_management_project`
2055
+
2056
+ Creates a new project within your account. This endpoint requires the `write:all` scope. You can specify the project type, name, and version creation timeout. Upon success, returns information about the newly created project, including its ID, keys, region, and settings.
2057
+
2058
+ **Example**
2059
+ ```python
2060
+ from liveblocks.models import CreateManagementProjectRequestBody
2061
+
2062
+ result = client.create_management_project(
2063
+ body=CreateManagementProjectRequestBody(
2064
+ type_=...,
2065
+ # name="...",
2066
+ # version_creation_timeout=False,
2067
+ ),
2068
+ )
2069
+ print(result)
2070
+ ```
2071
+ **Parameters:**
2072
+
2073
+ | Name | Type | Required | Description |
2074
+ |------|------|----------|-------------|
2075
+ | `body` | `CreateManagementProjectRequestBody` | Yes | Request body (application/json) |
2076
+
2077
+
2078
+ ---
2079
+
2080
+ #### `get_management_project`
2081
+
2082
+ Returns a single project specified by its ID. This endpoint requires the `read:all` scope. If the project cannot be found, a 404 error response is returned.
2083
+
2084
+ **Example**
2085
+ ```python
2086
+ result = client.get_management_project(
2087
+ project_id="683d49ed6b4d1cec5a597b13",
2088
+ )
2089
+ print(result)
2090
+ ```
2091
+ **Parameters:**
2092
+
2093
+ | Name | Type | Required | Description |
2094
+ |------|------|----------|-------------|
2095
+ | `project_id` | `str` | Yes | ID of the project |
2096
+
2097
+
2098
+ ---
2099
+
2100
+ #### `update_management_project`
2101
+
2102
+ Updates an existing project specified by its ID. This endpoint allows you to modify project details such as the project name and the version creation timeout. The `versionCreationTimeout` can be set to `false` to disable the timeout or to a number of seconds between 30 and 300. Fields omitted from the request body will not be updated. Requires the `write:all` scope.
2103
+
2104
+ If the project cannot be found, a 404 error response is returned.
2105
+
2106
+ **Example**
2107
+ ```python
2108
+ from liveblocks.models import UpdateManagementProjectRequestBody
2109
+
2110
+ result = client.update_management_project(
2111
+ project_id="683d49ed6b4d1cec5a597b13",
2112
+ body=UpdateManagementProjectRequestBody(
2113
+ # name="...",
2114
+ # version_creation_timeout=False,
2115
+ ),
2116
+ )
2117
+ print(result)
2118
+ ```
2119
+ **Parameters:**
2120
+
2121
+ | Name | Type | Required | Description |
2122
+ |------|------|----------|-------------|
2123
+ | `project_id` | `str` | Yes | ID of the project |
2124
+ | `body` | `UpdateManagementProjectRequestBody` | Yes | Request body (application/json) |
2125
+
2126
+
2127
+ ---
2128
+
2129
+ #### `delete_management_project`
2130
+
2131
+ Soft deletes the project specified by its ID. This endpoint requires the `write:all` scope. If the project cannot be found, a 404 error response is returned.
2132
+
2133
+ **Example**
2134
+ ```python
2135
+ client.delete_management_project(
2136
+ project_id="683d49ed6b4d1cec5a597b13",
2137
+ )
2138
+ ```
2139
+ **Parameters:**
2140
+
2141
+ | Name | Type | Required | Description |
2142
+ |------|------|----------|-------------|
2143
+ | `project_id` | `str` | Yes | ID of the project |
2144
+
2145
+
2146
+ ---
2147
+
2148
+ #### `activate_project_public_api_key`
2149
+
2150
+ Activates the public API key associated with the specified project. This endpoint requires the `write:all` scope. If the project cannot be found, a 404 error response is returned.
2151
+
2152
+ **Example**
2153
+ ```python
2154
+ client.activate_project_public_api_key(
2155
+ project_id="683d49ed6b4d1cec5a597b13",
2156
+ )
2157
+ ```
2158
+ **Parameters:**
2159
+
2160
+ | Name | Type | Required | Description |
2161
+ |------|------|----------|-------------|
2162
+ | `project_id` | `str` | Yes | ID of the project |
2163
+
2164
+
2165
+ ---
2166
+
2167
+ #### `deactivate_project_public_api_key`
2168
+
2169
+ Deactivates the public API key associated with the specified project. This endpoint requires the `write:all` scope. If the project cannot be found, a 404 error response is returned.
2170
+
2171
+ **Example**
2172
+ ```python
2173
+ client.deactivate_project_public_api_key(
2174
+ project_id="683d49ed6b4d1cec5a597b13",
2175
+ )
2176
+ ```
2177
+ **Parameters:**
2178
+
2179
+ | Name | Type | Required | Description |
2180
+ |------|------|----------|-------------|
2181
+ | `project_id` | `str` | Yes | ID of the project |
2182
+
2183
+
2184
+ ---
2185
+
2186
+ #### `roll_project_public_api_key`
2187
+
2188
+ Rolls (rotates) the public API key associated with the specified project, generating a new key value while deprecating the previous one. The new key becomes immediately active. This endpoint requires the `write:all` scope.
2189
+
2190
+ If the public key is not currently enabled for the project, a 403 error response is returned. If the project cannot be found, a 404 error response is returned. An optional `expirationIn` parameter can be provided in the request body to set when the previous key should expire.
2191
+
2192
+ **Example**
2193
+ ```python
2194
+ result = client.roll_project_public_api_key(
2195
+ project_id="683d49ed6b4d1cec5a597b13",
2196
+ )
2197
+ print(result)
2198
+ ```
2199
+ **Parameters:**
2200
+
2201
+ | Name | Type | Required | Description |
2202
+ |------|------|----------|-------------|
2203
+ | `project_id` | `str` | Yes | ID of the project |
2204
+ | `body` | `RollProjectPublicApiKeyRequestBody \| Unset` | No | Request body (application/json) |
2205
+
2206
+
2207
+ ---
2208
+
2209
+ #### `roll_project_secret_api_key`
2210
+
2211
+ Rolls (rotates) the secret API key associated with the specified project, generating a new key value while deprecating the previous one. The new key becomes immediately active. This endpoint requires the `write:all` scope.
2212
+
2213
+ If the project cannot be found, a 404 error response is returned. An optional `expirationIn` parameter can be provided in the request body to set when the previous key should expire.
2214
+
2215
+ **Example**
2216
+ ```python
2217
+ result = client.roll_project_secret_api_key(
2218
+ project_id="683d49ed6b4d1cec5a597b13",
2219
+ )
2220
+ print(result)
2221
+ ```
2222
+ **Parameters:**
2223
+
2224
+ | Name | Type | Required | Description |
2225
+ |------|------|----------|-------------|
2226
+ | `project_id` | `str` | Yes | ID of the project |
2227
+ | `body` | `RollProjectSecretApiKeyRequestBody \| Unset` | No | Request body (application/json) |
2228
+
2229
+
2230
+ ---
2231
+
2232
+ #### `get_management_webhooks`
2233
+
2234
+ Returns a paginated list of webhooks for a project. This endpoint requires the `read:all` scope. The response includes an array of webhook objects associated with the specified project, as well as a `nextCursor` property for pagination. Use the `limit` query parameter to specify the maximum number of webhooks to return (1-100, default 20). If the result is paginated, use the `cursor` parameter from the `nextCursor` value in the previous response to fetch subsequent pages. If the project cannot be found, a 404 error response is returned.
2235
+
2236
+ **Example**
2237
+ ```python
2238
+ result = client.get_management_webhooks(
2239
+ project_id="683d49ed6b4d1cec5a597b13",
2240
+ # limit=20,
2241
+ # cursor="eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
2242
+ )
2243
+ print(result)
2244
+ ```
2245
+ **Parameters:**
2246
+
2247
+ | Name | Type | Required | Description |
2248
+ |------|------|----------|-------------|
2249
+ | `project_id` | `str` | Yes | ID of the project |
2250
+ | `limit` | `int \| Unset` | No | A limit on the number of webhooks to return. The limit can range between 1 and 100, and defaults to 20. *(default: `20`)* |
2251
+ | `cursor` | `str \| Unset` | No | A cursor used for pagination. Get the value from the `nextCursor` response of the previous page. |
2252
+
2253
+
2254
+ ---
2255
+
2256
+ #### `create_management_webhook`
2257
+
2258
+ Creates a new webhook for a project. This endpoint requires the `write:all` scope. If the project cannot be found, a 404 error response is returned.
2259
+
2260
+ **Example**
2261
+ ```python
2262
+ from liveblocks.models import CreateManagementWebhookRequestBody
2263
+
2264
+ result = client.create_management_webhook(
2265
+ project_id="683d49ed6b4d1cec5a597b13",
2266
+ body=CreateManagementWebhookRequestBody(
2267
+ url="...",
2268
+ subscribed_events=[],
2269
+ # rate_limit=0,
2270
+ # additional_headers=...,
2271
+ # storage_updated_throttle_seconds=0,
2272
+ ),
2273
+ )
2274
+ print(result)
2275
+ ```
2276
+ **Parameters:**
2277
+
2278
+ | Name | Type | Required | Description |
2279
+ |------|------|----------|-------------|
2280
+ | `project_id` | `str` | Yes | ID of the project |
2281
+ | `body` | `CreateManagementWebhookRequestBody` | Yes | Request body (application/json) |
2282
+
2283
+
2284
+ ---
2285
+
2286
+ #### `get_management_webhook`
2287
+
2288
+ Get one webhook by `webhookId` for a project. Returns webhook settings such as URL, subscribed events, disabled state, throttling, and additional headers. Returns `404` if the project or webhook does not exist. This endpoint requires the `read:all` scope.
2289
+
2290
+ **Example**
2291
+ ```python
2292
+ result = client.get_management_webhook(
2293
+ project_id="683d49ed6b4d1cec5a597b13",
2294
+ webhook_id="wh_abc123",
2295
+ )
2296
+ print(result)
2297
+ ```
2298
+ **Parameters:**
2299
+
2300
+ | Name | Type | Required | Description |
2301
+ |------|------|----------|-------------|
2302
+ | `project_id` | `str` | Yes | ID of the project |
2303
+ | `webhook_id` | `str` | Yes | ID of the webhook |
2304
+
2305
+
2306
+ ---
2307
+
2308
+ #### `update_management_webhook`
2309
+
2310
+ Update one webhook by `webhookId` for a project. Send only fields you want to change; omitted fields stay unchanged. Returns `404` if the project or webhook does not exist and `422` for validation errors. This endpoint requires the `write:all` scope.
2311
+
2312
+ **Example**
2313
+ ```python
2314
+ from liveblocks.models import UpdateManagementWebhookRequestBody
2315
+
2316
+ result = client.update_management_webhook(
2317
+ project_id="683d49ed6b4d1cec5a597b13",
2318
+ webhook_id="wh_abc123",
2319
+ body=UpdateManagementWebhookRequestBody(
2320
+ # url="...",
2321
+ # subscribed_events=[],
2322
+ # rate_limit=0,
2323
+ ),
2324
+ )
2325
+ print(result)
2326
+ ```
2327
+ **Parameters:**
2328
+
2329
+ | Name | Type | Required | Description |
2330
+ |------|------|----------|-------------|
2331
+ | `project_id` | `str` | Yes | ID of the project |
2332
+ | `webhook_id` | `str` | Yes | ID of the webhook |
2333
+ | `body` | `UpdateManagementWebhookRequestBody` | Yes | Request body (application/json) |
2334
+
2335
+
2336
+ ---
2337
+
2338
+ #### `delete_management_webhook`
2339
+
2340
+ Delete one webhook by `webhookId` for a project. Returns `200` with an empty body on success, or `404` if the project or webhook does not exist. Requires `write:all`.
2341
+
2342
+ **Example**
2343
+ ```python
2344
+ client.delete_management_webhook(
2345
+ project_id="683d49ed6b4d1cec5a597b13",
2346
+ webhook_id="wh_abc123",
2347
+ )
2348
+ ```
2349
+ **Parameters:**
2350
+
2351
+ | Name | Type | Required | Description |
2352
+ |------|------|----------|-------------|
2353
+ | `project_id` | `str` | Yes | ID of the project |
2354
+ | `webhook_id` | `str` | Yes | ID of the webhook |
2355
+
2356
+
2357
+ ---
2358
+
2359
+ #### `roll_management_webhook_secret`
2360
+
2361
+ Rotate a webhook signing secret and return the new secret. The previous secret remains valid for 24 hours. Returns `404` if the project or webhook does not exist. This endpoint requires the `write:all` scope.
2362
+
2363
+ **Example**
2364
+ ```python
2365
+ result = client.roll_management_webhook_secret(
2366
+ project_id="683d49ed6b4d1cec5a597b13",
2367
+ webhook_id="wh_abc123",
2368
+ )
2369
+ print(result)
2370
+ ```
2371
+ **Parameters:**
2372
+
2373
+ | Name | Type | Required | Description |
2374
+ |------|------|----------|-------------|
2375
+ | `project_id` | `str` | Yes | ID of the project |
2376
+ | `webhook_id` | `str` | Yes | ID of the webhook |
2377
+
2378
+
2379
+ ---
2380
+
2381
+ #### `get_management_webhook_additional_headers`
2382
+
2383
+ Get a webhook's additional headers. Returns `404` if the project or webhook does not exist. Requires `read:all`.
2384
+
2385
+ **Example**
2386
+ ```python
2387
+ result = client.get_management_webhook_additional_headers(
2388
+ project_id="683d49ed6b4d1cec5a597b13",
2389
+ webhook_id="wh_abc123",
2390
+ )
2391
+ print(result)
2392
+ ```
2393
+ **Parameters:**
2394
+
2395
+ | Name | Type | Required | Description |
2396
+ |------|------|----------|-------------|
2397
+ | `project_id` | `str` | Yes | ID of the project |
2398
+ | `webhook_id` | `str` | Yes | ID of the webhook |
2399
+
2400
+
2401
+ ---
2402
+
2403
+ #### `upsert_management_webhook_additional_headers`
2404
+
2405
+ Upsert additional headers for a webhook. Provided headers are merged with existing headers, and existing values are overwritten when names match. Returns updated headers, or `404` if the project or webhook does not exist. This endpoint requires the `write:all` scope.
2406
+
2407
+ **Example**
2408
+ ```python
2409
+ from liveblocks.models import UpsertManagementWebhookHeadersRequestBody
2410
+
2411
+ result = client.upsert_management_webhook_additional_headers(
2412
+ project_id="683d49ed6b4d1cec5a597b13",
2413
+ webhook_id="wh_abc123",
2414
+ body=UpsertManagementWebhookHeadersRequestBody(
2415
+ headers=...,
2416
+ ),
2417
+ )
2418
+ print(result)
2419
+ ```
2420
+ **Parameters:**
2421
+
2422
+ | Name | Type | Required | Description |
2423
+ |------|------|----------|-------------|
2424
+ | `project_id` | `str` | Yes | ID of the project |
2425
+ | `webhook_id` | `str` | Yes | ID of the webhook |
2426
+ | `body` | `UpsertManagementWebhookHeadersRequestBody` | Yes | Request body (application/json) |
2427
+
2428
+
2429
+ ---
2430
+
2431
+ #### `delete_management_webhook_additional_headers`
2432
+
2433
+ Remove selected additional headers from a webhook. Send header names in `headers` field; other headers are unchanged. Returns updated headers, or `404` if the project or webhook does not exist. This endpoint requires the `write:all` scope. At least one header name must be provided; otherwise, a 422 error response is returned.
2434
+
2435
+ **Example**
2436
+ ```python
2437
+ from liveblocks.models import DeleteManagementWebhookHeadersRequestBody
2438
+
2439
+ result = client.delete_management_webhook_additional_headers(
2440
+ project_id="683d49ed6b4d1cec5a597b13",
2441
+ webhook_id="wh_abc123",
2442
+ body=DeleteManagementWebhookHeadersRequestBody(
2443
+ headers=[],
2444
+ ),
2445
+ )
2446
+ print(result)
2447
+ ```
2448
+ **Parameters:**
2449
+
2450
+ | Name | Type | Required | Description |
2451
+ |------|------|----------|-------------|
2452
+ | `project_id` | `str` | Yes | ID of the project |
2453
+ | `webhook_id` | `str` | Yes | ID of the webhook |
2454
+ | `body` | `DeleteManagementWebhookHeadersRequestBody` | Yes | Request body (application/json) |
2455
+
2456
+
2457
+ ---
2458
+
2459
+ #### `recover_failed_webhook_messages`
2460
+
2461
+ Requeue failed deliveries for a webhook from the given `since` timestamp. Returns `200` with an empty body when recovery starts, an `404` if the project or webhook does not exist. This endpoint requires the `write:all` scope.
2462
+
2463
+ **Example**
2464
+ ```python
2465
+ from liveblocks.models import RecoverManagementWebhookFailedMessagesRequestBody
2466
+
2467
+ client.recover_failed_webhook_messages(
2468
+ project_id="683d49ed6b4d1cec5a597b13",
2469
+ webhook_id="wh_abc123",
2470
+ body=RecoverManagementWebhookFailedMessagesRequestBody(
2471
+ since=...,
2472
+ ),
2473
+ )
2474
+ ```
2475
+ **Parameters:**
2476
+
2477
+ | Name | Type | Required | Description |
2478
+ |------|------|----------|-------------|
2479
+ | `project_id` | `str` | Yes | ID of the project |
2480
+ | `webhook_id` | `str` | Yes | ID of the webhook |
2481
+ | `body` | `RecoverManagementWebhookFailedMessagesRequestBody` | Yes | Request body (application/json) |
2482
+
2483
+
2484
+ ---
2485
+
2486
+ #### `send_test_webhook`
2487
+
2488
+ Send a test event to a webhook and return the created message metadata. `subscribedEvent` must be one of the webhook's subscribed events, otherwise the endpoint returns `422`. Returns `404` if the project or webhook does not exist. This endpoint requires the `write:all` scope.
2489
+
2490
+ **Example**
2491
+ ```python
2492
+ from liveblocks.models import TestManagementWebhookRequestBody
2493
+
2494
+ result = client.send_test_webhook(
2495
+ project_id="683d49ed6b4d1cec5a597b13",
2496
+ webhook_id="wh_abc123",
2497
+ body=TestManagementWebhookRequestBody(
2498
+ subscribed_event=...,
2499
+ ),
2500
+ )
2501
+ print(result)
2502
+ ```
2503
+ **Parameters:**
2504
+
2505
+ | Name | Type | Required | Description |
2506
+ |------|------|----------|-------------|
2507
+ | `project_id` | `str` | Yes | ID of the project |
2508
+ | `webhook_id` | `str` | Yes | ID of the webhook |
2509
+ | `body` | `TestManagementWebhookRequestBody` | Yes | Request body (application/json) |
2510
+
2511
+
2512
+ ---
2513
+
2514
+
2515
+ ## Error Handling
2516
+
2517
+ All API methods raise `errors.LiveblocksError` when the server returns a non-2xx status code. You can catch and inspect these errors:
2518
+
2519
+ ```python
2520
+ from liveblocks import errors, Liveblocks
2521
+
2522
+ client = Liveblocks(secret="sk_your_secret_key")
2523
+
2524
+ with client:
2525
+ try:
2526
+ room = client.get_room(room_id="my-room")
2527
+ except errors.LiveblocksError as e:
2528
+ print(f"API error: {e}")
2529
+ ```
2530
+
2531
+ Methods also raise `httpx.TimeoutException` if the request exceeds the timeout.