Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
events_documentation: Document all events of type stream and some others.
orientorf266b5246967
diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yamlindex e68f19947f9..cae0d3f91e7 100644--- a/zerver/openapi/zulip.yaml+++ b/zerver/openapi/zulip.yaml@@ -566,6 +566,436 @@ paths:"flags": [],"id": 1,}+ - type: object+ description: |+ Event sent to a user's clients when the user completes the+ OAuth flow for the [Zoom integration](/help/start-a-call). Clients need+ to know whether initiating Zoom OAuth is required before creating a Zoom call.+ properties:+ id:+ type: integer+ type:+ type: string+ enum:+ - has_zoom_token+ value:+ type: boolean+ description: |+ A boolean specifying whether the user has zoom+ token or not.+ additionalProperties: false+ example:+ {+ "type": "has_zoom_token",+ "value": true,+ "id": 0,+ }+ - type: object+ description: |+ A simple event sent to organization administrators when the+ set of invitations changes; this tells clients they need to refetch+ data from `GET /invites` if they are displaying UI containing active+ invitations.+ properties:+ id:+ type: integer+ type:+ type: string+ enum:+ - invites_changed+ additionalProperties: false+ example: {"type": "invites_changed", "id": 0}+ - type: object+ description: |+ Event sent to all users in a Zulip organization when a new+ user joins. Processing this event is important to being able+ to display basic details on other users given only their ID.+ properties:+ id:+ type: integer+ type:+ type: string+ enum:+ - realm_user+ op:+ type: string+ enum:+ - add+ person:+ $ref: "#/components/schemas/User"+ additionalProperties: false+ example:+ {+ "type": "realm_user",+ "op": "add",+ "person":+ {+ "email": "[email protected]",+ "user_id": 38,+ "avatar_version": 1,+ "is_admin": false,+ "is_owner": false,+ "is_guest": false,+ "is_bot": false,+ "full_name": "full name",+ "timezone": "",+ "is_active": true,+ "date_joined": "2020-07-15T15:04:02.030833+00:00",+ "avatar_url": "https:\/\/secure.gravatar.com\/avatar\/c6b5578d4964bd9c5fae593c6868912a?d=identicon&version=1",+ "profile_data": {},+ },+ "id": 0,+ }+ - type: object+ description: |+ Event sent to all users in an organization when a user comes+ back online after being long offline. While most presence updates happen+ done via polling the main presence endpoint, this event is important+ to avoid confusing users when someone comes online and then immediately sends+ a message (one wouldn't want them to still appear offline at that point!).+ properties:+ id:+ type: integer+ type:+ type: string+ enum:+ - presence+ user_id:+ type: integer+ description: |+ The id of modified user.+ email:+ type: string+ description: |+ The email of the user.++ **Deprecated**: This field will be removed in a future+ release as it is redunant with the `user_id`.+ deprecated: true+ server_timestamp:+ type: number+ description: |+ The timestamp of when the Zulip server received the user's+ presence as a UNIX timestamp.+ presence:+ type: object+ description: |+ An object contatining a set of objects which describe the+ the user's presence on various platfroms.+ additionalProperties:+ type: object+ description: |+ `{client_name}`: Object containing the details of the user's+ presence on a particular platform with the client's platform+ name being the object key.+ properties:+ client:+ type: string+ description: |+ The client's platform name.+ status:+ type: string+ enum:+ - idle+ - active+ description: |+ The status of the user on this client. It is either `idle`+ or `active`.+ timestamp:+ type: integer+ description: |+ The UNIX timestamp of when this client sent the user's presence+ to the server with the precision of a second.+ pushable:+ type: boolean+ description: |+ Whether the client is capable of showing mobile/push notifications+ to the user.+ additionalProperties: false+ example:+ {+ "type": "presence",+ "user_id": 10,+ "email": "[email protected]",+ "server_timestamp": 1594825445.320078373,+ "presence":+ {+ "ZulipAndroid\/1.0":+ {+ "client": "ZulipAndroid\/1.0",+ "status": "idle",+ "timestamp": 1594825445,+ "pushable": false,+ },+ },+ "id": 0,+ }+ - type: object+ description: |+ Event sent when a new stream is created to users who can see+ the new stream exists (for private streams, only subscribers and+ organization administrators will receive this event).++ Note that organization administrators who are not subscribed will+ not be able to see content on the stream; just that it exists.+ properties:+ id:+ type: integer+ type:+ type: string+ enum:+ - stream+ op:+ type: string+ enum:+ - add+ streams:+ type: array+ description: |+ Array of stream objects, each containing+ details about the newly added stream(s).+ items:+ $ref: "#/components/schemas/BasicStream"+ additionalProperties: false+ example:+ {+ "type": "stream",+ "op": "create",+ "streams":+ [+ {+ "name": "private",+ "stream_id": 12,+ "description": "",+ "rendered_description": "",+ "invite_only": true,+ "is_web_public": false,+ "stream_post_policy": 1,+ "history_public_to_subscribers": false,+ "first_message_id": null,+ "message_retention_days": null,+ "is_announcement_only": false,+ },+ ],+ "id": 0,+ }+ - type: object+ description: |+ Event sent to all users who can see a stream exists when a stream+ that previously had no subscribers+ gains its first subscriber (typically when a deactivated stream+ is reactivated). It works very similarly to `create` events.++ We expect to change how stream deactivation/reactivation is+ represented in the future.+ properties:+ id:+ type: integer+ type:+ type: string+ enum:+ - stream+ op:+ type: string+ enum:+ - occupy+ streams:+ type: array+ description: |+ Array of stream objects, each contatining+ details about the newly occupied streams.+ items:+ $ref: "#/components/schemas/BasicStream"+ additionalProperties: false+ example:+ {+ "type": "stream",+ "op": "occupy",+ "streams":+ [+ {+ "name": "test_stream",+ "stream_id": 11,+ "description": "",+ "rendered_description": "",+ "invite_only": false,+ "is_web_public": false,+ "stream_post_policy": 1,+ "history_public_to_subscribers": true,+ "first_message_id": null,+ "message_retention_days": null,+ "is_announcement_only": false,+ },+ ],+ "id": 0,+ }+ - type: object+ description: |+ Event sent to all users who can see a stream exists when a stream no+ longer has any users (which deactivates the stream).++ We expect to change how stream deactivation/reactivation is+ represented in the future.+ properties:+ id:+ type: integer+ type:+ type: string+ enum:+ - stream+ op:+ type: string+ enum:+ - vacant+ streams:+ type: array+ description: |+ Array of stream objects, each containing+ details about a now-empty stream.+ items:+ $ref: "#/components/schemas/BasicStream"+ additionalProperties: false+ example:+ {+ "type": "stream",+ "op": "vacate",+ "streams":+ [+ {+ "name": "test_stream",+ "stream_id": 11,+ "description": "",+ "rendered_description": "",+ "invite_only": false,+ "is_web_public": false,+ "stream_post_policy": 1,+ "history_public_to_subscribers": true,+ "first_message_id": null,+ "message_retention_days": null,+ "is_announcement_only": false,+ },+ ],+ "id": 2,+ }+ - type: object+ description: |+ Event sent to all users who can see a stream when it is deactivated.+ properties:+ id:+ type: integer+ type:+ type: string+ enum:+ - stream+ op:+ type: string+ enum:+ - delete+ streams:+ type: array+ description: |+ Array of stream objects, each contatining+ details about a stream that was deleted.+ items:+ $ref: "#/components/schemas/BasicStream"+ additionalProperties: false+ example:+ {+ "type": "stream",+ "op": "delete",+ "streams":+ [+ {+ "name": "private",+ "stream_id": 12,+ "description": "",+ "rendered_description": "",+ "invite_only": true,+ "is_web_public": false,+ "stream_post_policy": 1,+ "history_public_to_subscribers": false,+ "first_message_id": null,+ "message_retention_days": null,+ "is_announcement_only": false,+ },+ ],+ "id": 0,+ }+ - type: object+ description: |+ Event sent to all users who can see that a stream exists+ when a property of that stream changes.+ properties:+ id:+ type: integer+ type:+ type: string+ enum:+ - stream+ op:+ type: string+ enum:+ - update+ stream_id:+ type: integer+ description: |+ The id of the stream whose details have changed.+ name:+ type: string+ description: |+ The name of the stream whose details have changed.+ property:+ type: string+ description: |+ The property of the stream which has changed. See+ [/stream GET](/api/get-streams) for details on the various+ properties of a stream.++ Clients should handle an "unknown" property received here without+ crashing, since that can happen when connecting to a server running a+ newer version of Zulip with new features.+ value:+ description: |+ The new value of the changed property.+ oneOf:+ - type: integer+ - type: boolean+ - type: string+ rendered_description:+ type: string+ description: |+ Note: Only present if the changed property was `description`.++ The short description of the stream rendered as HTML, intended to+ be used when displaying the stream description in a UI.++ One should use the standard Zulip rendered_markdown CSS when+ displaying this content so that emoji, LaTeX, and other syntax+ work correctly. And any client-side security logic for+ user-generated message content should be applied when displaying+ this HTML as though it were the body of a Zulip message.+ history_public_to_subscribers:+ type: boolean+ description: |+ Note: Only present if the changed property was `invite_only`.++ Whether the history of the stream is public to its subscribers.++ Currently always true for public streams (i.e. invite_only=False implies+ history_public_to_subscribers=True), but clients should not make that+ assumption, as we may change that behavior in the future.+ additionalProperties: false+ example:+ {+ "op": "update",+ "type": "stream",+ "property": "invite_only",+ "value": true,+ "history_public_to_subscribers": true,+ "stream_id": 11,+ "name": "test_stream",+ "id": 0,+ }queue_id:type: stringdescription: |@@ -4521,6 +4951,8 @@ components:schemas:BasicStream:type: object+ description: |+ Object containing basic details about the stream.additionalProperties: falseproperties:stream_id: