liveblocks 3.15.3__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.
- liveblocks-3.15.3/PKG-INFO +2593 -0
- liveblocks-3.15.3/README.md +2583 -0
- liveblocks-3.15.3/liveblocks/__init__.py +12 -0
- liveblocks-3.15.3/liveblocks/api/__init__.py +1 -0
- liveblocks-3.15.3/liveblocks/api/ai/__init__.py +1 -0
- liveblocks-3.15.3/liveblocks/api/ai/create_ai_copilot.py +124 -0
- liveblocks-3.15.3/liveblocks/api/ai/create_file_knowledge_source.py +80 -0
- liveblocks-3.15.3/liveblocks/api/ai/create_web_knowledge_source.py +74 -0
- liveblocks-3.15.3/liveblocks/api/ai/delete_ai_copilot.py +58 -0
- liveblocks-3.15.3/liveblocks/api/ai/delete_file_knowledge_source.py +64 -0
- liveblocks-3.15.3/liveblocks/api/ai/delete_web_knowledge_source.py +64 -0
- liveblocks-3.15.3/liveblocks/api/ai/get_ai_copilot.py +100 -0
- liveblocks-3.15.3/liveblocks/api/ai/get_ai_copilots.py +74 -0
- liveblocks-3.15.3/liveblocks/api/ai/get_file_knowledge_source_markdown.py +67 -0
- liveblocks-3.15.3/liveblocks/api/ai/get_knowledge_source.py +84 -0
- liveblocks-3.15.3/liveblocks/api/ai/get_knowledge_sources.py +82 -0
- liveblocks-3.15.3/liveblocks/api/ai/get_web_knowledge_source_links.py +88 -0
- liveblocks-3.15.3/liveblocks/api/ai/update_ai_copilot.py +113 -0
- liveblocks-3.15.3/liveblocks/api/auth/__init__.py +1 -0
- liveblocks-3.15.3/liveblocks/api/auth/authorize_user.py +66 -0
- liveblocks-3.15.3/liveblocks/api/auth/identify_user.py +66 -0
- liveblocks-3.15.3/liveblocks/api/comments/__init__.py +1 -0
- liveblocks-3.15.3/liveblocks/api/comments/add_comment_reaction.py +86 -0
- liveblocks-3.15.3/liveblocks/api/comments/create_comment.py +80 -0
- liveblocks-3.15.3/liveblocks/api/comments/create_thread.py +74 -0
- liveblocks-3.15.3/liveblocks/api/comments/delete_comment.py +70 -0
- liveblocks-3.15.3/liveblocks/api/comments/delete_thread.py +64 -0
- liveblocks-3.15.3/liveblocks/api/comments/edit_comment.py +86 -0
- liveblocks-3.15.3/liveblocks/api/comments/edit_comment_metadata.py +86 -0
- liveblocks-3.15.3/liveblocks/api/comments/edit_thread_metadata.py +80 -0
- liveblocks-3.15.3/liveblocks/api/comments/get_comment.py +73 -0
- liveblocks-3.15.3/liveblocks/api/comments/get_thread.py +67 -0
- liveblocks-3.15.3/liveblocks/api/comments/get_thread_inbox_notifications.py +67 -0
- liveblocks-3.15.3/liveblocks/api/comments/get_thread_participants.py +0 -0
- liveblocks-3.15.3/liveblocks/api/comments/get_thread_subscriptions.py +67 -0
- liveblocks-3.15.3/liveblocks/api/comments/get_threads.py +75 -0
- liveblocks-3.15.3/liveblocks/api/comments/mark_thread_as_resolved.py +80 -0
- liveblocks-3.15.3/liveblocks/api/comments/mark_thread_as_unresolved.py +80 -0
- liveblocks-3.15.3/liveblocks/api/comments/remove_comment_reaction.py +85 -0
- liveblocks-3.15.3/liveblocks/api/comments/subscribe_to_thread.py +80 -0
- liveblocks-3.15.3/liveblocks/api/comments/unsubscribe_from_thread.py +77 -0
- liveblocks-3.15.3/liveblocks/api/groups/__init__.py +1 -0
- liveblocks-3.15.3/liveblocks/api/groups/add_group_members.py +74 -0
- liveblocks-3.15.3/liveblocks/api/groups/create_group.py +68 -0
- liveblocks-3.15.3/liveblocks/api/groups/delete_group.py +58 -0
- liveblocks-3.15.3/liveblocks/api/groups/get_group.py +61 -0
- liveblocks-3.15.3/liveblocks/api/groups/get_groups.py +74 -0
- liveblocks-3.15.3/liveblocks/api/groups/get_user_groups.py +82 -0
- liveblocks-3.15.3/liveblocks/api/groups/remove_group_members.py +74 -0
- liveblocks-3.15.3/liveblocks/api/management/__init__.py +1 -0
- liveblocks-3.15.3/liveblocks/api/management/activate_project_public_api_key.py +58 -0
- liveblocks-3.15.3/liveblocks/api/management/create_management_project.py +66 -0
- liveblocks-3.15.3/liveblocks/api/management/create_management_webhook.py +74 -0
- liveblocks-3.15.3/liveblocks/api/management/deactivate_project_public_api_key.py +58 -0
- liveblocks-3.15.3/liveblocks/api/management/delete_management_project.py +58 -0
- liveblocks-3.15.3/liveblocks/api/management/delete_management_webhook.py +64 -0
- liveblocks-3.15.3/liveblocks/api/management/delete_management_webhook_additional_headers.py +80 -0
- liveblocks-3.15.3/liveblocks/api/management/get_management_project.py +61 -0
- liveblocks-3.15.3/liveblocks/api/management/get_management_projects.py +74 -0
- liveblocks-3.15.3/liveblocks/api/management/get_management_webhook.py +67 -0
- liveblocks-3.15.3/liveblocks/api/management/get_management_webhook_additional_headers.py +67 -0
- liveblocks-3.15.3/liveblocks/api/management/get_management_webhooks.py +82 -0
- liveblocks-3.15.3/liveblocks/api/management/recover_failed_webhook_messages.py +79 -0
- liveblocks-3.15.3/liveblocks/api/management/roll_management_webhook_secret.py +67 -0
- liveblocks-3.15.3/liveblocks/api/management/roll_project_public_api_key.py +76 -0
- liveblocks-3.15.3/liveblocks/api/management/roll_project_secret_api_key.py +78 -0
- liveblocks-3.15.3/liveblocks/api/management/send_test_webhook.py +80 -0
- liveblocks-3.15.3/liveblocks/api/management/update_management_project.py +74 -0
- liveblocks-3.15.3/liveblocks/api/management/update_management_webhook.py +80 -0
- liveblocks-3.15.3/liveblocks/api/management/upsert_management_webhook_additional_headers.py +80 -0
- liveblocks-3.15.3/liveblocks/api/notifications/__init__.py +1 -0
- liveblocks-3.15.3/liveblocks/api/notifications/delete_all_inbox_notifications.py +58 -0
- liveblocks-3.15.3/liveblocks/api/notifications/delete_inbox_notification.py +64 -0
- liveblocks-3.15.3/liveblocks/api/notifications/delete_notification_settings.py +58 -0
- liveblocks-3.15.3/liveblocks/api/notifications/delete_room_notification_settings.py +0 -0
- liveblocks-3.15.3/liveblocks/api/notifications/delete_room_subscription_settings.py +64 -0
- liveblocks-3.15.3/liveblocks/api/notifications/get_inbox_notification.py +84 -0
- liveblocks-3.15.3/liveblocks/api/notifications/get_inbox_notifications.py +96 -0
- liveblocks-3.15.3/liveblocks/api/notifications/get_notification_settings.py +61 -0
- liveblocks-3.15.3/liveblocks/api/notifications/get_room_notification_settings.py +0 -0
- liveblocks-3.15.3/liveblocks/api/notifications/get_room_subscription_settings.py +67 -0
- liveblocks-3.15.3/liveblocks/api/notifications/get_user_room_subscription_settings.py +89 -0
- liveblocks-3.15.3/liveblocks/api/notifications/mark_inbox_notification_as_read.py +58 -0
- liveblocks-3.15.3/liveblocks/api/notifications/trigger_inbox_notification.py +65 -0
- liveblocks-3.15.3/liveblocks/api/notifications/update_notification_settings.py +74 -0
- liveblocks-3.15.3/liveblocks/api/notifications/update_room_notification_settings.py +0 -0
- liveblocks-3.15.3/liveblocks/api/notifications/update_room_subscription_settings.py +80 -0
- liveblocks-3.15.3/liveblocks/api/room/__init__.py +1 -0
- liveblocks-3.15.3/liveblocks/api/room/broadcast_event.py +70 -0
- liveblocks-3.15.3/liveblocks/api/room/create_room.py +79 -0
- liveblocks-3.15.3/liveblocks/api/room/delete_room.py +58 -0
- liveblocks-3.15.3/liveblocks/api/room/get_active_users.py +61 -0
- liveblocks-3.15.3/liveblocks/api/room/get_room.py +61 -0
- liveblocks-3.15.3/liveblocks/api/room/get_rooms.py +102 -0
- liveblocks-3.15.3/liveblocks/api/room/prewarm_room.py +58 -0
- liveblocks-3.15.3/liveblocks/api/room/set_presence.py +71 -0
- liveblocks-3.15.3/liveblocks/api/room/update_room.py +74 -0
- liveblocks-3.15.3/liveblocks/api/room/update_room_id.py +76 -0
- liveblocks-3.15.3/liveblocks/api/room/update_room_organization_id.py +76 -0
- liveblocks-3.15.3/liveblocks/api/room/upsert_room.py +74 -0
- liveblocks-3.15.3/liveblocks/api/storage/__init__.py +1 -0
- liveblocks-3.15.3/liveblocks/api/storage/delete_storage_document.py +58 -0
- liveblocks-3.15.3/liveblocks/api/storage/get_storage_document.py +80 -0
- liveblocks-3.15.3/liveblocks/api/storage/initialize_storage_document.py +76 -0
- liveblocks-3.15.3/liveblocks/api/storage/patch_storage_document.py +125 -0
- liveblocks-3.15.3/liveblocks/api/yjs/__init__.py +1 -0
- liveblocks-3.15.3/liveblocks/api/yjs/create_yjs_version.py +61 -0
- liveblocks-3.15.3/liveblocks/api/yjs/get_yjs_document.py +94 -0
- liveblocks-3.15.3/liveblocks/api/yjs/get_yjs_document_as_binary_update.py +75 -0
- liveblocks-3.15.3/liveblocks/api/yjs/get_yjs_version.py +68 -0
- liveblocks-3.15.3/liveblocks/api/yjs/get_yjs_versions.py +82 -0
- liveblocks-3.15.3/liveblocks/api/yjs/send_yjs_binary_update.py +83 -0
- liveblocks-3.15.3/liveblocks/client.py +7002 -0
- liveblocks-3.15.3/liveblocks/errors.py +52 -0
- liveblocks-3.15.3/liveblocks/models/__init__.py +397 -0
- liveblocks-3.15.3/liveblocks/models/active_users_response.py +76 -0
- liveblocks-3.15.3/liveblocks/models/active_users_response_data_item.py +96 -0
- liveblocks-3.15.3/liveblocks/models/active_users_response_data_item_info.py +45 -0
- liveblocks-3.15.3/liveblocks/models/add_comment_reaction_request_body.py +68 -0
- liveblocks-3.15.3/liveblocks/models/add_group_members_request_body.py +62 -0
- liveblocks-3.15.3/liveblocks/models/add_json_patch_operation.py +58 -0
- liveblocks-3.15.3/liveblocks/models/ai_copilot_anthropic.py +192 -0
- liveblocks-3.15.3/liveblocks/models/ai_copilot_base.py +154 -0
- liveblocks-3.15.3/liveblocks/models/ai_copilot_google.py +192 -0
- liveblocks-3.15.3/liveblocks/models/ai_copilot_open_ai.py +173 -0
- liveblocks-3.15.3/liveblocks/models/ai_copilot_open_ai_compatible.py +189 -0
- liveblocks-3.15.3/liveblocks/models/ai_copilot_provider_settings.py +117 -0
- liveblocks-3.15.3/liveblocks/models/anthropic_model.py +13 -0
- liveblocks-3.15.3/liveblocks/models/anthropic_provider_options.py +48 -0
- liveblocks-3.15.3/liveblocks/models/anthropic_provider_options_anthropic.py +120 -0
- liveblocks-3.15.3/liveblocks/models/anthropic_provider_options_anthropic_anthropic_thinking_disabled.py +42 -0
- liveblocks-3.15.3/liveblocks/models/anthropic_provider_options_anthropic_anthropic_thinking_enabled.py +50 -0
- liveblocks-3.15.3/liveblocks/models/anthropic_provider_options_anthropic_anthropic_web_search.py +61 -0
- liveblocks-3.15.3/liveblocks/models/authorization.py +62 -0
- liveblocks-3.15.3/liveblocks/models/authorize_user_request_body.py +87 -0
- liveblocks-3.15.3/liveblocks/models/authorize_user_request_body_permissions.py +52 -0
- liveblocks-3.15.3/liveblocks/models/authorize_user_request_body_user_info.py +45 -0
- liveblocks-3.15.3/liveblocks/models/authorize_user_response.py +43 -0
- liveblocks-3.15.3/liveblocks/models/comment.py +206 -0
- liveblocks-3.15.3/liveblocks/models/comment_attachment.py +77 -0
- liveblocks-3.15.3/liveblocks/models/comment_body.py +65 -0
- liveblocks-3.15.3/liveblocks/models/comment_body_content_item.py +45 -0
- liveblocks-3.15.3/liveblocks/models/comment_metadata.py +59 -0
- liveblocks-3.15.3/liveblocks/models/comment_reaction.py +58 -0
- liveblocks-3.15.3/liveblocks/models/copy_json_patch_operation.py +58 -0
- liveblocks-3.15.3/liveblocks/models/create_ai_copilot_options_anthropic.py +167 -0
- liveblocks-3.15.3/liveblocks/models/create_ai_copilot_options_base.py +110 -0
- liveblocks-3.15.3/liveblocks/models/create_ai_copilot_options_google.py +167 -0
- liveblocks-3.15.3/liveblocks/models/create_ai_copilot_options_open_ai.py +147 -0
- liveblocks-3.15.3/liveblocks/models/create_ai_copilot_options_open_ai_compatible.py +164 -0
- liveblocks-3.15.3/liveblocks/models/create_comment_request_body.py +104 -0
- liveblocks-3.15.3/liveblocks/models/create_file_knowledge_source_response.py +59 -0
- liveblocks-3.15.3/liveblocks/models/create_group_request_body.py +87 -0
- liveblocks-3.15.3/liveblocks/models/create_group_request_body_scopes.py +59 -0
- liveblocks-3.15.3/liveblocks/models/create_management_project_request_body.py +92 -0
- liveblocks-3.15.3/liveblocks/models/create_management_webhook_request_body.py +134 -0
- liveblocks-3.15.3/liveblocks/models/create_management_webhook_request_body_additional_headers.py +45 -0
- liveblocks-3.15.3/liveblocks/models/create_room_request_body.py +149 -0
- liveblocks-3.15.3/liveblocks/models/create_room_request_body_engine.py +9 -0
- liveblocks-3.15.3/liveblocks/models/create_thread_request_body.py +85 -0
- liveblocks-3.15.3/liveblocks/models/create_thread_request_body_comment.py +93 -0
- liveblocks-3.15.3/liveblocks/models/create_web_knowledge_source_request_body.py +80 -0
- liveblocks-3.15.3/liveblocks/models/create_web_knowledge_source_request_body_type.py +7 -0
- liveblocks-3.15.3/liveblocks/models/create_web_knowledge_source_response.py +43 -0
- liveblocks-3.15.3/liveblocks/models/create_yjs_version_response.py +48 -0
- liveblocks-3.15.3/liveblocks/models/create_yjs_version_response_data.py +40 -0
- liveblocks-3.15.3/liveblocks/models/delete_management_webhook_headers_request_body.py +43 -0
- liveblocks-3.15.3/liveblocks/models/delete_management_webhook_headers_response.py +48 -0
- liveblocks-3.15.3/liveblocks/models/edit_comment_metadata_request_body.py +73 -0
- liveblocks-3.15.3/liveblocks/models/edit_comment_metadata_request_body_metadata.py +58 -0
- liveblocks-3.15.3/liveblocks/models/edit_comment_request_body.py +96 -0
- liveblocks-3.15.3/liveblocks/models/edit_thread_metadata_request_body.py +92 -0
- liveblocks-3.15.3/liveblocks/models/edit_thread_metadata_request_body_metadata.py +58 -0
- liveblocks-3.15.3/liveblocks/models/error.py +86 -0
- liveblocks-3.15.3/liveblocks/models/get_ai_copilots_response.py +126 -0
- liveblocks-3.15.3/liveblocks/models/get_file_knowledge_source_markdown_response.py +51 -0
- liveblocks-3.15.3/liveblocks/models/get_groups_response.py +72 -0
- liveblocks-3.15.3/liveblocks/models/get_inbox_notifications_response.py +98 -0
- liveblocks-3.15.3/liveblocks/models/get_knowledge_sources_response.py +98 -0
- liveblocks-3.15.3/liveblocks/models/get_management_projects_response.py +82 -0
- liveblocks-3.15.3/liveblocks/models/get_management_webhook_headers_response.py +48 -0
- liveblocks-3.15.3/liveblocks/models/get_management_webhooks_response.py +81 -0
- liveblocks-3.15.3/liveblocks/models/get_room_subscription_settings_response.py +72 -0
- liveblocks-3.15.3/liveblocks/models/get_rooms_response.py +74 -0
- liveblocks-3.15.3/liveblocks/models/get_storage_document_format.py +6 -0
- liveblocks-3.15.3/liveblocks/models/get_storage_document_response.py +51 -0
- liveblocks-3.15.3/liveblocks/models/get_thread_inbox_notifications_response.py +78 -0
- liveblocks-3.15.3/liveblocks/models/get_thread_inbox_notifications_response_data_item.py +137 -0
- liveblocks-3.15.3/liveblocks/models/get_thread_participants_response.py +0 -0
- liveblocks-3.15.3/liveblocks/models/get_thread_subscriptions_response.py +57 -0
- liveblocks-3.15.3/liveblocks/models/get_threads_response.py +60 -0
- liveblocks-3.15.3/liveblocks/models/get_user_groups_response.py +72 -0
- liveblocks-3.15.3/liveblocks/models/get_web_knowledge_source_links_response.py +72 -0
- liveblocks-3.15.3/liveblocks/models/get_yjs_document_response.py +49 -0
- liveblocks-3.15.3/liveblocks/models/get_yjs_document_type.py +9 -0
- liveblocks-3.15.3/liveblocks/models/get_yjs_versions_response.py +72 -0
- liveblocks-3.15.3/liveblocks/models/google_model.py +9 -0
- liveblocks-3.15.3/liveblocks/models/google_provider_options.py +48 -0
- liveblocks-3.15.3/liveblocks/models/google_provider_options_google.py +71 -0
- liveblocks-3.15.3/liveblocks/models/google_provider_options_google_thinking_config.py +59 -0
- liveblocks-3.15.3/liveblocks/models/group.py +131 -0
- liveblocks-3.15.3/liveblocks/models/group_member.py +72 -0
- liveblocks-3.15.3/liveblocks/models/group_scopes.py +59 -0
- liveblocks-3.15.3/liveblocks/models/identify_user_request_body.py +87 -0
- liveblocks-3.15.3/liveblocks/models/identify_user_request_body_user_info.py +45 -0
- liveblocks-3.15.3/liveblocks/models/identify_user_response.py +43 -0
- liveblocks-3.15.3/liveblocks/models/inbox_notification_activity.py +66 -0
- liveblocks-3.15.3/liveblocks/models/inbox_notification_activity_data.py +56 -0
- liveblocks-3.15.3/liveblocks/models/inbox_notification_custom_data.py +141 -0
- liveblocks-3.15.3/liveblocks/models/inbox_notification_thread_data.py +133 -0
- liveblocks-3.15.3/liveblocks/models/initialize_storage_document_body.py +82 -0
- liveblocks-3.15.3/liveblocks/models/initialize_storage_document_body_data.py +45 -0
- liveblocks-3.15.3/liveblocks/models/initialize_storage_document_response.py +86 -0
- liveblocks-3.15.3/liveblocks/models/initialize_storage_document_response_data.py +45 -0
- liveblocks-3.15.3/liveblocks/models/knowledge_source_base.py +90 -0
- liveblocks-3.15.3/liveblocks/models/knowledge_source_base_status.py +7 -0
- liveblocks-3.15.3/liveblocks/models/knowledge_source_file_source.py +133 -0
- liveblocks-3.15.3/liveblocks/models/knowledge_source_file_source_file.py +67 -0
- liveblocks-3.15.3/liveblocks/models/knowledge_source_web_source.py +114 -0
- liveblocks-3.15.3/liveblocks/models/knowledge_source_web_source_link.py +69 -0
- liveblocks-3.15.3/liveblocks/models/knowledge_source_web_source_link_type.py +7 -0
- liveblocks-3.15.3/liveblocks/models/management_project.py +173 -0
- liveblocks-3.15.3/liveblocks/models/management_project_public_key.py +80 -0
- liveblocks-3.15.3/liveblocks/models/management_project_region.py +7 -0
- liveblocks-3.15.3/liveblocks/models/management_project_roll_project_secret_api_key_response_secret_key_response.py +49 -0
- liveblocks-3.15.3/liveblocks/models/management_project_secret_key.py +72 -0
- liveblocks-3.15.3/liveblocks/models/management_project_type.py +6 -0
- liveblocks-3.15.3/liveblocks/models/management_webhook.py +173 -0
- liveblocks-3.15.3/liveblocks/models/management_webhook_additional_headers.py +49 -0
- liveblocks-3.15.3/liveblocks/models/management_webhook_event.py +22 -0
- liveblocks-3.15.3/liveblocks/models/management_webhook_headers_delete.py +62 -0
- liveblocks-3.15.3/liveblocks/models/management_webhook_secret.py +62 -0
- liveblocks-3.15.3/liveblocks/models/mark_thread_as_resolved_request_body.py +43 -0
- liveblocks-3.15.3/liveblocks/models/mark_thread_as_unresolved_request_body.py +43 -0
- liveblocks-3.15.3/liveblocks/models/move_json_patch_operation.py +58 -0
- liveblocks-3.15.3/liveblocks/models/notification_channel_settings.py +71 -0
- liveblocks-3.15.3/liveblocks/models/notification_settings.py +110 -0
- liveblocks-3.15.3/liveblocks/models/open_ai_model.py +23 -0
- liveblocks-3.15.3/liveblocks/models/open_ai_provider_options.py +48 -0
- liveblocks-3.15.3/liveblocks/models/open_ai_provider_options_openai.py +69 -0
- liveblocks-3.15.3/liveblocks/models/open_ai_provider_options_openai_reasoning_effort.py +7 -0
- liveblocks-3.15.3/liveblocks/models/open_ai_provider_options_openai_web_search.py +42 -0
- liveblocks-3.15.3/liveblocks/models/recover_management_webhook_failed_messages_request_body.py +45 -0
- liveblocks-3.15.3/liveblocks/models/remove_comment_reaction_request_body.py +68 -0
- liveblocks-3.15.3/liveblocks/models/remove_group_members_request_body.py +62 -0
- liveblocks-3.15.3/liveblocks/models/remove_json_patch_operation.py +50 -0
- liveblocks-3.15.3/liveblocks/models/replace_json_patch_operation.py +79 -0
- liveblocks-3.15.3/liveblocks/models/roll_project_public_api_key_request_body.py +56 -0
- liveblocks-3.15.3/liveblocks/models/roll_project_public_api_key_request_body_expiration_in.py +17 -0
- liveblocks-3.15.3/liveblocks/models/roll_project_public_api_key_response.py +49 -0
- liveblocks-3.15.3/liveblocks/models/roll_project_secret_api_key_request_body.py +56 -0
- liveblocks-3.15.3/liveblocks/models/roll_project_secret_api_key_request_body_expiration_in.py +17 -0
- liveblocks-3.15.3/liveblocks/models/room.py +140 -0
- liveblocks-3.15.3/liveblocks/models/room_accesses.py +66 -0
- liveblocks-3.15.3/liveblocks/models/room_accesses_additional_property_item.py +8 -0
- liveblocks-3.15.3/liveblocks/models/room_metadata.py +72 -0
- liveblocks-3.15.3/liveblocks/models/room_permission_item.py +8 -0
- liveblocks-3.15.3/liveblocks/models/room_subscription_settings.py +54 -0
- liveblocks-3.15.3/liveblocks/models/room_subscription_settings_text_mentions.py +6 -0
- liveblocks-3.15.3/liveblocks/models/room_subscription_settings_threads.py +7 -0
- liveblocks-3.15.3/liveblocks/models/room_type.py +5 -0
- liveblocks-3.15.3/liveblocks/models/rotate_management_webhook_secret_response.py +75 -0
- liveblocks-3.15.3/liveblocks/models/set_presence_request_body.py +87 -0
- liveblocks-3.15.3/liveblocks/models/set_presence_request_body_data.py +45 -0
- liveblocks-3.15.3/liveblocks/models/set_presence_request_body_user_info.py +78 -0
- liveblocks-3.15.3/liveblocks/models/subscribe_to_thread_request_body.py +43 -0
- liveblocks-3.15.3/liveblocks/models/subscription.py +61 -0
- liveblocks-3.15.3/liveblocks/models/test_json_patch_operation.py +58 -0
- liveblocks-3.15.3/liveblocks/models/test_management_webhook_request_body.py +64 -0
- liveblocks-3.15.3/liveblocks/models/test_management_webhook_response.py +48 -0
- liveblocks-3.15.3/liveblocks/models/test_management_webhook_response_message.py +74 -0
- liveblocks-3.15.3/liveblocks/models/thread.py +142 -0
- liveblocks-3.15.3/liveblocks/models/thread_metadata.py +59 -0
- liveblocks-3.15.3/liveblocks/models/trigger_inbox_notification_request_body.py +115 -0
- liveblocks-3.15.3/liveblocks/models/trigger_inbox_notification_request_body_activity_data.py +56 -0
- liveblocks-3.15.3/liveblocks/models/unsubscribe_from_thread_request_body.py +43 -0
- liveblocks-3.15.3/liveblocks/models/update_ai_copilot_request_body.py +253 -0
- liveblocks-3.15.3/liveblocks/models/update_ai_copilot_request_body_provider.py +8 -0
- liveblocks-3.15.3/liveblocks/models/update_management_project_request_body.py +80 -0
- liveblocks-3.15.3/liveblocks/models/update_management_webhook_request_body.py +121 -0
- liveblocks-3.15.3/liveblocks/models/update_notification_settings_request_body.py +108 -0
- liveblocks-3.15.3/liveblocks/models/update_room_id_request_body.py +43 -0
- liveblocks-3.15.3/liveblocks/models/update_room_organization_id_request_body.py +52 -0
- liveblocks-3.15.3/liveblocks/models/update_room_request_body.py +139 -0
- liveblocks-3.15.3/liveblocks/models/update_room_request_body_groups_accesses.py +95 -0
- liveblocks-3.15.3/liveblocks/models/update_room_request_body_groups_accesses_additional_property_type_0_item.py +8 -0
- liveblocks-3.15.3/liveblocks/models/update_room_request_body_metadata.py +70 -0
- liveblocks-3.15.3/liveblocks/models/update_room_request_body_users_accesses.py +93 -0
- liveblocks-3.15.3/liveblocks/models/update_room_request_body_users_accesses_additional_property_type_0_item.py +8 -0
- liveblocks-3.15.3/liveblocks/models/update_room_subscription_settings_request_body.py +73 -0
- liveblocks-3.15.3/liveblocks/models/update_room_subscription_settings_request_body_text_mentions.py +6 -0
- liveblocks-3.15.3/liveblocks/models/update_room_subscription_settings_request_body_threads.py +7 -0
- liveblocks-3.15.3/liveblocks/models/upsert_management_webhook_headers_request_body.py +48 -0
- liveblocks-3.15.3/liveblocks/models/upsert_management_webhook_headers_response.py +52 -0
- liveblocks-3.15.3/liveblocks/models/upsert_management_webhook_headers_response_headers.py +45 -0
- liveblocks-3.15.3/liveblocks/models/upsert_room_request_body.py +72 -0
- liveblocks-3.15.3/liveblocks/models/user_room_subscription_settings.py +62 -0
- liveblocks-3.15.3/liveblocks/models/user_room_subscription_settings_text_mentions.py +6 -0
- liveblocks-3.15.3/liveblocks/models/user_room_subscription_settings_threads.py +7 -0
- liveblocks-3.15.3/liveblocks/models/user_subscription.py +91 -0
- liveblocks-3.15.3/liveblocks/models/web_knowledge_source_link.py +80 -0
- liveblocks-3.15.3/liveblocks/models/web_knowledge_source_link_status.py +7 -0
- liveblocks-3.15.3/liveblocks/models/yjs_version.py +121 -0
- liveblocks-3.15.3/liveblocks/models/yjs_version_authors_item.py +59 -0
- liveblocks-3.15.3/liveblocks/py.typed +1 -0
- liveblocks-3.15.3/liveblocks/session.py +189 -0
- liveblocks-3.15.3/liveblocks/types.py +39 -0
- liveblocks-3.15.3/liveblocks/webhooks.py +525 -0
- liveblocks-3.15.3/pyproject.toml +61 -0
|
@@ -0,0 +1,2593 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: liveblocks
|
|
3
|
+
Version: 3.15.3
|
|
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
|
+
# organization_id="...",
|
|
114
|
+
# users_accesses=...,
|
|
115
|
+
# groups_accesses=...,
|
|
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
|
+
#### `update_room_organization_id`
|
|
294
|
+
|
|
295
|
+
This endpoint updates the room's organization ID. The `fromOrganizationId` must match the room's current organization ID. Returns the updated room.
|
|
296
|
+
|
|
297
|
+
**Example**
|
|
298
|
+
```python
|
|
299
|
+
result = client.update_room_organization_id(
|
|
300
|
+
room_id="my-room-id",
|
|
301
|
+
)
|
|
302
|
+
print(result)
|
|
303
|
+
```
|
|
304
|
+
**Parameters:**
|
|
305
|
+
|
|
306
|
+
| Name | Type | Required | Description |
|
|
307
|
+
|------|------|----------|-------------|
|
|
308
|
+
| `room_id` | `str` | Yes | The ID of the room |
|
|
309
|
+
| `body` | `UpdateRoomOrganizationIdRequestBody \| Unset` | No | Request body (application/json) |
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
#### `get_active_users`
|
|
315
|
+
|
|
316
|
+
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).
|
|
317
|
+
|
|
318
|
+
For optimal performance, we recommend calling this endpoint no more than once every 10 seconds.
|
|
319
|
+
Duplicates can occur if a user is in the requested room with multiple browser tabs opened.
|
|
320
|
+
|
|
321
|
+
**Example**
|
|
322
|
+
```python
|
|
323
|
+
result = client.get_active_users(
|
|
324
|
+
room_id="my-room-id",
|
|
325
|
+
)
|
|
326
|
+
print(result)
|
|
327
|
+
```
|
|
328
|
+
**Parameters:**
|
|
329
|
+
|
|
330
|
+
| Name | Type | Required | Description |
|
|
331
|
+
|------|------|----------|-------------|
|
|
332
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
#### `set_presence`
|
|
338
|
+
|
|
339
|
+
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).
|
|
340
|
+
|
|
341
|
+
**Example**
|
|
342
|
+
```python
|
|
343
|
+
from liveblocks.models import SetPresenceRequestBody
|
|
344
|
+
|
|
345
|
+
client.set_presence(
|
|
346
|
+
room_id="my-room-id",
|
|
347
|
+
body=SetPresenceRequestBody(
|
|
348
|
+
user_id="...",
|
|
349
|
+
data=...,
|
|
350
|
+
# user_info=...,
|
|
351
|
+
# ttl=0,
|
|
352
|
+
),
|
|
353
|
+
)
|
|
354
|
+
```
|
|
355
|
+
**Parameters:**
|
|
356
|
+
|
|
357
|
+
| Name | Type | Required | Description |
|
|
358
|
+
|------|------|----------|-------------|
|
|
359
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
360
|
+
| `body` | `SetPresenceRequestBody` | Yes | Request body (application/json) |
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
365
|
+
#### `broadcast_event`
|
|
366
|
+
|
|
367
|
+
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).
|
|
368
|
+
|
|
369
|
+
**Example**
|
|
370
|
+
```python
|
|
371
|
+
client.broadcast_event(
|
|
372
|
+
room_id="my-room-id",
|
|
373
|
+
body=...,
|
|
374
|
+
)
|
|
375
|
+
```
|
|
376
|
+
**Parameters:**
|
|
377
|
+
|
|
378
|
+
| Name | Type | Required | Description |
|
|
379
|
+
|------|------|----------|-------------|
|
|
380
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
381
|
+
| `body` | `Any` | Yes | Request body (application/json) |
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
### Storage
|
|
387
|
+
|
|
388
|
+
#### `get_storage_document`
|
|
389
|
+
|
|
390
|
+
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).
|
|
391
|
+
|
|
392
|
+
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:
|
|
393
|
+
|
|
394
|
+
```json
|
|
395
|
+
{
|
|
396
|
+
"liveblocksType": "LiveObject",
|
|
397
|
+
"data": ...
|
|
398
|
+
}
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
If you’re not interested in this information, you can use the simpler `?format=json` query param, see below.
|
|
402
|
+
|
|
403
|
+
**Example**
|
|
404
|
+
```python
|
|
405
|
+
result = client.get_storage_document(
|
|
406
|
+
room_id="my-room-id",
|
|
407
|
+
# format_=...,
|
|
408
|
+
)
|
|
409
|
+
print(result)
|
|
410
|
+
```
|
|
411
|
+
**Parameters:**
|
|
412
|
+
|
|
413
|
+
| Name | Type | Required | Description |
|
|
414
|
+
|------|------|----------|-------------|
|
|
415
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
416
|
+
| `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. |
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
#### `initialize_storage_document`
|
|
422
|
+
|
|
423
|
+
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).
|
|
424
|
+
|
|
425
|
+
The format of the request body is the same as what’s returned by the get Storage endpoint.
|
|
426
|
+
|
|
427
|
+
For each Liveblocks data structure that you want to create, you need a JSON element having two properties:
|
|
428
|
+
- `"liveblocksType"` => `"LiveObject" | "LiveList" | "LiveMap"`
|
|
429
|
+
- `"data"` => contains the nested data structures (children) and data.
|
|
430
|
+
|
|
431
|
+
The root’s type can only be LiveObject.
|
|
432
|
+
|
|
433
|
+
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.
|
|
434
|
+
|
|
435
|
+
**Example**
|
|
436
|
+
```python
|
|
437
|
+
result = client.initialize_storage_document(
|
|
438
|
+
room_id="my-room-id",
|
|
439
|
+
)
|
|
440
|
+
print(result)
|
|
441
|
+
```
|
|
442
|
+
**Parameters:**
|
|
443
|
+
|
|
444
|
+
| Name | Type | Required | Description |
|
|
445
|
+
|------|------|----------|-------------|
|
|
446
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
447
|
+
| `body` | `InitializeStorageDocumentBody \| Unset` | No | Request body (application/json) |
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
---
|
|
451
|
+
|
|
452
|
+
#### `delete_storage_document`
|
|
453
|
+
|
|
454
|
+
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).
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
**Example**
|
|
458
|
+
```python
|
|
459
|
+
client.delete_storage_document(
|
|
460
|
+
room_id="my-room-id",
|
|
461
|
+
)
|
|
462
|
+
```
|
|
463
|
+
**Parameters:**
|
|
464
|
+
|
|
465
|
+
| Name | Type | Required | Description |
|
|
466
|
+
|------|------|----------|-------------|
|
|
467
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
---
|
|
471
|
+
|
|
472
|
+
#### `patch_storage_document`
|
|
473
|
+
|
|
474
|
+
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.
|
|
475
|
+
|
|
476
|
+
**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.
|
|
477
|
+
|
|
478
|
+
**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.
|
|
479
|
+
|
|
480
|
+
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).
|
|
481
|
+
|
|
482
|
+
**Example**
|
|
483
|
+
```python
|
|
484
|
+
client.patch_storage_document(
|
|
485
|
+
room_id="my-room-id",
|
|
486
|
+
body=...,
|
|
487
|
+
)
|
|
488
|
+
```
|
|
489
|
+
**Parameters:**
|
|
490
|
+
|
|
491
|
+
| Name | Type | Required | Description |
|
|
492
|
+
|------|------|----------|-------------|
|
|
493
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
494
|
+
| `body` | `list[AddJsonPatchOperation \| CopyJsonPatchOperation \| MoveJsonPatchOperation \| RemoveJsonPatchOperation \| ReplaceJsonPatchOperation \| TestJsonPatchOperation]` | Yes | Request body (application/json) |
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
---
|
|
498
|
+
|
|
499
|
+
### Yjs
|
|
500
|
+
|
|
501
|
+
#### `get_yjs_document`
|
|
502
|
+
|
|
503
|
+
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).
|
|
504
|
+
|
|
505
|
+
**Example**
|
|
506
|
+
```python
|
|
507
|
+
result = client.get_yjs_document(
|
|
508
|
+
room_id="my-room-id",
|
|
509
|
+
# formatting=True,
|
|
510
|
+
# key="root",
|
|
511
|
+
# type_=...,
|
|
512
|
+
)
|
|
513
|
+
print(result)
|
|
514
|
+
```
|
|
515
|
+
**Parameters:**
|
|
516
|
+
|
|
517
|
+
| Name | Type | Required | Description |
|
|
518
|
+
|------|------|----------|-------------|
|
|
519
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
520
|
+
| `formatting` | `bool \| Unset` | No | If present, YText will return formatting. |
|
|
521
|
+
| `key` | `str \| Unset` | No | Returns only a single key’s value, e.g. `doc.get(key).toJSON()`. |
|
|
522
|
+
| `type_` | `GetYjsDocumentType \| Unset` | No | Used with key to override the inferred type, i.e. `"ymap"` will return `doc.get(key, Y.Map)`. |
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
---
|
|
526
|
+
|
|
527
|
+
#### `send_yjs_binary_update`
|
|
528
|
+
|
|
529
|
+
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).
|
|
530
|
+
|
|
531
|
+
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.
|
|
532
|
+
|
|
533
|
+
**Example**
|
|
534
|
+
```python
|
|
535
|
+
client.send_yjs_binary_update(
|
|
536
|
+
room_id="my-room-id",
|
|
537
|
+
body=...,
|
|
538
|
+
# guid="subdoc-guid-123",
|
|
539
|
+
)
|
|
540
|
+
```
|
|
541
|
+
**Parameters:**
|
|
542
|
+
|
|
543
|
+
| Name | Type | Required | Description |
|
|
544
|
+
|------|------|----------|-------------|
|
|
545
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
546
|
+
| `guid` | `str \| Unset` | No | ID of the subdocument |
|
|
547
|
+
| `body` | `File` | Yes | Request body (application/octet-stream) |
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
---
|
|
551
|
+
|
|
552
|
+
#### `get_yjs_document_as_binary_update`
|
|
553
|
+
|
|
554
|
+
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).
|
|
555
|
+
|
|
556
|
+
**Example**
|
|
557
|
+
```python
|
|
558
|
+
result = client.get_yjs_document_as_binary_update(
|
|
559
|
+
room_id="my-room-id",
|
|
560
|
+
# guid="subdoc-guid-123",
|
|
561
|
+
)
|
|
562
|
+
print(result)
|
|
563
|
+
```
|
|
564
|
+
**Parameters:**
|
|
565
|
+
|
|
566
|
+
| Name | Type | Required | Description |
|
|
567
|
+
|------|------|----------|-------------|
|
|
568
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
569
|
+
| `guid` | `str \| Unset` | No | ID of the subdocument |
|
|
570
|
+
|
|
571
|
+
|
|
572
|
+
---
|
|
573
|
+
|
|
574
|
+
#### `get_yjs_versions`
|
|
575
|
+
|
|
576
|
+
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.
|
|
577
|
+
|
|
578
|
+
**Example**
|
|
579
|
+
```python
|
|
580
|
+
result = client.get_yjs_versions(
|
|
581
|
+
room_id="my-room-id",
|
|
582
|
+
# limit=20,
|
|
583
|
+
# cursor="eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
|
|
584
|
+
)
|
|
585
|
+
print(result)
|
|
586
|
+
```
|
|
587
|
+
**Parameters:**
|
|
588
|
+
|
|
589
|
+
| Name | Type | Required | Description |
|
|
590
|
+
|------|------|----------|-------------|
|
|
591
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
592
|
+
| `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`)* |
|
|
593
|
+
| `cursor` | `str \| Unset` | No | A cursor used for pagination. Get the value from the `nextCursor` response of the previous page. |
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
---
|
|
597
|
+
|
|
598
|
+
#### `get_yjs_version`
|
|
599
|
+
|
|
600
|
+
This endpoint returns a specific version of the room's Yjs document encoded as a binary Yjs update.
|
|
601
|
+
|
|
602
|
+
**Example**
|
|
603
|
+
```python
|
|
604
|
+
result = client.get_yjs_version(
|
|
605
|
+
room_id="my-room-id",
|
|
606
|
+
version_id="vh_abc123",
|
|
607
|
+
)
|
|
608
|
+
print(result)
|
|
609
|
+
```
|
|
610
|
+
**Parameters:**
|
|
611
|
+
|
|
612
|
+
| Name | Type | Required | Description |
|
|
613
|
+
|------|------|----------|-------------|
|
|
614
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
615
|
+
| `version_id` | `str` | Yes | ID of the version |
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
---
|
|
619
|
+
|
|
620
|
+
#### `create_yjs_version`
|
|
621
|
+
|
|
622
|
+
This endpoint creates a new version history snapshot for the room's Yjs document.
|
|
623
|
+
|
|
624
|
+
**Example**
|
|
625
|
+
```python
|
|
626
|
+
result = client.create_yjs_version(
|
|
627
|
+
room_id="my-room-id",
|
|
628
|
+
)
|
|
629
|
+
print(result)
|
|
630
|
+
```
|
|
631
|
+
**Parameters:**
|
|
632
|
+
|
|
633
|
+
| Name | Type | Required | Description |
|
|
634
|
+
|------|------|----------|-------------|
|
|
635
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
---
|
|
639
|
+
|
|
640
|
+
### Comments
|
|
641
|
+
|
|
642
|
+
#### `get_threads`
|
|
643
|
+
|
|
644
|
+
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).
|
|
645
|
+
|
|
646
|
+
**Example**
|
|
647
|
+
```python
|
|
648
|
+
result = client.get_threads(
|
|
649
|
+
room_id="my-room-id",
|
|
650
|
+
# query="metadata[\"color\"]:\"blue\"",
|
|
651
|
+
)
|
|
652
|
+
print(result)
|
|
653
|
+
```
|
|
654
|
+
**Parameters:**
|
|
655
|
+
|
|
656
|
+
| Name | Type | Required | Description |
|
|
657
|
+
|------|------|----------|-------------|
|
|
658
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
659
|
+
| `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). |
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
---
|
|
663
|
+
|
|
664
|
+
#### `create_thread`
|
|
665
|
+
|
|
666
|
+
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).
|
|
667
|
+
|
|
668
|
+
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`.
|
|
669
|
+
|
|
670
|
+
```json
|
|
671
|
+
{
|
|
672
|
+
"version": 1,
|
|
673
|
+
"content": [
|
|
674
|
+
{
|
|
675
|
+
"type": "paragraph",
|
|
676
|
+
"children": [{ "text": "Hello " }, { "text": "world", "bold": true }]
|
|
677
|
+
}
|
|
678
|
+
]
|
|
679
|
+
}
|
|
680
|
+
```
|
|
681
|
+
|
|
682
|
+
`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.
|
|
683
|
+
|
|
684
|
+
**Example**
|
|
685
|
+
```python
|
|
686
|
+
from liveblocks.models import CreateThreadRequestBody
|
|
687
|
+
|
|
688
|
+
result = client.create_thread(
|
|
689
|
+
room_id="my-room-id",
|
|
690
|
+
body=CreateThreadRequestBody(
|
|
691
|
+
comment=...,
|
|
692
|
+
# metadata=...,
|
|
693
|
+
),
|
|
694
|
+
)
|
|
695
|
+
print(result)
|
|
696
|
+
```
|
|
697
|
+
**Parameters:**
|
|
698
|
+
|
|
699
|
+
| Name | Type | Required | Description |
|
|
700
|
+
|------|------|----------|-------------|
|
|
701
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
702
|
+
| `body` | `CreateThreadRequestBody` | Yes | Request body (application/json) |
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
---
|
|
706
|
+
|
|
707
|
+
#### `get_thread`
|
|
708
|
+
|
|
709
|
+
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).
|
|
710
|
+
|
|
711
|
+
**Example**
|
|
712
|
+
```python
|
|
713
|
+
result = client.get_thread(
|
|
714
|
+
room_id="my-room-id",
|
|
715
|
+
thread_id="th_abc123",
|
|
716
|
+
)
|
|
717
|
+
print(result)
|
|
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
|
+
#### `delete_thread`
|
|
730
|
+
|
|
731
|
+
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).
|
|
732
|
+
|
|
733
|
+
**Example**
|
|
734
|
+
```python
|
|
735
|
+
client.delete_thread(
|
|
736
|
+
room_id="my-room-id",
|
|
737
|
+
thread_id="th_abc123",
|
|
738
|
+
)
|
|
739
|
+
```
|
|
740
|
+
**Parameters:**
|
|
741
|
+
|
|
742
|
+
| Name | Type | Required | Description |
|
|
743
|
+
|------|------|----------|-------------|
|
|
744
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
745
|
+
| `thread_id` | `str` | Yes | ID of the thread |
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
---
|
|
749
|
+
|
|
750
|
+
#### `get_thread_participants`
|
|
751
|
+
|
|
752
|
+
**Deprecated.** Prefer using [thread subscriptions](#get-rooms-roomId-threads-threadId-subscriptions) instead.
|
|
753
|
+
|
|
754
|
+
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).
|
|
755
|
+
|
|
756
|
+
**Example**
|
|
757
|
+
```python
|
|
758
|
+
result = client.get_thread_participants(
|
|
759
|
+
room_id="my-room-id",
|
|
760
|
+
thread_id="th_abc123",
|
|
761
|
+
)
|
|
762
|
+
print(result)
|
|
763
|
+
```
|
|
764
|
+
**Parameters:**
|
|
765
|
+
|
|
766
|
+
| Name | Type | Required | Description |
|
|
767
|
+
|------|------|----------|-------------|
|
|
768
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
769
|
+
| `thread_id` | `str` | Yes | ID of the thread |
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
---
|
|
773
|
+
|
|
774
|
+
#### `edit_thread_metadata`
|
|
775
|
+
|
|
776
|
+
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).
|
|
777
|
+
|
|
778
|
+
`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.
|
|
779
|
+
|
|
780
|
+
**Example**
|
|
781
|
+
```python
|
|
782
|
+
from liveblocks.models import EditThreadMetadataRequestBody
|
|
783
|
+
|
|
784
|
+
result = client.edit_thread_metadata(
|
|
785
|
+
room_id="my-room-id",
|
|
786
|
+
thread_id="th_abc123",
|
|
787
|
+
body=EditThreadMetadataRequestBody(
|
|
788
|
+
metadata=...,
|
|
789
|
+
user_id="...",
|
|
790
|
+
# updated_at=...,
|
|
791
|
+
),
|
|
792
|
+
)
|
|
793
|
+
print(result)
|
|
794
|
+
```
|
|
795
|
+
**Parameters:**
|
|
796
|
+
|
|
797
|
+
| Name | Type | Required | Description |
|
|
798
|
+
|------|------|----------|-------------|
|
|
799
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
800
|
+
| `thread_id` | `str` | Yes | ID of the thread |
|
|
801
|
+
| `body` | `EditThreadMetadataRequestBody` | Yes | Request body (application/json) |
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
---
|
|
805
|
+
|
|
806
|
+
#### `mark_thread_as_resolved`
|
|
807
|
+
|
|
808
|
+
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).
|
|
809
|
+
|
|
810
|
+
**Example**
|
|
811
|
+
```python
|
|
812
|
+
from liveblocks.models import MarkThreadAsResolvedRequestBody
|
|
813
|
+
|
|
814
|
+
result = client.mark_thread_as_resolved(
|
|
815
|
+
room_id="my-room-id",
|
|
816
|
+
thread_id="th_abc123",
|
|
817
|
+
body=MarkThreadAsResolvedRequestBody(
|
|
818
|
+
user_id="...",
|
|
819
|
+
),
|
|
820
|
+
)
|
|
821
|
+
print(result)
|
|
822
|
+
```
|
|
823
|
+
**Parameters:**
|
|
824
|
+
|
|
825
|
+
| Name | Type | Required | Description |
|
|
826
|
+
|------|------|----------|-------------|
|
|
827
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
828
|
+
| `thread_id` | `str` | Yes | ID of the thread |
|
|
829
|
+
| `body` | `MarkThreadAsResolvedRequestBody` | Yes | Request body (application/json) |
|
|
830
|
+
|
|
831
|
+
|
|
832
|
+
---
|
|
833
|
+
|
|
834
|
+
#### `mark_thread_as_unresolved`
|
|
835
|
+
|
|
836
|
+
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).
|
|
837
|
+
|
|
838
|
+
**Example**
|
|
839
|
+
```python
|
|
840
|
+
from liveblocks.models import MarkThreadAsUnresolvedRequestBody
|
|
841
|
+
|
|
842
|
+
result = client.mark_thread_as_unresolved(
|
|
843
|
+
room_id="my-room-id",
|
|
844
|
+
thread_id="th_abc123",
|
|
845
|
+
body=MarkThreadAsUnresolvedRequestBody(
|
|
846
|
+
user_id="...",
|
|
847
|
+
),
|
|
848
|
+
)
|
|
849
|
+
print(result)
|
|
850
|
+
```
|
|
851
|
+
**Parameters:**
|
|
852
|
+
|
|
853
|
+
| Name | Type | Required | Description |
|
|
854
|
+
|------|------|----------|-------------|
|
|
855
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
856
|
+
| `thread_id` | `str` | Yes | ID of the thread |
|
|
857
|
+
| `body` | `MarkThreadAsUnresolvedRequestBody` | Yes | Request body (application/json) |
|
|
858
|
+
|
|
859
|
+
|
|
860
|
+
---
|
|
861
|
+
|
|
862
|
+
#### `subscribe_to_thread`
|
|
863
|
+
|
|
864
|
+
This endpoint subscribes to a thread. Corresponds to [`liveblocks.subscribeToThread`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-rooms-roomId-threads-threadId-subscribe).
|
|
865
|
+
|
|
866
|
+
**Example**
|
|
867
|
+
```python
|
|
868
|
+
from liveblocks.models import SubscribeToThreadRequestBody
|
|
869
|
+
|
|
870
|
+
result = client.subscribe_to_thread(
|
|
871
|
+
room_id="my-room-id",
|
|
872
|
+
thread_id="th_abc123",
|
|
873
|
+
body=SubscribeToThreadRequestBody(
|
|
874
|
+
user_id="...",
|
|
875
|
+
),
|
|
876
|
+
)
|
|
877
|
+
print(result)
|
|
878
|
+
```
|
|
879
|
+
**Parameters:**
|
|
880
|
+
|
|
881
|
+
| Name | Type | Required | Description |
|
|
882
|
+
|------|------|----------|-------------|
|
|
883
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
884
|
+
| `thread_id` | `str` | Yes | ID of the thread |
|
|
885
|
+
| `body` | `SubscribeToThreadRequestBody` | Yes | Request body (application/json) |
|
|
886
|
+
|
|
887
|
+
|
|
888
|
+
---
|
|
889
|
+
|
|
890
|
+
#### `unsubscribe_from_thread`
|
|
891
|
+
|
|
892
|
+
This endpoint unsubscribes from a thread. Corresponds to [`liveblocks.unsubscribeFromThread`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-rooms-roomId-threads-threadId-unsubscribe).
|
|
893
|
+
|
|
894
|
+
**Example**
|
|
895
|
+
```python
|
|
896
|
+
from liveblocks.models import UnsubscribeFromThreadRequestBody
|
|
897
|
+
|
|
898
|
+
client.unsubscribe_from_thread(
|
|
899
|
+
room_id="my-room-id",
|
|
900
|
+
thread_id="th_abc123",
|
|
901
|
+
body=UnsubscribeFromThreadRequestBody(
|
|
902
|
+
user_id="...",
|
|
903
|
+
),
|
|
904
|
+
)
|
|
905
|
+
```
|
|
906
|
+
**Parameters:**
|
|
907
|
+
|
|
908
|
+
| Name | Type | Required | Description |
|
|
909
|
+
|------|------|----------|-------------|
|
|
910
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
911
|
+
| `thread_id` | `str` | Yes | ID of the thread |
|
|
912
|
+
| `body` | `UnsubscribeFromThreadRequestBody` | Yes | Request body (application/json) |
|
|
913
|
+
|
|
914
|
+
|
|
915
|
+
---
|
|
916
|
+
|
|
917
|
+
#### `get_thread_subscriptions`
|
|
918
|
+
|
|
919
|
+
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).
|
|
920
|
+
|
|
921
|
+
**Example**
|
|
922
|
+
```python
|
|
923
|
+
result = client.get_thread_subscriptions(
|
|
924
|
+
room_id="my-room-id",
|
|
925
|
+
thread_id="th_abc123",
|
|
926
|
+
)
|
|
927
|
+
print(result)
|
|
928
|
+
```
|
|
929
|
+
**Parameters:**
|
|
930
|
+
|
|
931
|
+
| Name | Type | Required | Description |
|
|
932
|
+
|------|------|----------|-------------|
|
|
933
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
934
|
+
| `thread_id` | `str` | Yes | ID of the thread |
|
|
935
|
+
|
|
936
|
+
|
|
937
|
+
---
|
|
938
|
+
|
|
939
|
+
#### `create_comment`
|
|
940
|
+
|
|
941
|
+
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).
|
|
942
|
+
|
|
943
|
+
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`.
|
|
944
|
+
|
|
945
|
+
```json
|
|
946
|
+
{
|
|
947
|
+
"version": 1,
|
|
948
|
+
"content": [
|
|
949
|
+
{
|
|
950
|
+
"type": "paragraph",
|
|
951
|
+
"children": [{ "text": "Hello " }, { "text": "world", "bold": true }]
|
|
952
|
+
}
|
|
953
|
+
]
|
|
954
|
+
}
|
|
955
|
+
```
|
|
956
|
+
|
|
957
|
+
`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.
|
|
958
|
+
|
|
959
|
+
**Example**
|
|
960
|
+
```python
|
|
961
|
+
from liveblocks.models import CreateCommentRequestBody
|
|
962
|
+
|
|
963
|
+
result = client.create_comment(
|
|
964
|
+
room_id="my-room-id",
|
|
965
|
+
thread_id="th_abc123",
|
|
966
|
+
body=CreateCommentRequestBody(
|
|
967
|
+
user_id="...",
|
|
968
|
+
body=...,
|
|
969
|
+
# created_at=...,
|
|
970
|
+
# metadata=...,
|
|
971
|
+
# attachment_ids=[],
|
|
972
|
+
),
|
|
973
|
+
)
|
|
974
|
+
print(result)
|
|
975
|
+
```
|
|
976
|
+
**Parameters:**
|
|
977
|
+
|
|
978
|
+
| Name | Type | Required | Description |
|
|
979
|
+
|------|------|----------|-------------|
|
|
980
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
981
|
+
| `thread_id` | `str` | Yes | ID of the thread |
|
|
982
|
+
| `body` | `CreateCommentRequestBody` | Yes | Request body (application/json) |
|
|
983
|
+
|
|
984
|
+
|
|
985
|
+
---
|
|
986
|
+
|
|
987
|
+
#### `get_comment`
|
|
988
|
+
|
|
989
|
+
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).
|
|
990
|
+
|
|
991
|
+
**Example**
|
|
992
|
+
```python
|
|
993
|
+
result = client.get_comment(
|
|
994
|
+
room_id="my-room-id",
|
|
995
|
+
thread_id="th_abc123",
|
|
996
|
+
comment_id="cm_abc123",
|
|
997
|
+
)
|
|
998
|
+
print(result)
|
|
999
|
+
```
|
|
1000
|
+
**Parameters:**
|
|
1001
|
+
|
|
1002
|
+
| Name | Type | Required | Description |
|
|
1003
|
+
|------|------|----------|-------------|
|
|
1004
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
1005
|
+
| `thread_id` | `str` | Yes | ID of the thread |
|
|
1006
|
+
| `comment_id` | `str` | Yes | ID of the comment |
|
|
1007
|
+
|
|
1008
|
+
|
|
1009
|
+
---
|
|
1010
|
+
|
|
1011
|
+
#### `edit_comment`
|
|
1012
|
+
|
|
1013
|
+
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).
|
|
1014
|
+
|
|
1015
|
+
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`.
|
|
1016
|
+
|
|
1017
|
+
```json
|
|
1018
|
+
{
|
|
1019
|
+
"version": 1,
|
|
1020
|
+
"content": [
|
|
1021
|
+
{
|
|
1022
|
+
"type": "paragraph",
|
|
1023
|
+
"children": [{ "text": "Hello " }, { "text": "world", "bold": true }]
|
|
1024
|
+
}
|
|
1025
|
+
]
|
|
1026
|
+
}
|
|
1027
|
+
```
|
|
1028
|
+
|
|
1029
|
+
**Example**
|
|
1030
|
+
```python
|
|
1031
|
+
from liveblocks.models import EditCommentRequestBody
|
|
1032
|
+
|
|
1033
|
+
result = client.edit_comment(
|
|
1034
|
+
room_id="my-room-id",
|
|
1035
|
+
thread_id="th_abc123",
|
|
1036
|
+
comment_id="cm_abc123",
|
|
1037
|
+
body=EditCommentRequestBody(
|
|
1038
|
+
body=...,
|
|
1039
|
+
# edited_at=...,
|
|
1040
|
+
# metadata=...,
|
|
1041
|
+
# attachment_ids=[],
|
|
1042
|
+
),
|
|
1043
|
+
)
|
|
1044
|
+
print(result)
|
|
1045
|
+
```
|
|
1046
|
+
**Parameters:**
|
|
1047
|
+
|
|
1048
|
+
| Name | Type | Required | Description |
|
|
1049
|
+
|------|------|----------|-------------|
|
|
1050
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
1051
|
+
| `thread_id` | `str` | Yes | ID of the thread |
|
|
1052
|
+
| `comment_id` | `str` | Yes | ID of the comment |
|
|
1053
|
+
| `body` | `EditCommentRequestBody` | Yes | Request body (application/json) |
|
|
1054
|
+
|
|
1055
|
+
|
|
1056
|
+
---
|
|
1057
|
+
|
|
1058
|
+
#### `delete_comment`
|
|
1059
|
+
|
|
1060
|
+
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).
|
|
1061
|
+
|
|
1062
|
+
**Example**
|
|
1063
|
+
```python
|
|
1064
|
+
client.delete_comment(
|
|
1065
|
+
room_id="my-room-id",
|
|
1066
|
+
thread_id="th_abc123",
|
|
1067
|
+
comment_id="cm_abc123",
|
|
1068
|
+
)
|
|
1069
|
+
```
|
|
1070
|
+
**Parameters:**
|
|
1071
|
+
|
|
1072
|
+
| Name | Type | Required | Description |
|
|
1073
|
+
|------|------|----------|-------------|
|
|
1074
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
1075
|
+
| `thread_id` | `str` | Yes | ID of the thread |
|
|
1076
|
+
| `comment_id` | `str` | Yes | ID of the comment |
|
|
1077
|
+
|
|
1078
|
+
|
|
1079
|
+
---
|
|
1080
|
+
|
|
1081
|
+
#### `add_comment_reaction`
|
|
1082
|
+
|
|
1083
|
+
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).
|
|
1084
|
+
|
|
1085
|
+
**Example**
|
|
1086
|
+
```python
|
|
1087
|
+
from liveblocks.models import AddCommentReactionRequestBody
|
|
1088
|
+
|
|
1089
|
+
result = client.add_comment_reaction(
|
|
1090
|
+
room_id="my-room-id",
|
|
1091
|
+
thread_id="th_abc123",
|
|
1092
|
+
comment_id="cm_abc123",
|
|
1093
|
+
body=AddCommentReactionRequestBody(
|
|
1094
|
+
user_id="...",
|
|
1095
|
+
emoji="...",
|
|
1096
|
+
# created_at=...,
|
|
1097
|
+
),
|
|
1098
|
+
)
|
|
1099
|
+
print(result)
|
|
1100
|
+
```
|
|
1101
|
+
**Parameters:**
|
|
1102
|
+
|
|
1103
|
+
| Name | Type | Required | Description |
|
|
1104
|
+
|------|------|----------|-------------|
|
|
1105
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
1106
|
+
| `thread_id` | `str` | Yes | ID of the thread |
|
|
1107
|
+
| `comment_id` | `str` | Yes | ID of the comment |
|
|
1108
|
+
| `body` | `AddCommentReactionRequestBody` | Yes | Request body (application/json) |
|
|
1109
|
+
|
|
1110
|
+
|
|
1111
|
+
---
|
|
1112
|
+
|
|
1113
|
+
#### `remove_comment_reaction`
|
|
1114
|
+
|
|
1115
|
+
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).
|
|
1116
|
+
|
|
1117
|
+
**Example**
|
|
1118
|
+
```python
|
|
1119
|
+
client.remove_comment_reaction(
|
|
1120
|
+
room_id="my-room-id",
|
|
1121
|
+
thread_id="th_abc123",
|
|
1122
|
+
comment_id="cm_abc123",
|
|
1123
|
+
)
|
|
1124
|
+
```
|
|
1125
|
+
**Parameters:**
|
|
1126
|
+
|
|
1127
|
+
| Name | Type | Required | Description |
|
|
1128
|
+
|------|------|----------|-------------|
|
|
1129
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
1130
|
+
| `thread_id` | `str` | Yes | ID of the thread |
|
|
1131
|
+
| `comment_id` | `str` | Yes | ID of the comment |
|
|
1132
|
+
| `body` | `RemoveCommentReactionRequestBody \| Unset` | No | Request body (application/json) |
|
|
1133
|
+
|
|
1134
|
+
|
|
1135
|
+
---
|
|
1136
|
+
|
|
1137
|
+
#### `edit_comment_metadata`
|
|
1138
|
+
|
|
1139
|
+
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).
|
|
1140
|
+
|
|
1141
|
+
`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.
|
|
1142
|
+
|
|
1143
|
+
**Example**
|
|
1144
|
+
```python
|
|
1145
|
+
from liveblocks.models import EditCommentMetadataRequestBody
|
|
1146
|
+
|
|
1147
|
+
result = client.edit_comment_metadata(
|
|
1148
|
+
room_id="my-room-id",
|
|
1149
|
+
thread_id="th_abc123",
|
|
1150
|
+
comment_id="cm_abc123",
|
|
1151
|
+
body=EditCommentMetadataRequestBody(
|
|
1152
|
+
metadata=...,
|
|
1153
|
+
user_id="...",
|
|
1154
|
+
# updated_at=...,
|
|
1155
|
+
),
|
|
1156
|
+
)
|
|
1157
|
+
print(result)
|
|
1158
|
+
```
|
|
1159
|
+
**Parameters:**
|
|
1160
|
+
|
|
1161
|
+
| Name | Type | Required | Description |
|
|
1162
|
+
|------|------|----------|-------------|
|
|
1163
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
1164
|
+
| `thread_id` | `str` | Yes | ID of the thread |
|
|
1165
|
+
| `comment_id` | `str` | Yes | ID of the comment |
|
|
1166
|
+
| `body` | `EditCommentMetadataRequestBody` | Yes | Request body (application/json) |
|
|
1167
|
+
|
|
1168
|
+
|
|
1169
|
+
---
|
|
1170
|
+
|
|
1171
|
+
#### `get_thread_inbox_notifications`
|
|
1172
|
+
|
|
1173
|
+
This endpoint returns the inbox notifications associated with a specific thread. Because this endpoint is not user-scoped, each notification includes a `userId` field identifying which user the notification belongs to. Only thread-kind notifications are returned.
|
|
1174
|
+
|
|
1175
|
+
**Example**
|
|
1176
|
+
```python
|
|
1177
|
+
result = client.get_thread_inbox_notifications(
|
|
1178
|
+
room_id="my-room-id",
|
|
1179
|
+
thread_id="th_abc123",
|
|
1180
|
+
)
|
|
1181
|
+
print(result)
|
|
1182
|
+
```
|
|
1183
|
+
**Parameters:**
|
|
1184
|
+
|
|
1185
|
+
| Name | Type | Required | Description |
|
|
1186
|
+
|------|------|----------|-------------|
|
|
1187
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
1188
|
+
| `thread_id` | `str` | Yes | ID of the thread |
|
|
1189
|
+
|
|
1190
|
+
|
|
1191
|
+
---
|
|
1192
|
+
|
|
1193
|
+
### Auth
|
|
1194
|
+
|
|
1195
|
+
#### `authorize_user`
|
|
1196
|
+
|
|
1197
|
+
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.
|
|
1198
|
+
|
|
1199
|
+
**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.
|
|
1200
|
+
|
|
1201
|
+
**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.
|
|
1202
|
+
|
|
1203
|
+
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.
|
|
1204
|
+
|
|
1205
|
+
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.
|
|
1206
|
+
|
|
1207
|
+
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).
|
|
1208
|
+
|
|
1209
|
+
**Example**
|
|
1210
|
+
```python
|
|
1211
|
+
from liveblocks.models import AuthorizeUserRequestBody
|
|
1212
|
+
|
|
1213
|
+
result = client.authorize_user(
|
|
1214
|
+
body=AuthorizeUserRequestBody(
|
|
1215
|
+
user_id="...",
|
|
1216
|
+
permissions=...,
|
|
1217
|
+
# user_info=...,
|
|
1218
|
+
# organization_id="...",
|
|
1219
|
+
),
|
|
1220
|
+
)
|
|
1221
|
+
print(result)
|
|
1222
|
+
```
|
|
1223
|
+
**Parameters:**
|
|
1224
|
+
|
|
1225
|
+
| Name | Type | Required | Description |
|
|
1226
|
+
|------|------|----------|-------------|
|
|
1227
|
+
| `body` | `AuthorizeUserRequestBody` | Yes | Request body (application/json) |
|
|
1228
|
+
|
|
1229
|
+
|
|
1230
|
+
---
|
|
1231
|
+
|
|
1232
|
+
#### `identify_user`
|
|
1233
|
+
|
|
1234
|
+
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.
|
|
1235
|
+
|
|
1236
|
+
**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.
|
|
1237
|
+
|
|
1238
|
+
**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.
|
|
1239
|
+
|
|
1240
|
+
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.
|
|
1241
|
+
|
|
1242
|
+
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)).
|
|
1243
|
+
|
|
1244
|
+
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.
|
|
1245
|
+
|
|
1246
|
+
**Example**
|
|
1247
|
+
```python
|
|
1248
|
+
from liveblocks.models import IdentifyUserRequestBody
|
|
1249
|
+
|
|
1250
|
+
result = client.identify_user(
|
|
1251
|
+
body=IdentifyUserRequestBody(
|
|
1252
|
+
user_id="...",
|
|
1253
|
+
# organization_id="...",
|
|
1254
|
+
# group_ids=[],
|
|
1255
|
+
# user_info=...,
|
|
1256
|
+
),
|
|
1257
|
+
)
|
|
1258
|
+
print(result)
|
|
1259
|
+
```
|
|
1260
|
+
**Parameters:**
|
|
1261
|
+
|
|
1262
|
+
| Name | Type | Required | Description |
|
|
1263
|
+
|------|------|----------|-------------|
|
|
1264
|
+
| `body` | `IdentifyUserRequestBody` | Yes | Request body (application/json) |
|
|
1265
|
+
|
|
1266
|
+
|
|
1267
|
+
---
|
|
1268
|
+
|
|
1269
|
+
### Notifications
|
|
1270
|
+
|
|
1271
|
+
#### `get_inbox_notification`
|
|
1272
|
+
|
|
1273
|
+
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).
|
|
1274
|
+
|
|
1275
|
+
**Example**
|
|
1276
|
+
```python
|
|
1277
|
+
result = client.get_inbox_notification(
|
|
1278
|
+
user_id="user-123",
|
|
1279
|
+
inbox_notification_id="in_abc123",
|
|
1280
|
+
)
|
|
1281
|
+
print(result)
|
|
1282
|
+
```
|
|
1283
|
+
**Parameters:**
|
|
1284
|
+
|
|
1285
|
+
| Name | Type | Required | Description |
|
|
1286
|
+
|------|------|----------|-------------|
|
|
1287
|
+
| `user_id` | `str` | Yes | ID of the user |
|
|
1288
|
+
| `inbox_notification_id` | `str` | Yes | ID of the inbox notification |
|
|
1289
|
+
|
|
1290
|
+
|
|
1291
|
+
---
|
|
1292
|
+
|
|
1293
|
+
#### `delete_inbox_notification`
|
|
1294
|
+
|
|
1295
|
+
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).
|
|
1296
|
+
|
|
1297
|
+
**Example**
|
|
1298
|
+
```python
|
|
1299
|
+
client.delete_inbox_notification(
|
|
1300
|
+
user_id="user-123",
|
|
1301
|
+
inbox_notification_id="in_abc123",
|
|
1302
|
+
)
|
|
1303
|
+
```
|
|
1304
|
+
**Parameters:**
|
|
1305
|
+
|
|
1306
|
+
| Name | Type | Required | Description |
|
|
1307
|
+
|------|------|----------|-------------|
|
|
1308
|
+
| `user_id` | `str` | Yes | ID of the user |
|
|
1309
|
+
| `inbox_notification_id` | `str` | Yes | ID of the inbox notification |
|
|
1310
|
+
|
|
1311
|
+
|
|
1312
|
+
---
|
|
1313
|
+
|
|
1314
|
+
#### `get_inbox_notifications`
|
|
1315
|
+
|
|
1316
|
+
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).
|
|
1317
|
+
|
|
1318
|
+
**Example**
|
|
1319
|
+
```python
|
|
1320
|
+
result = client.get_inbox_notifications(
|
|
1321
|
+
user_id="user-123",
|
|
1322
|
+
# organization_id="org_123456789",
|
|
1323
|
+
# query="metadata[\"color\"]:\"blue\"",
|
|
1324
|
+
# limit=20,
|
|
1325
|
+
# starting_after="eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
|
|
1326
|
+
)
|
|
1327
|
+
print(result)
|
|
1328
|
+
```
|
|
1329
|
+
**Parameters:**
|
|
1330
|
+
|
|
1331
|
+
| Name | Type | Required | Description |
|
|
1332
|
+
|------|------|----------|-------------|
|
|
1333
|
+
| `user_id` | `str` | Yes | ID of the user |
|
|
1334
|
+
| `organization_id` | `str \| Unset` | No | The organization ID to filter notifications for. |
|
|
1335
|
+
| `query` | `str \| Unset` | No | Query to filter notifications. You can filter by `unread`, for example, `unread:true`. |
|
|
1336
|
+
| `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`)* |
|
|
1337
|
+
| `starting_after` | `str \| Unset` | No | A cursor used for pagination. Get the value from the `nextCursor` response of the previous page. |
|
|
1338
|
+
|
|
1339
|
+
|
|
1340
|
+
---
|
|
1341
|
+
|
|
1342
|
+
#### `delete_all_inbox_notifications`
|
|
1343
|
+
|
|
1344
|
+
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).
|
|
1345
|
+
|
|
1346
|
+
**Example**
|
|
1347
|
+
```python
|
|
1348
|
+
client.delete_all_inbox_notifications(
|
|
1349
|
+
user_id="user-123",
|
|
1350
|
+
)
|
|
1351
|
+
```
|
|
1352
|
+
**Parameters:**
|
|
1353
|
+
|
|
1354
|
+
| Name | Type | Required | Description |
|
|
1355
|
+
|------|------|----------|-------------|
|
|
1356
|
+
| `user_id` | `str` | Yes | ID of the user |
|
|
1357
|
+
|
|
1358
|
+
|
|
1359
|
+
---
|
|
1360
|
+
|
|
1361
|
+
#### `get_notification_settings`
|
|
1362
|
+
|
|
1363
|
+
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).
|
|
1364
|
+
|
|
1365
|
+
**Example**
|
|
1366
|
+
```python
|
|
1367
|
+
result = client.get_notification_settings(
|
|
1368
|
+
user_id="user-123",
|
|
1369
|
+
)
|
|
1370
|
+
print(result)
|
|
1371
|
+
```
|
|
1372
|
+
**Parameters:**
|
|
1373
|
+
|
|
1374
|
+
| Name | Type | Required | Description |
|
|
1375
|
+
|------|------|----------|-------------|
|
|
1376
|
+
| `user_id` | `str` | Yes | ID of the user |
|
|
1377
|
+
|
|
1378
|
+
|
|
1379
|
+
---
|
|
1380
|
+
|
|
1381
|
+
#### `update_notification_settings`
|
|
1382
|
+
|
|
1383
|
+
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).
|
|
1384
|
+
|
|
1385
|
+
**Example**
|
|
1386
|
+
```python
|
|
1387
|
+
from liveblocks.models import UpdateNotificationSettingsRequestBody
|
|
1388
|
+
|
|
1389
|
+
result = client.update_notification_settings(
|
|
1390
|
+
user_id="user-123",
|
|
1391
|
+
body=UpdateNotificationSettingsRequestBody(
|
|
1392
|
+
# email=...,
|
|
1393
|
+
# slack=...,
|
|
1394
|
+
# teams=...,
|
|
1395
|
+
),
|
|
1396
|
+
)
|
|
1397
|
+
print(result)
|
|
1398
|
+
```
|
|
1399
|
+
**Parameters:**
|
|
1400
|
+
|
|
1401
|
+
| Name | Type | Required | Description |
|
|
1402
|
+
|------|------|----------|-------------|
|
|
1403
|
+
| `user_id` | `str` | Yes | ID of the user |
|
|
1404
|
+
| `body` | `UpdateNotificationSettingsRequestBody` | Yes | Request body (application/json) |
|
|
1405
|
+
|
|
1406
|
+
|
|
1407
|
+
---
|
|
1408
|
+
|
|
1409
|
+
#### `delete_notification_settings`
|
|
1410
|
+
|
|
1411
|
+
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).
|
|
1412
|
+
|
|
1413
|
+
**Example**
|
|
1414
|
+
```python
|
|
1415
|
+
client.delete_notification_settings(
|
|
1416
|
+
user_id="user-123",
|
|
1417
|
+
)
|
|
1418
|
+
```
|
|
1419
|
+
**Parameters:**
|
|
1420
|
+
|
|
1421
|
+
| Name | Type | Required | Description |
|
|
1422
|
+
|------|------|----------|-------------|
|
|
1423
|
+
| `user_id` | `str` | Yes | ID of the user |
|
|
1424
|
+
|
|
1425
|
+
|
|
1426
|
+
---
|
|
1427
|
+
|
|
1428
|
+
#### `get_room_subscription_settings`
|
|
1429
|
+
|
|
1430
|
+
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).
|
|
1431
|
+
|
|
1432
|
+
**Example**
|
|
1433
|
+
```python
|
|
1434
|
+
result = client.get_room_subscription_settings(
|
|
1435
|
+
room_id="my-room-id",
|
|
1436
|
+
user_id="user-123",
|
|
1437
|
+
)
|
|
1438
|
+
print(result)
|
|
1439
|
+
```
|
|
1440
|
+
**Parameters:**
|
|
1441
|
+
|
|
1442
|
+
| Name | Type | Required | Description |
|
|
1443
|
+
|------|------|----------|-------------|
|
|
1444
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
1445
|
+
| `user_id` | `str` | Yes | ID of the user |
|
|
1446
|
+
|
|
1447
|
+
|
|
1448
|
+
---
|
|
1449
|
+
|
|
1450
|
+
#### `update_room_subscription_settings`
|
|
1451
|
+
|
|
1452
|
+
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).
|
|
1453
|
+
|
|
1454
|
+
**Example**
|
|
1455
|
+
```python
|
|
1456
|
+
from liveblocks.models import UpdateRoomSubscriptionSettingsRequestBody
|
|
1457
|
+
|
|
1458
|
+
result = client.update_room_subscription_settings(
|
|
1459
|
+
room_id="my-room-id",
|
|
1460
|
+
user_id="user-123",
|
|
1461
|
+
body=UpdateRoomSubscriptionSettingsRequestBody(
|
|
1462
|
+
# threads=...,
|
|
1463
|
+
# text_mentions=...,
|
|
1464
|
+
),
|
|
1465
|
+
)
|
|
1466
|
+
print(result)
|
|
1467
|
+
```
|
|
1468
|
+
**Parameters:**
|
|
1469
|
+
|
|
1470
|
+
| Name | Type | Required | Description |
|
|
1471
|
+
|------|------|----------|-------------|
|
|
1472
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
1473
|
+
| `user_id` | `str` | Yes | ID of the user |
|
|
1474
|
+
| `body` | `UpdateRoomSubscriptionSettingsRequestBody` | Yes | Request body (application/json) |
|
|
1475
|
+
|
|
1476
|
+
|
|
1477
|
+
---
|
|
1478
|
+
|
|
1479
|
+
#### `delete_room_subscription_settings`
|
|
1480
|
+
|
|
1481
|
+
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).
|
|
1482
|
+
|
|
1483
|
+
**Example**
|
|
1484
|
+
```python
|
|
1485
|
+
client.delete_room_subscription_settings(
|
|
1486
|
+
room_id="my-room-id",
|
|
1487
|
+
user_id="user-123",
|
|
1488
|
+
)
|
|
1489
|
+
```
|
|
1490
|
+
**Parameters:**
|
|
1491
|
+
|
|
1492
|
+
| Name | Type | Required | Description |
|
|
1493
|
+
|------|------|----------|-------------|
|
|
1494
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
1495
|
+
| `user_id` | `str` | Yes | ID of the user |
|
|
1496
|
+
|
|
1497
|
+
|
|
1498
|
+
---
|
|
1499
|
+
|
|
1500
|
+
#### `get_user_room_subscription_settings`
|
|
1501
|
+
|
|
1502
|
+
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).
|
|
1503
|
+
|
|
1504
|
+
**Example**
|
|
1505
|
+
```python
|
|
1506
|
+
result = client.get_user_room_subscription_settings(
|
|
1507
|
+
user_id="user-123",
|
|
1508
|
+
# starting_after="eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
|
|
1509
|
+
# limit=20,
|
|
1510
|
+
# organization_id="org_123456789",
|
|
1511
|
+
)
|
|
1512
|
+
print(result)
|
|
1513
|
+
```
|
|
1514
|
+
**Parameters:**
|
|
1515
|
+
|
|
1516
|
+
| Name | Type | Required | Description |
|
|
1517
|
+
|------|------|----------|-------------|
|
|
1518
|
+
| `user_id` | `str` | Yes | ID of the user |
|
|
1519
|
+
| `starting_after` | `str \| Unset` | No | A cursor used for pagination. Get the value from the `nextCursor` response of the previous page. |
|
|
1520
|
+
| `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`)* |
|
|
1521
|
+
| `organization_id` | `str \| Unset` | No | The organization ID to filter room subscription settings for. |
|
|
1522
|
+
|
|
1523
|
+
|
|
1524
|
+
---
|
|
1525
|
+
|
|
1526
|
+
#### `get_room_notification_settings`
|
|
1527
|
+
|
|
1528
|
+
**Deprecated.** Renamed to [`/subscription-settings`](get-room-subscription-settings). Read more in our [migration guide](https://liveblocks.io/docs/platform/upgrading/2.24).
|
|
1529
|
+
|
|
1530
|
+
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).
|
|
1531
|
+
|
|
1532
|
+
**Example**
|
|
1533
|
+
```python
|
|
1534
|
+
result = client.get_room_notification_settings(
|
|
1535
|
+
room_id="my-room-id",
|
|
1536
|
+
user_id="user-123",
|
|
1537
|
+
)
|
|
1538
|
+
print(result)
|
|
1539
|
+
```
|
|
1540
|
+
**Parameters:**
|
|
1541
|
+
|
|
1542
|
+
| Name | Type | Required | Description |
|
|
1543
|
+
|------|------|----------|-------------|
|
|
1544
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
1545
|
+
| `user_id` | `str` | Yes | ID of the user |
|
|
1546
|
+
|
|
1547
|
+
|
|
1548
|
+
---
|
|
1549
|
+
|
|
1550
|
+
#### `update_room_notification_settings`
|
|
1551
|
+
|
|
1552
|
+
**Deprecated.** Renamed to [`/subscription-settings`](update-room-subscription-settings). Read more in our [migration guide](https://liveblocks.io/docs/platform/upgrading/2.24).
|
|
1553
|
+
|
|
1554
|
+
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).
|
|
1555
|
+
|
|
1556
|
+
**Example**
|
|
1557
|
+
```python
|
|
1558
|
+
result = client.update_room_notification_settings(
|
|
1559
|
+
room_id="my-room-id",
|
|
1560
|
+
user_id="user-123",
|
|
1561
|
+
)
|
|
1562
|
+
print(result)
|
|
1563
|
+
```
|
|
1564
|
+
**Parameters:**
|
|
1565
|
+
|
|
1566
|
+
| Name | Type | Required | Description |
|
|
1567
|
+
|------|------|----------|-------------|
|
|
1568
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
1569
|
+
| `user_id` | `str` | Yes | ID of the user |
|
|
1570
|
+
| `body` | `UpdateRoomSubscriptionSettingsRequestBody \| Unset` | No | Request body (application/json) |
|
|
1571
|
+
|
|
1572
|
+
|
|
1573
|
+
---
|
|
1574
|
+
|
|
1575
|
+
#### `delete_room_notification_settings`
|
|
1576
|
+
|
|
1577
|
+
**Deprecated.** Renamed to [`/subscription-settings`](delete-room-subscription-settings). Read more in our [migration guide](https://liveblocks.io/docs/platform/upgrading/2.24).
|
|
1578
|
+
|
|
1579
|
+
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).
|
|
1580
|
+
|
|
1581
|
+
**Example**
|
|
1582
|
+
```python
|
|
1583
|
+
client.delete_room_notification_settings(
|
|
1584
|
+
room_id="my-room-id",
|
|
1585
|
+
user_id="user-123",
|
|
1586
|
+
)
|
|
1587
|
+
```
|
|
1588
|
+
**Parameters:**
|
|
1589
|
+
|
|
1590
|
+
| Name | Type | Required | Description |
|
|
1591
|
+
|------|------|----------|-------------|
|
|
1592
|
+
| `room_id` | `str` | Yes | ID of the room |
|
|
1593
|
+
| `user_id` | `str` | Yes | ID of the user |
|
|
1594
|
+
|
|
1595
|
+
|
|
1596
|
+
---
|
|
1597
|
+
|
|
1598
|
+
#### `trigger_inbox_notification`
|
|
1599
|
+
|
|
1600
|
+
This endpoint triggers an inbox notification. Corresponds to [`liveblocks.triggerInboxNotification`](https://liveblocks.io/docs/api-reference/liveblocks-node#post-inbox-notifications-trigger).
|
|
1601
|
+
|
|
1602
|
+
**Example**
|
|
1603
|
+
```python
|
|
1604
|
+
client.trigger_inbox_notification()
|
|
1605
|
+
```
|
|
1606
|
+
**Parameters:**
|
|
1607
|
+
|
|
1608
|
+
| Name | Type | Required | Description |
|
|
1609
|
+
|------|------|----------|-------------|
|
|
1610
|
+
| `body` | `TriggerInboxNotificationRequestBody \| Unset` | No | Request body (application/json) |
|
|
1611
|
+
|
|
1612
|
+
|
|
1613
|
+
---
|
|
1614
|
+
|
|
1615
|
+
#### `mark_inbox_notification_as_read`
|
|
1616
|
+
|
|
1617
|
+
This endpoint marks a specific inbox notification as read.
|
|
1618
|
+
|
|
1619
|
+
**Example**
|
|
1620
|
+
```python
|
|
1621
|
+
client.mark_inbox_notification_as_read(
|
|
1622
|
+
inbox_notification_id="in_abc123",
|
|
1623
|
+
)
|
|
1624
|
+
```
|
|
1625
|
+
**Parameters:**
|
|
1626
|
+
|
|
1627
|
+
| Name | Type | Required | Description |
|
|
1628
|
+
|------|------|----------|-------------|
|
|
1629
|
+
| `inbox_notification_id` | `str` | Yes | ID of the inbox notification |
|
|
1630
|
+
|
|
1631
|
+
|
|
1632
|
+
---
|
|
1633
|
+
|
|
1634
|
+
### Groups
|
|
1635
|
+
|
|
1636
|
+
#### `get_groups`
|
|
1637
|
+
|
|
1638
|
+
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).
|
|
1639
|
+
|
|
1640
|
+
**Example**
|
|
1641
|
+
```python
|
|
1642
|
+
result = client.get_groups(
|
|
1643
|
+
# limit=20,
|
|
1644
|
+
# starting_after="eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
|
|
1645
|
+
)
|
|
1646
|
+
print(result)
|
|
1647
|
+
```
|
|
1648
|
+
**Parameters:**
|
|
1649
|
+
|
|
1650
|
+
| Name | Type | Required | Description |
|
|
1651
|
+
|------|------|----------|-------------|
|
|
1652
|
+
| `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`)* |
|
|
1653
|
+
| `starting_after` | `str \| Unset` | No | A cursor used for pagination. Get the value from the `nextCursor` response of the previous page. |
|
|
1654
|
+
|
|
1655
|
+
|
|
1656
|
+
---
|
|
1657
|
+
|
|
1658
|
+
#### `create_group`
|
|
1659
|
+
|
|
1660
|
+
This endpoint creates a new group. Corresponds to [`liveblocks.createGroup`](https://liveblocks.io/docs/api-reference/liveblocks-node#create-group).
|
|
1661
|
+
|
|
1662
|
+
**Example**
|
|
1663
|
+
```python
|
|
1664
|
+
result = client.create_group()
|
|
1665
|
+
print(result)
|
|
1666
|
+
```
|
|
1667
|
+
**Parameters:**
|
|
1668
|
+
|
|
1669
|
+
| Name | Type | Required | Description |
|
|
1670
|
+
|------|------|----------|-------------|
|
|
1671
|
+
| `body` | `CreateGroupRequestBody \| Unset` | No | Request body (application/json) |
|
|
1672
|
+
|
|
1673
|
+
|
|
1674
|
+
---
|
|
1675
|
+
|
|
1676
|
+
#### `get_group`
|
|
1677
|
+
|
|
1678
|
+
This endpoint returns a specific group by ID. Corresponds to [`liveblocks.getGroup`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-group).
|
|
1679
|
+
|
|
1680
|
+
**Example**
|
|
1681
|
+
```python
|
|
1682
|
+
result = client.get_group(
|
|
1683
|
+
group_id="engineering",
|
|
1684
|
+
)
|
|
1685
|
+
print(result)
|
|
1686
|
+
```
|
|
1687
|
+
**Parameters:**
|
|
1688
|
+
|
|
1689
|
+
| Name | Type | Required | Description |
|
|
1690
|
+
|------|------|----------|-------------|
|
|
1691
|
+
| `group_id` | `str` | Yes | The ID of the group to retrieve. |
|
|
1692
|
+
|
|
1693
|
+
|
|
1694
|
+
---
|
|
1695
|
+
|
|
1696
|
+
#### `delete_group`
|
|
1697
|
+
|
|
1698
|
+
This endpoint deletes a group. Corresponds to [`liveblocks.deleteGroup`](https://liveblocks.io/docs/api-reference/liveblocks-node#delete-group).
|
|
1699
|
+
|
|
1700
|
+
**Example**
|
|
1701
|
+
```python
|
|
1702
|
+
client.delete_group(
|
|
1703
|
+
group_id="engineering",
|
|
1704
|
+
)
|
|
1705
|
+
```
|
|
1706
|
+
**Parameters:**
|
|
1707
|
+
|
|
1708
|
+
| Name | Type | Required | Description |
|
|
1709
|
+
|------|------|----------|-------------|
|
|
1710
|
+
| `group_id` | `str` | Yes | The ID of the group to delete. |
|
|
1711
|
+
|
|
1712
|
+
|
|
1713
|
+
---
|
|
1714
|
+
|
|
1715
|
+
#### `add_group_members`
|
|
1716
|
+
|
|
1717
|
+
This endpoint adds new members to an existing group. Corresponds to [`liveblocks.addGroupMembers`](https://liveblocks.io/docs/api-reference/liveblocks-node#add-group-members).
|
|
1718
|
+
|
|
1719
|
+
**Example**
|
|
1720
|
+
```python
|
|
1721
|
+
from liveblocks.models import AddGroupMembersRequestBody
|
|
1722
|
+
|
|
1723
|
+
result = client.add_group_members(
|
|
1724
|
+
group_id="engineering",
|
|
1725
|
+
body=AddGroupMembersRequestBody(
|
|
1726
|
+
member_ids=[],
|
|
1727
|
+
),
|
|
1728
|
+
)
|
|
1729
|
+
print(result)
|
|
1730
|
+
```
|
|
1731
|
+
**Parameters:**
|
|
1732
|
+
|
|
1733
|
+
| Name | Type | Required | Description |
|
|
1734
|
+
|------|------|----------|-------------|
|
|
1735
|
+
| `group_id` | `str` | Yes | The ID of the group to add members to. |
|
|
1736
|
+
| `body` | `AddGroupMembersRequestBody` | Yes | Request body (application/json) |
|
|
1737
|
+
|
|
1738
|
+
|
|
1739
|
+
---
|
|
1740
|
+
|
|
1741
|
+
#### `remove_group_members`
|
|
1742
|
+
|
|
1743
|
+
This endpoint removes members from an existing group. Corresponds to [`liveblocks.removeGroupMembers`](https://liveblocks.io/docs/api-reference/liveblocks-node#remove-group-members).
|
|
1744
|
+
|
|
1745
|
+
**Example**
|
|
1746
|
+
```python
|
|
1747
|
+
from liveblocks.models import RemoveGroupMembersRequestBody
|
|
1748
|
+
|
|
1749
|
+
result = client.remove_group_members(
|
|
1750
|
+
group_id="engineering",
|
|
1751
|
+
body=RemoveGroupMembersRequestBody(
|
|
1752
|
+
member_ids=[],
|
|
1753
|
+
),
|
|
1754
|
+
)
|
|
1755
|
+
print(result)
|
|
1756
|
+
```
|
|
1757
|
+
**Parameters:**
|
|
1758
|
+
|
|
1759
|
+
| Name | Type | Required | Description |
|
|
1760
|
+
|------|------|----------|-------------|
|
|
1761
|
+
| `group_id` | `str` | Yes | The ID of the group to remove members from. |
|
|
1762
|
+
| `body` | `RemoveGroupMembersRequestBody` | Yes | Request body (application/json) |
|
|
1763
|
+
|
|
1764
|
+
|
|
1765
|
+
---
|
|
1766
|
+
|
|
1767
|
+
#### `get_user_groups`
|
|
1768
|
+
|
|
1769
|
+
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).
|
|
1770
|
+
|
|
1771
|
+
**Example**
|
|
1772
|
+
```python
|
|
1773
|
+
result = client.get_user_groups(
|
|
1774
|
+
user_id="user-123",
|
|
1775
|
+
# limit=20,
|
|
1776
|
+
# starting_after="eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
|
|
1777
|
+
)
|
|
1778
|
+
print(result)
|
|
1779
|
+
```
|
|
1780
|
+
**Parameters:**
|
|
1781
|
+
|
|
1782
|
+
| Name | Type | Required | Description |
|
|
1783
|
+
|------|------|----------|-------------|
|
|
1784
|
+
| `user_id` | `str` | Yes | The ID of the user to get groups for. |
|
|
1785
|
+
| `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`)* |
|
|
1786
|
+
| `starting_after` | `str \| Unset` | No | A cursor used for pagination. Get the value from the `nextCursor` response of the previous page. |
|
|
1787
|
+
|
|
1788
|
+
|
|
1789
|
+
---
|
|
1790
|
+
|
|
1791
|
+
### Ai
|
|
1792
|
+
|
|
1793
|
+
#### `get_ai_copilots`
|
|
1794
|
+
|
|
1795
|
+
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).
|
|
1796
|
+
|
|
1797
|
+
**Example**
|
|
1798
|
+
```python
|
|
1799
|
+
result = client.get_ai_copilots(
|
|
1800
|
+
# limit=20,
|
|
1801
|
+
# starting_after="eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
|
|
1802
|
+
)
|
|
1803
|
+
print(result)
|
|
1804
|
+
```
|
|
1805
|
+
**Parameters:**
|
|
1806
|
+
|
|
1807
|
+
| Name | Type | Required | Description |
|
|
1808
|
+
|------|------|----------|-------------|
|
|
1809
|
+
| `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`)* |
|
|
1810
|
+
| `starting_after` | `str \| Unset` | No | A cursor used for pagination. Get the value from the `nextCursor` response of the previous page. |
|
|
1811
|
+
|
|
1812
|
+
|
|
1813
|
+
---
|
|
1814
|
+
|
|
1815
|
+
#### `create_ai_copilot`
|
|
1816
|
+
|
|
1817
|
+
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).
|
|
1818
|
+
|
|
1819
|
+
**Example**
|
|
1820
|
+
```python
|
|
1821
|
+
result = client.create_ai_copilot(
|
|
1822
|
+
body=...,
|
|
1823
|
+
)
|
|
1824
|
+
print(result)
|
|
1825
|
+
```
|
|
1826
|
+
**Parameters:**
|
|
1827
|
+
|
|
1828
|
+
| Name | Type | Required | Description |
|
|
1829
|
+
|------|------|----------|-------------|
|
|
1830
|
+
| `body` | `CreateAiCopilotOptionsAnthropic \| CreateAiCopilotOptionsGoogle \| CreateAiCopilotOptionsOpenAi \| CreateAiCopilotOptionsOpenAiCompatible` | Yes | Request body (application/json) |
|
|
1831
|
+
|
|
1832
|
+
|
|
1833
|
+
---
|
|
1834
|
+
|
|
1835
|
+
#### `get_ai_copilot`
|
|
1836
|
+
|
|
1837
|
+
This endpoint returns an AI copilot by its ID. Corresponds to [`liveblocks.getAiCopilot`](https://liveblocks.io/docs/api-reference/liveblocks-node#get-ai-copilot).
|
|
1838
|
+
|
|
1839
|
+
**Example**
|
|
1840
|
+
```python
|
|
1841
|
+
result = client.get_ai_copilot(
|
|
1842
|
+
copilot_id="cp_abc123",
|
|
1843
|
+
)
|
|
1844
|
+
print(result)
|
|
1845
|
+
```
|
|
1846
|
+
**Parameters:**
|
|
1847
|
+
|
|
1848
|
+
| Name | Type | Required | Description |
|
|
1849
|
+
|------|------|----------|-------------|
|
|
1850
|
+
| `copilot_id` | `str` | Yes | ID of the AI copilot |
|
|
1851
|
+
|
|
1852
|
+
|
|
1853
|
+
---
|
|
1854
|
+
|
|
1855
|
+
#### `update_ai_copilot`
|
|
1856
|
+
|
|
1857
|
+
This endpoint updates an existing AI copilot's configuration. Corresponds to [`liveblocks.updateAiCopilot`](https://liveblocks.io/docs/api-reference/liveblocks-node#update-ai-copilot).
|
|
1858
|
+
|
|
1859
|
+
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.
|
|
1860
|
+
|
|
1861
|
+
**Example**
|
|
1862
|
+
```python
|
|
1863
|
+
from liveblocks.models import UpdateAiCopilotRequestBody
|
|
1864
|
+
|
|
1865
|
+
result = client.update_ai_copilot(
|
|
1866
|
+
copilot_id="cp_abc123",
|
|
1867
|
+
body=UpdateAiCopilotRequestBody(
|
|
1868
|
+
# name="...",
|
|
1869
|
+
# description="...",
|
|
1870
|
+
# system_prompt="...",
|
|
1871
|
+
),
|
|
1872
|
+
)
|
|
1873
|
+
print(result)
|
|
1874
|
+
```
|
|
1875
|
+
**Parameters:**
|
|
1876
|
+
|
|
1877
|
+
| Name | Type | Required | Description |
|
|
1878
|
+
|------|------|----------|-------------|
|
|
1879
|
+
| `copilot_id` | `str` | Yes | ID of the AI copilot |
|
|
1880
|
+
| `body` | `UpdateAiCopilotRequestBody` | Yes | Request body (application/json) |
|
|
1881
|
+
|
|
1882
|
+
|
|
1883
|
+
---
|
|
1884
|
+
|
|
1885
|
+
#### `delete_ai_copilot`
|
|
1886
|
+
|
|
1887
|
+
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).
|
|
1888
|
+
|
|
1889
|
+
**Example**
|
|
1890
|
+
```python
|
|
1891
|
+
client.delete_ai_copilot(
|
|
1892
|
+
copilot_id="cp_abc123",
|
|
1893
|
+
)
|
|
1894
|
+
```
|
|
1895
|
+
**Parameters:**
|
|
1896
|
+
|
|
1897
|
+
| Name | Type | Required | Description |
|
|
1898
|
+
|------|------|----------|-------------|
|
|
1899
|
+
| `copilot_id` | `str` | Yes | ID of the AI copilot |
|
|
1900
|
+
|
|
1901
|
+
|
|
1902
|
+
---
|
|
1903
|
+
|
|
1904
|
+
#### `get_knowledge_sources`
|
|
1905
|
+
|
|
1906
|
+
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).
|
|
1907
|
+
|
|
1908
|
+
**Example**
|
|
1909
|
+
```python
|
|
1910
|
+
result = client.get_knowledge_sources(
|
|
1911
|
+
copilot_id="cp_abc123",
|
|
1912
|
+
# limit=20,
|
|
1913
|
+
# starting_after="eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
|
|
1914
|
+
)
|
|
1915
|
+
print(result)
|
|
1916
|
+
```
|
|
1917
|
+
**Parameters:**
|
|
1918
|
+
|
|
1919
|
+
| Name | Type | Required | Description |
|
|
1920
|
+
|------|------|----------|-------------|
|
|
1921
|
+
| `copilot_id` | `str` | Yes | ID of the AI copilot |
|
|
1922
|
+
| `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`)* |
|
|
1923
|
+
| `starting_after` | `str \| Unset` | No | A cursor used for pagination. Get the value from the `nextCursor` response of the previous page. |
|
|
1924
|
+
|
|
1925
|
+
|
|
1926
|
+
---
|
|
1927
|
+
|
|
1928
|
+
#### `get_knowledge_source`
|
|
1929
|
+
|
|
1930
|
+
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).
|
|
1931
|
+
|
|
1932
|
+
**Example**
|
|
1933
|
+
```python
|
|
1934
|
+
result = client.get_knowledge_source(
|
|
1935
|
+
copilot_id="cp_abc123",
|
|
1936
|
+
knowledge_source_id="ks_abc123",
|
|
1937
|
+
)
|
|
1938
|
+
print(result)
|
|
1939
|
+
```
|
|
1940
|
+
**Parameters:**
|
|
1941
|
+
|
|
1942
|
+
| Name | Type | Required | Description |
|
|
1943
|
+
|------|------|----------|-------------|
|
|
1944
|
+
| `copilot_id` | `str` | Yes | ID of the AI copilot |
|
|
1945
|
+
| `knowledge_source_id` | `str` | Yes | ID of the knowledge source |
|
|
1946
|
+
|
|
1947
|
+
|
|
1948
|
+
---
|
|
1949
|
+
|
|
1950
|
+
#### `create_web_knowledge_source`
|
|
1951
|
+
|
|
1952
|
+
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).
|
|
1953
|
+
|
|
1954
|
+
**Example**
|
|
1955
|
+
```python
|
|
1956
|
+
from liveblocks.models import CreateWebKnowledgeSourceRequestBody
|
|
1957
|
+
|
|
1958
|
+
result = client.create_web_knowledge_source(
|
|
1959
|
+
copilot_id="cp_abc123",
|
|
1960
|
+
body=CreateWebKnowledgeSourceRequestBody(
|
|
1961
|
+
copilot_id="...",
|
|
1962
|
+
url="...",
|
|
1963
|
+
type_=...,
|
|
1964
|
+
),
|
|
1965
|
+
)
|
|
1966
|
+
print(result)
|
|
1967
|
+
```
|
|
1968
|
+
**Parameters:**
|
|
1969
|
+
|
|
1970
|
+
| Name | Type | Required | Description |
|
|
1971
|
+
|------|------|----------|-------------|
|
|
1972
|
+
| `copilot_id` | `str` | Yes | ID of the AI copilot |
|
|
1973
|
+
| `body` | `CreateWebKnowledgeSourceRequestBody` | Yes | Request body (application/json) |
|
|
1974
|
+
|
|
1975
|
+
|
|
1976
|
+
---
|
|
1977
|
+
|
|
1978
|
+
#### `create_file_knowledge_source`
|
|
1979
|
+
|
|
1980
|
+
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).
|
|
1981
|
+
|
|
1982
|
+
**Example**
|
|
1983
|
+
```python
|
|
1984
|
+
result = client.create_file_knowledge_source(
|
|
1985
|
+
copilot_id="cp_abc123",
|
|
1986
|
+
name="document.pdf",
|
|
1987
|
+
body=...,
|
|
1988
|
+
)
|
|
1989
|
+
print(result)
|
|
1990
|
+
```
|
|
1991
|
+
**Parameters:**
|
|
1992
|
+
|
|
1993
|
+
| Name | Type | Required | Description |
|
|
1994
|
+
|------|------|----------|-------------|
|
|
1995
|
+
| `copilot_id` | `str` | Yes | ID of the AI copilot |
|
|
1996
|
+
| `name` | `str` | Yes | Name of the file |
|
|
1997
|
+
| `body` | `File` | Yes | Request body (application/octet-stream) |
|
|
1998
|
+
|
|
1999
|
+
|
|
2000
|
+
---
|
|
2001
|
+
|
|
2002
|
+
#### `get_file_knowledge_source_markdown`
|
|
2003
|
+
|
|
2004
|
+
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).
|
|
2005
|
+
|
|
2006
|
+
**Example**
|
|
2007
|
+
```python
|
|
2008
|
+
result = client.get_file_knowledge_source_markdown(
|
|
2009
|
+
copilot_id="cp_abc123",
|
|
2010
|
+
knowledge_source_id="ks_abc123",
|
|
2011
|
+
)
|
|
2012
|
+
print(result)
|
|
2013
|
+
```
|
|
2014
|
+
**Parameters:**
|
|
2015
|
+
|
|
2016
|
+
| Name | Type | Required | Description |
|
|
2017
|
+
|------|------|----------|-------------|
|
|
2018
|
+
| `copilot_id` | `str` | Yes | ID of the AI copilot |
|
|
2019
|
+
| `knowledge_source_id` | `str` | Yes | ID of the knowledge source |
|
|
2020
|
+
|
|
2021
|
+
|
|
2022
|
+
---
|
|
2023
|
+
|
|
2024
|
+
#### `delete_file_knowledge_source`
|
|
2025
|
+
|
|
2026
|
+
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).
|
|
2027
|
+
|
|
2028
|
+
**Example**
|
|
2029
|
+
```python
|
|
2030
|
+
client.delete_file_knowledge_source(
|
|
2031
|
+
copilot_id="cp_abc123",
|
|
2032
|
+
knowledge_source_id="ks_abc123",
|
|
2033
|
+
)
|
|
2034
|
+
```
|
|
2035
|
+
**Parameters:**
|
|
2036
|
+
|
|
2037
|
+
| Name | Type | Required | Description |
|
|
2038
|
+
|------|------|----------|-------------|
|
|
2039
|
+
| `copilot_id` | `str` | Yes | ID of the AI copilot |
|
|
2040
|
+
| `knowledge_source_id` | `str` | Yes | ID of the knowledge source |
|
|
2041
|
+
|
|
2042
|
+
|
|
2043
|
+
---
|
|
2044
|
+
|
|
2045
|
+
#### `delete_web_knowledge_source`
|
|
2046
|
+
|
|
2047
|
+
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).
|
|
2048
|
+
|
|
2049
|
+
**Example**
|
|
2050
|
+
```python
|
|
2051
|
+
client.delete_web_knowledge_source(
|
|
2052
|
+
copilot_id="cp_abc123",
|
|
2053
|
+
knowledge_source_id="ks_abc123",
|
|
2054
|
+
)
|
|
2055
|
+
```
|
|
2056
|
+
**Parameters:**
|
|
2057
|
+
|
|
2058
|
+
| Name | Type | Required | Description |
|
|
2059
|
+
|------|------|----------|-------------|
|
|
2060
|
+
| `copilot_id` | `str` | Yes | ID of the AI copilot |
|
|
2061
|
+
| `knowledge_source_id` | `str` | Yes | ID of the knowledge source |
|
|
2062
|
+
|
|
2063
|
+
|
|
2064
|
+
---
|
|
2065
|
+
|
|
2066
|
+
#### `get_web_knowledge_source_links`
|
|
2067
|
+
|
|
2068
|
+
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).
|
|
2069
|
+
|
|
2070
|
+
**Example**
|
|
2071
|
+
```python
|
|
2072
|
+
result = client.get_web_knowledge_source_links(
|
|
2073
|
+
copilot_id="cp_abc123",
|
|
2074
|
+
knowledge_source_id="ks_abc123",
|
|
2075
|
+
# limit=20,
|
|
2076
|
+
# starting_after="eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
|
|
2077
|
+
)
|
|
2078
|
+
print(result)
|
|
2079
|
+
```
|
|
2080
|
+
**Parameters:**
|
|
2081
|
+
|
|
2082
|
+
| Name | Type | Required | Description |
|
|
2083
|
+
|------|------|----------|-------------|
|
|
2084
|
+
| `copilot_id` | `str` | Yes | ID of the AI copilot |
|
|
2085
|
+
| `knowledge_source_id` | `str` | Yes | ID of the knowledge source |
|
|
2086
|
+
| `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`)* |
|
|
2087
|
+
| `starting_after` | `str \| Unset` | No | A cursor used for pagination. Get the value from the `nextCursor` response of the previous page. |
|
|
2088
|
+
|
|
2089
|
+
|
|
2090
|
+
---
|
|
2091
|
+
|
|
2092
|
+
### Management
|
|
2093
|
+
|
|
2094
|
+
#### `get_management_projects`
|
|
2095
|
+
|
|
2096
|
+
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.
|
|
2097
|
+
|
|
2098
|
+
**Example**
|
|
2099
|
+
```python
|
|
2100
|
+
result = client.get_management_projects(
|
|
2101
|
+
# limit=20,
|
|
2102
|
+
# cursor="eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
|
|
2103
|
+
)
|
|
2104
|
+
print(result)
|
|
2105
|
+
```
|
|
2106
|
+
**Parameters:**
|
|
2107
|
+
|
|
2108
|
+
| Name | Type | Required | Description |
|
|
2109
|
+
|------|------|----------|-------------|
|
|
2110
|
+
| `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`)* |
|
|
2111
|
+
| `cursor` | `str \| Unset` | No | A cursor used for pagination. Get the value from the `nextCursor` response of the previous page. |
|
|
2112
|
+
|
|
2113
|
+
|
|
2114
|
+
---
|
|
2115
|
+
|
|
2116
|
+
#### `create_management_project`
|
|
2117
|
+
|
|
2118
|
+
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.
|
|
2119
|
+
|
|
2120
|
+
**Example**
|
|
2121
|
+
```python
|
|
2122
|
+
from liveblocks.models import CreateManagementProjectRequestBody
|
|
2123
|
+
|
|
2124
|
+
result = client.create_management_project(
|
|
2125
|
+
body=CreateManagementProjectRequestBody(
|
|
2126
|
+
type_=...,
|
|
2127
|
+
# name="...",
|
|
2128
|
+
# version_creation_timeout=False,
|
|
2129
|
+
),
|
|
2130
|
+
)
|
|
2131
|
+
print(result)
|
|
2132
|
+
```
|
|
2133
|
+
**Parameters:**
|
|
2134
|
+
|
|
2135
|
+
| Name | Type | Required | Description |
|
|
2136
|
+
|------|------|----------|-------------|
|
|
2137
|
+
| `body` | `CreateManagementProjectRequestBody` | Yes | Request body (application/json) |
|
|
2138
|
+
|
|
2139
|
+
|
|
2140
|
+
---
|
|
2141
|
+
|
|
2142
|
+
#### `get_management_project`
|
|
2143
|
+
|
|
2144
|
+
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.
|
|
2145
|
+
|
|
2146
|
+
**Example**
|
|
2147
|
+
```python
|
|
2148
|
+
result = client.get_management_project(
|
|
2149
|
+
project_id="683d49ed6b4d1cec5a597b13",
|
|
2150
|
+
)
|
|
2151
|
+
print(result)
|
|
2152
|
+
```
|
|
2153
|
+
**Parameters:**
|
|
2154
|
+
|
|
2155
|
+
| Name | Type | Required | Description |
|
|
2156
|
+
|------|------|----------|-------------|
|
|
2157
|
+
| `project_id` | `str` | Yes | ID of the project |
|
|
2158
|
+
|
|
2159
|
+
|
|
2160
|
+
---
|
|
2161
|
+
|
|
2162
|
+
#### `update_management_project`
|
|
2163
|
+
|
|
2164
|
+
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.
|
|
2165
|
+
|
|
2166
|
+
If the project cannot be found, a 404 error response is returned.
|
|
2167
|
+
|
|
2168
|
+
**Example**
|
|
2169
|
+
```python
|
|
2170
|
+
from liveblocks.models import UpdateManagementProjectRequestBody
|
|
2171
|
+
|
|
2172
|
+
result = client.update_management_project(
|
|
2173
|
+
project_id="683d49ed6b4d1cec5a597b13",
|
|
2174
|
+
body=UpdateManagementProjectRequestBody(
|
|
2175
|
+
# name="...",
|
|
2176
|
+
# version_creation_timeout=False,
|
|
2177
|
+
),
|
|
2178
|
+
)
|
|
2179
|
+
print(result)
|
|
2180
|
+
```
|
|
2181
|
+
**Parameters:**
|
|
2182
|
+
|
|
2183
|
+
| Name | Type | Required | Description |
|
|
2184
|
+
|------|------|----------|-------------|
|
|
2185
|
+
| `project_id` | `str` | Yes | ID of the project |
|
|
2186
|
+
| `body` | `UpdateManagementProjectRequestBody` | Yes | Request body (application/json) |
|
|
2187
|
+
|
|
2188
|
+
|
|
2189
|
+
---
|
|
2190
|
+
|
|
2191
|
+
#### `delete_management_project`
|
|
2192
|
+
|
|
2193
|
+
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.
|
|
2194
|
+
|
|
2195
|
+
**Example**
|
|
2196
|
+
```python
|
|
2197
|
+
client.delete_management_project(
|
|
2198
|
+
project_id="683d49ed6b4d1cec5a597b13",
|
|
2199
|
+
)
|
|
2200
|
+
```
|
|
2201
|
+
**Parameters:**
|
|
2202
|
+
|
|
2203
|
+
| Name | Type | Required | Description |
|
|
2204
|
+
|------|------|----------|-------------|
|
|
2205
|
+
| `project_id` | `str` | Yes | ID of the project |
|
|
2206
|
+
|
|
2207
|
+
|
|
2208
|
+
---
|
|
2209
|
+
|
|
2210
|
+
#### `activate_project_public_api_key`
|
|
2211
|
+
|
|
2212
|
+
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.
|
|
2213
|
+
|
|
2214
|
+
**Example**
|
|
2215
|
+
```python
|
|
2216
|
+
client.activate_project_public_api_key(
|
|
2217
|
+
project_id="683d49ed6b4d1cec5a597b13",
|
|
2218
|
+
)
|
|
2219
|
+
```
|
|
2220
|
+
**Parameters:**
|
|
2221
|
+
|
|
2222
|
+
| Name | Type | Required | Description |
|
|
2223
|
+
|------|------|----------|-------------|
|
|
2224
|
+
| `project_id` | `str` | Yes | ID of the project |
|
|
2225
|
+
|
|
2226
|
+
|
|
2227
|
+
---
|
|
2228
|
+
|
|
2229
|
+
#### `deactivate_project_public_api_key`
|
|
2230
|
+
|
|
2231
|
+
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.
|
|
2232
|
+
|
|
2233
|
+
**Example**
|
|
2234
|
+
```python
|
|
2235
|
+
client.deactivate_project_public_api_key(
|
|
2236
|
+
project_id="683d49ed6b4d1cec5a597b13",
|
|
2237
|
+
)
|
|
2238
|
+
```
|
|
2239
|
+
**Parameters:**
|
|
2240
|
+
|
|
2241
|
+
| Name | Type | Required | Description |
|
|
2242
|
+
|------|------|----------|-------------|
|
|
2243
|
+
| `project_id` | `str` | Yes | ID of the project |
|
|
2244
|
+
|
|
2245
|
+
|
|
2246
|
+
---
|
|
2247
|
+
|
|
2248
|
+
#### `roll_project_public_api_key`
|
|
2249
|
+
|
|
2250
|
+
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.
|
|
2251
|
+
|
|
2252
|
+
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.
|
|
2253
|
+
|
|
2254
|
+
**Example**
|
|
2255
|
+
```python
|
|
2256
|
+
result = client.roll_project_public_api_key(
|
|
2257
|
+
project_id="683d49ed6b4d1cec5a597b13",
|
|
2258
|
+
)
|
|
2259
|
+
print(result)
|
|
2260
|
+
```
|
|
2261
|
+
**Parameters:**
|
|
2262
|
+
|
|
2263
|
+
| Name | Type | Required | Description |
|
|
2264
|
+
|------|------|----------|-------------|
|
|
2265
|
+
| `project_id` | `str` | Yes | ID of the project |
|
|
2266
|
+
| `body` | `RollProjectPublicApiKeyRequestBody \| Unset` | No | Request body (application/json) |
|
|
2267
|
+
|
|
2268
|
+
|
|
2269
|
+
---
|
|
2270
|
+
|
|
2271
|
+
#### `roll_project_secret_api_key`
|
|
2272
|
+
|
|
2273
|
+
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.
|
|
2274
|
+
|
|
2275
|
+
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.
|
|
2276
|
+
|
|
2277
|
+
**Example**
|
|
2278
|
+
```python
|
|
2279
|
+
result = client.roll_project_secret_api_key(
|
|
2280
|
+
project_id="683d49ed6b4d1cec5a597b13",
|
|
2281
|
+
)
|
|
2282
|
+
print(result)
|
|
2283
|
+
```
|
|
2284
|
+
**Parameters:**
|
|
2285
|
+
|
|
2286
|
+
| Name | Type | Required | Description |
|
|
2287
|
+
|------|------|----------|-------------|
|
|
2288
|
+
| `project_id` | `str` | Yes | ID of the project |
|
|
2289
|
+
| `body` | `RollProjectSecretApiKeyRequestBody \| Unset` | No | Request body (application/json) |
|
|
2290
|
+
|
|
2291
|
+
|
|
2292
|
+
---
|
|
2293
|
+
|
|
2294
|
+
#### `get_management_webhooks`
|
|
2295
|
+
|
|
2296
|
+
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.
|
|
2297
|
+
|
|
2298
|
+
**Example**
|
|
2299
|
+
```python
|
|
2300
|
+
result = client.get_management_webhooks(
|
|
2301
|
+
project_id="683d49ed6b4d1cec5a597b13",
|
|
2302
|
+
# limit=20,
|
|
2303
|
+
# cursor="eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
|
|
2304
|
+
)
|
|
2305
|
+
print(result)
|
|
2306
|
+
```
|
|
2307
|
+
**Parameters:**
|
|
2308
|
+
|
|
2309
|
+
| Name | Type | Required | Description |
|
|
2310
|
+
|------|------|----------|-------------|
|
|
2311
|
+
| `project_id` | `str` | Yes | ID of the project |
|
|
2312
|
+
| `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`)* |
|
|
2313
|
+
| `cursor` | `str \| Unset` | No | A cursor used for pagination. Get the value from the `nextCursor` response of the previous page. |
|
|
2314
|
+
|
|
2315
|
+
|
|
2316
|
+
---
|
|
2317
|
+
|
|
2318
|
+
#### `create_management_webhook`
|
|
2319
|
+
|
|
2320
|
+
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.
|
|
2321
|
+
|
|
2322
|
+
**Example**
|
|
2323
|
+
```python
|
|
2324
|
+
from liveblocks.models import CreateManagementWebhookRequestBody
|
|
2325
|
+
|
|
2326
|
+
result = client.create_management_webhook(
|
|
2327
|
+
project_id="683d49ed6b4d1cec5a597b13",
|
|
2328
|
+
body=CreateManagementWebhookRequestBody(
|
|
2329
|
+
url="...",
|
|
2330
|
+
subscribed_events=[],
|
|
2331
|
+
# rate_limit=0,
|
|
2332
|
+
# additional_headers=...,
|
|
2333
|
+
# storage_updated_throttle_seconds=0,
|
|
2334
|
+
),
|
|
2335
|
+
)
|
|
2336
|
+
print(result)
|
|
2337
|
+
```
|
|
2338
|
+
**Parameters:**
|
|
2339
|
+
|
|
2340
|
+
| Name | Type | Required | Description |
|
|
2341
|
+
|------|------|----------|-------------|
|
|
2342
|
+
| `project_id` | `str` | Yes | ID of the project |
|
|
2343
|
+
| `body` | `CreateManagementWebhookRequestBody` | Yes | Request body (application/json) |
|
|
2344
|
+
|
|
2345
|
+
|
|
2346
|
+
---
|
|
2347
|
+
|
|
2348
|
+
#### `get_management_webhook`
|
|
2349
|
+
|
|
2350
|
+
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.
|
|
2351
|
+
|
|
2352
|
+
**Example**
|
|
2353
|
+
```python
|
|
2354
|
+
result = client.get_management_webhook(
|
|
2355
|
+
project_id="683d49ed6b4d1cec5a597b13",
|
|
2356
|
+
webhook_id="wh_abc123",
|
|
2357
|
+
)
|
|
2358
|
+
print(result)
|
|
2359
|
+
```
|
|
2360
|
+
**Parameters:**
|
|
2361
|
+
|
|
2362
|
+
| Name | Type | Required | Description |
|
|
2363
|
+
|------|------|----------|-------------|
|
|
2364
|
+
| `project_id` | `str` | Yes | ID of the project |
|
|
2365
|
+
| `webhook_id` | `str` | Yes | ID of the webhook |
|
|
2366
|
+
|
|
2367
|
+
|
|
2368
|
+
---
|
|
2369
|
+
|
|
2370
|
+
#### `update_management_webhook`
|
|
2371
|
+
|
|
2372
|
+
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.
|
|
2373
|
+
|
|
2374
|
+
**Example**
|
|
2375
|
+
```python
|
|
2376
|
+
from liveblocks.models import UpdateManagementWebhookRequestBody
|
|
2377
|
+
|
|
2378
|
+
result = client.update_management_webhook(
|
|
2379
|
+
project_id="683d49ed6b4d1cec5a597b13",
|
|
2380
|
+
webhook_id="wh_abc123",
|
|
2381
|
+
body=UpdateManagementWebhookRequestBody(
|
|
2382
|
+
# url="...",
|
|
2383
|
+
# subscribed_events=[],
|
|
2384
|
+
# rate_limit=0,
|
|
2385
|
+
),
|
|
2386
|
+
)
|
|
2387
|
+
print(result)
|
|
2388
|
+
```
|
|
2389
|
+
**Parameters:**
|
|
2390
|
+
|
|
2391
|
+
| Name | Type | Required | Description |
|
|
2392
|
+
|------|------|----------|-------------|
|
|
2393
|
+
| `project_id` | `str` | Yes | ID of the project |
|
|
2394
|
+
| `webhook_id` | `str` | Yes | ID of the webhook |
|
|
2395
|
+
| `body` | `UpdateManagementWebhookRequestBody` | Yes | Request body (application/json) |
|
|
2396
|
+
|
|
2397
|
+
|
|
2398
|
+
---
|
|
2399
|
+
|
|
2400
|
+
#### `delete_management_webhook`
|
|
2401
|
+
|
|
2402
|
+
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`.
|
|
2403
|
+
|
|
2404
|
+
**Example**
|
|
2405
|
+
```python
|
|
2406
|
+
client.delete_management_webhook(
|
|
2407
|
+
project_id="683d49ed6b4d1cec5a597b13",
|
|
2408
|
+
webhook_id="wh_abc123",
|
|
2409
|
+
)
|
|
2410
|
+
```
|
|
2411
|
+
**Parameters:**
|
|
2412
|
+
|
|
2413
|
+
| Name | Type | Required | Description |
|
|
2414
|
+
|------|------|----------|-------------|
|
|
2415
|
+
| `project_id` | `str` | Yes | ID of the project |
|
|
2416
|
+
| `webhook_id` | `str` | Yes | ID of the webhook |
|
|
2417
|
+
|
|
2418
|
+
|
|
2419
|
+
---
|
|
2420
|
+
|
|
2421
|
+
#### `roll_management_webhook_secret`
|
|
2422
|
+
|
|
2423
|
+
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.
|
|
2424
|
+
|
|
2425
|
+
**Example**
|
|
2426
|
+
```python
|
|
2427
|
+
result = client.roll_management_webhook_secret(
|
|
2428
|
+
project_id="683d49ed6b4d1cec5a597b13",
|
|
2429
|
+
webhook_id="wh_abc123",
|
|
2430
|
+
)
|
|
2431
|
+
print(result)
|
|
2432
|
+
```
|
|
2433
|
+
**Parameters:**
|
|
2434
|
+
|
|
2435
|
+
| Name | Type | Required | Description |
|
|
2436
|
+
|------|------|----------|-------------|
|
|
2437
|
+
| `project_id` | `str` | Yes | ID of the project |
|
|
2438
|
+
| `webhook_id` | `str` | Yes | ID of the webhook |
|
|
2439
|
+
|
|
2440
|
+
|
|
2441
|
+
---
|
|
2442
|
+
|
|
2443
|
+
#### `get_management_webhook_additional_headers`
|
|
2444
|
+
|
|
2445
|
+
Get a webhook's additional headers. Returns `404` if the project or webhook does not exist. Requires `read:all`.
|
|
2446
|
+
|
|
2447
|
+
**Example**
|
|
2448
|
+
```python
|
|
2449
|
+
result = client.get_management_webhook_additional_headers(
|
|
2450
|
+
project_id="683d49ed6b4d1cec5a597b13",
|
|
2451
|
+
webhook_id="wh_abc123",
|
|
2452
|
+
)
|
|
2453
|
+
print(result)
|
|
2454
|
+
```
|
|
2455
|
+
**Parameters:**
|
|
2456
|
+
|
|
2457
|
+
| Name | Type | Required | Description |
|
|
2458
|
+
|------|------|----------|-------------|
|
|
2459
|
+
| `project_id` | `str` | Yes | ID of the project |
|
|
2460
|
+
| `webhook_id` | `str` | Yes | ID of the webhook |
|
|
2461
|
+
|
|
2462
|
+
|
|
2463
|
+
---
|
|
2464
|
+
|
|
2465
|
+
#### `upsert_management_webhook_additional_headers`
|
|
2466
|
+
|
|
2467
|
+
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.
|
|
2468
|
+
|
|
2469
|
+
**Example**
|
|
2470
|
+
```python
|
|
2471
|
+
from liveblocks.models import UpsertManagementWebhookHeadersRequestBody
|
|
2472
|
+
|
|
2473
|
+
result = client.upsert_management_webhook_additional_headers(
|
|
2474
|
+
project_id="683d49ed6b4d1cec5a597b13",
|
|
2475
|
+
webhook_id="wh_abc123",
|
|
2476
|
+
body=UpsertManagementWebhookHeadersRequestBody(
|
|
2477
|
+
headers=...,
|
|
2478
|
+
),
|
|
2479
|
+
)
|
|
2480
|
+
print(result)
|
|
2481
|
+
```
|
|
2482
|
+
**Parameters:**
|
|
2483
|
+
|
|
2484
|
+
| Name | Type | Required | Description |
|
|
2485
|
+
|------|------|----------|-------------|
|
|
2486
|
+
| `project_id` | `str` | Yes | ID of the project |
|
|
2487
|
+
| `webhook_id` | `str` | Yes | ID of the webhook |
|
|
2488
|
+
| `body` | `UpsertManagementWebhookHeadersRequestBody` | Yes | Request body (application/json) |
|
|
2489
|
+
|
|
2490
|
+
|
|
2491
|
+
---
|
|
2492
|
+
|
|
2493
|
+
#### `delete_management_webhook_additional_headers`
|
|
2494
|
+
|
|
2495
|
+
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.
|
|
2496
|
+
|
|
2497
|
+
**Example**
|
|
2498
|
+
```python
|
|
2499
|
+
from liveblocks.models import DeleteManagementWebhookHeadersRequestBody
|
|
2500
|
+
|
|
2501
|
+
result = client.delete_management_webhook_additional_headers(
|
|
2502
|
+
project_id="683d49ed6b4d1cec5a597b13",
|
|
2503
|
+
webhook_id="wh_abc123",
|
|
2504
|
+
body=DeleteManagementWebhookHeadersRequestBody(
|
|
2505
|
+
headers=[],
|
|
2506
|
+
),
|
|
2507
|
+
)
|
|
2508
|
+
print(result)
|
|
2509
|
+
```
|
|
2510
|
+
**Parameters:**
|
|
2511
|
+
|
|
2512
|
+
| Name | Type | Required | Description |
|
|
2513
|
+
|------|------|----------|-------------|
|
|
2514
|
+
| `project_id` | `str` | Yes | ID of the project |
|
|
2515
|
+
| `webhook_id` | `str` | Yes | ID of the webhook |
|
|
2516
|
+
| `body` | `DeleteManagementWebhookHeadersRequestBody` | Yes | Request body (application/json) |
|
|
2517
|
+
|
|
2518
|
+
|
|
2519
|
+
---
|
|
2520
|
+
|
|
2521
|
+
#### `recover_failed_webhook_messages`
|
|
2522
|
+
|
|
2523
|
+
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.
|
|
2524
|
+
|
|
2525
|
+
**Example**
|
|
2526
|
+
```python
|
|
2527
|
+
from liveblocks.models import RecoverManagementWebhookFailedMessagesRequestBody
|
|
2528
|
+
|
|
2529
|
+
client.recover_failed_webhook_messages(
|
|
2530
|
+
project_id="683d49ed6b4d1cec5a597b13",
|
|
2531
|
+
webhook_id="wh_abc123",
|
|
2532
|
+
body=RecoverManagementWebhookFailedMessagesRequestBody(
|
|
2533
|
+
since=...,
|
|
2534
|
+
),
|
|
2535
|
+
)
|
|
2536
|
+
```
|
|
2537
|
+
**Parameters:**
|
|
2538
|
+
|
|
2539
|
+
| Name | Type | Required | Description |
|
|
2540
|
+
|------|------|----------|-------------|
|
|
2541
|
+
| `project_id` | `str` | Yes | ID of the project |
|
|
2542
|
+
| `webhook_id` | `str` | Yes | ID of the webhook |
|
|
2543
|
+
| `body` | `RecoverManagementWebhookFailedMessagesRequestBody` | Yes | Request body (application/json) |
|
|
2544
|
+
|
|
2545
|
+
|
|
2546
|
+
---
|
|
2547
|
+
|
|
2548
|
+
#### `send_test_webhook`
|
|
2549
|
+
|
|
2550
|
+
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.
|
|
2551
|
+
|
|
2552
|
+
**Example**
|
|
2553
|
+
```python
|
|
2554
|
+
from liveblocks.models import TestManagementWebhookRequestBody
|
|
2555
|
+
|
|
2556
|
+
result = client.send_test_webhook(
|
|
2557
|
+
project_id="683d49ed6b4d1cec5a597b13",
|
|
2558
|
+
webhook_id="wh_abc123",
|
|
2559
|
+
body=TestManagementWebhookRequestBody(
|
|
2560
|
+
subscribed_event=...,
|
|
2561
|
+
),
|
|
2562
|
+
)
|
|
2563
|
+
print(result)
|
|
2564
|
+
```
|
|
2565
|
+
**Parameters:**
|
|
2566
|
+
|
|
2567
|
+
| Name | Type | Required | Description |
|
|
2568
|
+
|------|------|----------|-------------|
|
|
2569
|
+
| `project_id` | `str` | Yes | ID of the project |
|
|
2570
|
+
| `webhook_id` | `str` | Yes | ID of the webhook |
|
|
2571
|
+
| `body` | `TestManagementWebhookRequestBody` | Yes | Request body (application/json) |
|
|
2572
|
+
|
|
2573
|
+
|
|
2574
|
+
---
|
|
2575
|
+
|
|
2576
|
+
|
|
2577
|
+
## Error Handling
|
|
2578
|
+
|
|
2579
|
+
All API methods raise `errors.LiveblocksError` when the server returns a non-2xx status code. You can catch and inspect these errors:
|
|
2580
|
+
|
|
2581
|
+
```python
|
|
2582
|
+
from liveblocks import errors, Liveblocks
|
|
2583
|
+
|
|
2584
|
+
client = Liveblocks(secret="sk_your_secret_key")
|
|
2585
|
+
|
|
2586
|
+
with client:
|
|
2587
|
+
try:
|
|
2588
|
+
room = client.get_room(room_id="my-room")
|
|
2589
|
+
except errors.LiveblocksError as e:
|
|
2590
|
+
print(f"API error: {e}")
|
|
2591
|
+
```
|
|
2592
|
+
|
|
2593
|
+
Methods also raise `httpx.TimeoutException` if the request exceeds the timeout.
|