POST /users/me/subscriptions
Subscribe one or more users to one or more channels.
If any of the specified channels do not exist, they are automatically
created. The initial channel settings will be determined
by the optional parameters, like invite_only, detailed below.
Note that the ability to subscribe oneself and/or other users to a specified channel depends on the channel's permissions settings.
Changes: Before Zulip 10.0 (feature level 362), subscriptions in archived channels could not be modified.
Before Zulip 10.0 (feature level 357), the
can_subscribe_group permission, which allows members of the
group to subscribe themselves to the channel, did not exist.
Before Zulip 10.0 (feature level 349), a user cannot subscribe
other users to a private channel without being subscribed
to that channel themselves. Now, If a user is part of
can_add_subscribers_group, they can subscribe themselves or other
users to a private channel without being subscribed to that channel.
Removed stream_post_policy and is_announcement_only
parameters in Zulip 10.0 (feature level 333), as permission to post
in the channel is now controlled by can_send_message_group.
Before Zulip 8.0 (feature level 208), if a user specified by the
principals parameter was a deactivated user,
or did not exist, then an HTTP status code of 403 was returned with
code: "UNAUTHORIZED_PRINCIPAL" in the error response. As of this
feature level, an HTTP status code of 400 is returned with
code: "BAD_REQUEST" in the error response for these cases.
Servers
- https://{subdomain}.zulipchat.com/api/v1
- {server}/api/v1
- https://chat.zulip.org/api/v1
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/x-www-form-urlencoded" |
Request body fields
| Name | Type | Required | Description |
|---|---|---|---|
send_new_subscription_messages |
Boolean | No |
Whether any other users newly subscribed via this request should be sent a direct message, from Notification Bot, notifying them about their new subscription. No direct messages are sent for any channels that are created as part of this request, regardless of the value of this parameter. The server will never send direct messages when the total number of users
who were subscribed to channels in this request was more than the value
of Changes: Before Zulip 11.0 (feature level 397), new subscribers were always sent a Notification Bot direct message, which was unduly expensive when bulk-subscribing thousands of users to a channel. Default value: true |
can_remove_subscribers_group |
No |
A group-setting value defining the set of users who have permission to remove subscribers from this channel. Organization administrators can unsubscribe others from a channel as though they were in this group without being explicitly listed here. Note that a user must have metadata access to a channel and permission to administer the channel in order to modify this setting. Changes: Prior to Zulip 10.0 (feature level 349), channel administrators
could not unsubscribe other users if they were not an organization
administrator or part of Prior to Zulip 10.0 (feature level 320), this value was always the integer ID of a system group. Before Zulip 8.0 (feature level 197), the New in Zulip 6.0 (feature level 142). |
|
can_delete_own_message_group |
No |
A group-setting value defining the set of users who have permission to delete the messages that they have sent in the channel. Note that a user must have content access to a channel in order to delete their own message in the channel. Users with permission to delete any message in the channel
and users present in the organization-level Changes: New in Zulip 11.0 (feature level 407). Prior to this
change, only the users in the organization-level |
|
can_resolve_topics_group |
No |
A group-setting value defining the set of users who have permission to resolve topics in the channel. Users who have similar realm-level permissions can resolve topics in a channel regardless of the value of this setting. Changes: New in Zulip 11.0 (feature level 402). |
|
is_default_stream |
Boolean | No |
This parameter determines whether any newly created channels will be added as default channels for new users joining the organization. Changes: New in Zulip 8.0 (feature level 200). Previously, default channel status could only be changed using the dedicated API endpoint. Default value: false |
can_create_topic_group |
No |
A group-setting value defining the set of users who have permission to create a new topic in this channel. Note that using this permission requires also having permission to send messages in the channel. Note that this must be the Changes: New in Zulip 12.0 (feature level 441). Previously, if you could send messages in a channel, you could create topics in the channel. |
|
message_retention_days |
No |
Number of days that messages sent to this channel will be stored before being automatically deleted by the message retention policy. Two special string format values are supported:
Changes: Prior to Zulip 5.0 (feature level 91), retaining
messages forever was encoded using New in Zulip 3.0 (feature level 17). |
|
invite_only |
Boolean | No |
As described above, this endpoint will create a new channel if passed a channel name that doesn't already exist. This parameters and the ones that follow are used to request an initial configuration of a created channel; they are ignored for channels that already exist. This parameter determines whether any newly created channels will be private channels. Default value: false |
topics_policy |
String | No |
Whether named topics and the empty topic (i.e., "general chat" topic) are enabled in this channel.
The When creating a new channel, if the Changes: In Zulip 11.0 (feature level 404), the New in Zulip 11.0 (feature level 392). Valid values:
|
folder_id |
Integer | No |
This parameter adds the newly created channel to the specified channel folder. Changes: New in Zulip 11.0 (feature level 389). |
is_web_public |
Boolean | No |
This parameter determines whether any newly created channels will be web-public channels. Note that creating web-public channels requires the
Changes: New in Zulip 5.0 (feature level 98). Default value: false |
principals |
No |
A list of user IDs (preferred) or Zulip API email
addresses of the users to be subscribed to or unsubscribed
from the channels specified in the If not provided, then the requesting user/bot will be subscribed/unsubscribed from the specified channels. Changes: Before Zulip 3.0 (feature level 9), only the Zulip API email address string format was supported. |
|
authorization_errors_fatal |
Boolean | No |
A boolean specifying whether authorization errors (such as when the
requesting user is not authorized to access a private channel) should be
considered fatal or not. When Default value: true |
can_administer_channel_group |
No |
A group-setting value defining the set of users who have permission to administer this channel. Organization administrators can administer every channel as though they were in this group without being explicitly listed here. Note that a user must have metadata access to a channel and permission to administer the channel in order to modify this setting. Changes: Prior to Zulip 10.0 (feature level 349) a user needed to have content access to a channel in order to modify it. The exception to this rule was that organization administrators can edit channel names and descriptions without having full access to the channel. New in Zulip 10.0 (feature level 325). Prior to this change, the permission to administer channels was limited to realm administrators. |
|
can_send_message_group |
No |
A group-setting value defining the set of users who have permission to post in this channel. Note that a user must have metadata access to a channel and permission to administer the channel in order to modify this setting. Note that using this permission to send a message to a new topic requires also having permission to create new topics in the channel. Changes: New in Zulip 10.0 (feature level 333). Previously
|
|
announce |
Boolean | No |
If one of the channels specified did not exist previously and is thus created by this call, this determines whether notification bot will send an announcement about the new channel's creation. Default value: false |
can_subscribe_group |
No |
A group-setting value defining the set of users who have permission to subscribe themselves to this channel. Everyone, excluding guests, can subscribe to any public channel irrespective of this setting. Users in this group can subscribe to a private channel as well. Note that a user must have content access to a channel and permission to administer the channel in order to modify this setting. Changes: New in Zulip 10.0 (feature level 357). |
|
can_delete_any_message_group |
No |
A group-setting value defining the set of users who have permission to delete any message in the channel. Note that a user must have content access to a channel in order to delete any message in the channel. Users present in the organization-level Changes: New in Zulip 11.0 (feature level 407). Prior to this
change, only the users in |
|
history_public_to_subscribers |
Boolean | No |
Whether the channel's message history should be available to newly subscribed members, or users can only access messages they actually received while subscribed to the channel. Corresponds to the shared history option for private channels. |
can_move_messages_out_of_channel_group |
No |
A group-setting value defining the set of users who have permission to move messages out of this channel. Note that a user must have content access to a channel in order to move messages out of the channel. Channel administrators and users present in the organization-level
Changes: New in Zulip 11.0 (feature level 396). Prior to this
change, only the users in |
|
can_move_messages_within_channel_group |
No |
A group-setting value defining the set of users who have permission to move messages within this channel. Note that a user must have content access to a channel in order to move messages within the channel. Channel administrators and users present in the organization-level
Changes: New in Zulip 11.0 (feature level 396). Prior to this
change, only the users in |
|
can_add_subscribers_group |
No |
A group-setting value defining the set of users who have permission to add subscribers to this channel. Users who can administer the channel or have similar realm-level permissions can add subscribers to a public channel regardless of the value of this setting. Users in this group need not be subscribed to a private channel to add subscribers to it. Note that a user must have content access to a channel and permission to administer the channel in order to modify this setting. Changes: New in Zulip 10.0 (feature level 342). Previously, there was no channel-level setting for this permission. |
|
subscriptions[] |
Array | Yes |
A list of dictionaries containing the key |
subscriptions[].name |
String | Yes |
The name of the channel. Clients should use the |
subscriptions[].description |
String | No |
The description to use for a new channel being created, in text/markdown format. See the help center article on message formatting for details on Zulip-flavored Markdown. Clients should use the |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.