Users

Users can participate in chats by joining open and group channels. They are identified by a unique ID, and may have a customized nickname and profile image. Using the API, you can manage the various attributes of each user, as well as their actions.

Property name Type Description
user_id string The user’s unique ID.
nickname string The user's nickname.
profile_url string The URL of the user’s profile image.
profile_file file The image file of the user’s profile image.
access_token string The user’s access token, which must be provided upon login.
is_active boolean Whether the user is currently activated.
is_online boolean Whether the user is currently online.
last_seen_at long The user's last online time updated when goes offline, in the Unix milliseconds format. If the user is online, the value is set as 0.
  • API endpoints are relative to the allocated base URL for your app. In this section, the /users endpoint refers to https://{region_identifier}.sendbird.com/v3/users.

Note: If you want region_identifier for your app, sign in to the SendBird Dashboard, select the application, open the Overview, and see the App Credentials > API URL.

  • All requests must be urlencoded (for example, {user_id}, {channel_url}).
Action HTTP request Description
Create a user POST /users Creates a new user.
List users GET /users Returns a list of the users in your app.
Update the user PUT /users/{user_id} Updates the user's information.
View the user GET /users/{user_id} Returns the user's information.
Delete the user DELETE /users/{user_id} Deletes the user.
Get count of unread messages GET /users/{user_id}/unread_message_count Returns the total number of the user’s currently unread messages in the group channels.
Get count of channels with unread messages GET /users/{user_id}/unread_channel_count Returns the total number of the user’s group channels with unread messages.
Block the user POST /users/{user_id}/block Allows the user to block another user.
List blocked users GET /users/{user_id}/block Returns the list of users that the user has blocked.
Unblock the user DELETE /users/{user_id}/block Unblocks the user.
List banned channels GET /users/{user_id}/ban Returns the list of open channels where the user is banned.
List muted channels GET /users/{user_id}/mute Returns the list of open channels where the user is muted.
Mark all messages as read PUT /users/{user_id}/mark_as_read_all Marks all of the user’s unread messages as read across all group channels.
List my group channels GET /users/{user_id}/my_group_channels Returns a list of the user's joined group channels.
Register a device token POST /users/{user_id}/push/{token_type} Registers a device token for the user.
Unregister the device token DELETE /users/{user_id}/push/{token_type}/{push_token} or
DELETE /users/{user_id}/push
Unregisters device token(s) for the user.
List device tokens GET /users/{user_id}/push/{token_type} Lists device tokens for the user.
Update push preferences PUT /users/{user_id}/push_preference Updates the user's push preferences.
Get push preferences GET /users/{user_id}/push_preference Returns the user's push preferences.
Reset push preferences DELETE /users/{user_id}/push_preference Resets the user's push preferences.
Update channel push preferences PUT /users/{user_id}/push_preference/{channel_url} Updates the user's push preferences for the channel.
Get channel push preferences GET /users/{user_id}/push_preference/{channel_url} Returns the user's push preferences for a channel.

Create a user

Creates a new user in the application. Users are identified by a unique ID, and additionally have a changeable nickname and profile image (either as a URL or a file). You can choose to authorize a user with just their user ID, or additionally issue an Access Token. If an Access Token is issued for a user, it must be provided upon every sign-in.

POST https://{region_identifier}.sendbird.com/v3/users
Property name Type Description
user_id string A unique user ID used for signing in to SendBird. The length is limited to 80 bytes.
nickname string The user’s nickname. The length is limited to 80 bytes.
profile_url string The URL of the user’s profile image. You can pass a blank string if the user does not need a profile image. The length is limited to 2,048 bytes.
profile_file file The file of the user's profile image.
issue_access_token (optional) boolean Whether to create an access token for the user. If true, a string token is provided upon creation, and you must pass this value whenever you sign the user in. If false, you do not need to provide a token. (Default: false)

Note: If you want to upload a profile picture by passing an image file instead of a URL, reference the Multipart requests section.

Request body example
{
    "user_id": "john123",
    "nickname": "Johnny",
    "profile_url": "https://sendbird.com/main/img/profiles/profile_05_512px.png",
    "issue_access_token": true
}

Returns a User representation.

Status: 200 OK
{
    "user_id": "john123",
    "nickname": "Johnny",
    "profile_url": "https://sendbird.com/main/img/profiles/profile_05_512px.png",
    "access_token": "07a0ccf6d3e801223e65b06b6066352e0512b43c",
    "is_online": false,
    "last_seen_at": 0
}

List users

Returns a list of the users in your app. You can query the list based on various parameters.

GET https://{region_identifier}.sendbird.com/v3/users
Parameter name Type Description
token string A token that specifies the index of the first result. If not specified, the index is set as 0.
limit int The number of results returned per page. Acceptable values are 1 to 100, inclusive. (Default: 10)
active_mode string The activation status of the users in the list. Acceptable values are activated, deactivated, and all. If set to activated, users as is_active=true are returned. If set to deactivated, users as is_active=false returned. (Default: activated)
show_bot boolean Whether to include bots in the list. (Default: true)
user_ids string Searches for a specific user using user IDs. The string passed here must be urlencoded, with multiple IDs separated by commas. (for example, url_encoded_id_1, url_encoded_id_2)
Request example
?token=YXYWRFBTQlArEUBXWFNeF2p2FEFdUA~~&limit=3&show_bot=false
Status: 200 OK
{
    "users": [
        {
            "user_id": "john123",
            "is_active": true,
            "is_online": false,
            "last_seen_at": 1483600233677,
            "nickname": "Johnny",
            "profile_url": "https://sendbird.com/main/img/profiles/profile_05_512px.png"
        },
        {
            "user_id": "panda",
            "is_active": true,
            "is_online": false,
            "last_seen_at": 1483600235022,
            "nickname": "Kung Foo",
            "profile_url": "https://sendbird.com/main/img/profiles/profile_06_512px.png"
        },
        {
            "user_id": "bunny",
            "is_active": true,
            "is_online": true,
            "last_seen_at": 0,
            "nickname": "Bugs",
            "profile_url": "https://sendbird.com/main/img/profiles/profile_07_512px.png"
        }
    ],
    "next": "YXEZR1VVQVErEUBXWFNeF2p3FkFVVA~~"
}
Property name Type Description
users[] list A list of Users.
next string The token for the next chunk of results.

Update the user

Updates the user's information. In addition to changing a user's nickname or profile image, here you can issue a new access token for the user. The new access token replaces the previous one as the necessary token for authentication. You can also deactivate or reactivate a user. Deactivated users leaves all joined group channels if leave_all_when_deactivated is true (which it is by default).

PUT https://{region_identifier}.sendbird.com/v3/users/{user_id}
Property Name Type Description
nickname (optional) string The user’s nickname. The length is limited to 80 bytes.
profile_url (optional) string The URL of the user’s profile image. The length is limited to 2,048 bytes.
profile_file (optional) file The file of the user's profile image.
issue_access_token (optional) boolean Whether to create a new access token for the user. If true, a string token is provided upon creation, and you must pass this value whenever you sign the user in. If false, you do not need to provide a token.
is_active (optional) boolean The activation status of the user.
leave_all_when_deactivated (optional) boolean Whether the user leaves all joined group channels upon deactivation. Note that this value is true by default. Use in conjunction with the is_active field.

Note: If you want to upload a profile picture by passing an image file, reference the Multipart requests section.

Request body example
{
    "nickname": "Johnster",
    "profile_url":"https://sendbird.com/main/img/profiles/profile_02_512px.png",
    "issue_access_token": true
}

Returns a User representation.

Status: 200 OK
{
    "user_id": "john123",
    "nickname": "Johnster",
    "profile_url": "https://sendbird.com/main/img/profiles/profile_02_512px.png",
    "access_token": "811284474d5d94f3e1658c6c0794822bda4f5f72",
    "is_active": true,
    "is_online": false,
    "last_seen_at": 1483600233677
}

View the user

Returns the user’s information.

GET https://{region_identifier}.sendbird.com/v3/users/{user_id}

Returns a User representation.

Status: 200 OK
{
    "user_id": "john123",
    "nickname": "Johnster",
    "profile_url": "https://sendbird.com/main/img/profiles/profile_02_512px.png",
    "access_token": "811284474d5d94f3e1658c6c0794822bda4f5f72",
    "is_active": true,
    "is_online": false,
    "last_seen_at": 1483600233677
}

Delete the user

Deletes the user.

DELETE https://{region_identifier}.sendbird.com/v3/users/{user_id}
Status: 200 OK
{}

Get count of unread messages

Returns the total number of a user’s currently unread messages in the group channels. The unread counts feature is only available for the group channels.

GET https://{region_identifier}.sendbird.com/v3/users/{user_id}/unread_message_count
Property name Type Description
custom_types (optional) list A list of custom types to filter group channels.
Request body example
{
    "custom_types": ["lobby", "door"]
}
Status: 200 OK
{
    "unread_count": 4
}
Property name Type Description
unread_count long The total number of a user's unread messages.

Get count of channels with unread messages

Returns the total number of the user’s group channels with unread messages.

GET https://{region_identifier}.sendbird.com/v3/users/{user_id}/unread_channel_count
Property name Type Description
custom_types (optional) list A list of custom types to filter group channels.
Request body example
{
    "custom_types": ["art", "sports"]
}
Status: 200 OK
{
    "unread_count": 4
}
Property name Type Description
unread_count long The total number of a user's group channels with unread messages.

Block the user

Allows the user to block another user. A user can't receive any messages from someone they have blocked. Also, blocking someone doesn't alert them that they have been blocked. Blocked users still can send messages as normal in the channel; however, they can't receive any messages from the users who have blocked them.

POST https://{region_identifier}.sendbird.com/v3/users/{user_id}/block
Property name Type Description
target_id string The user ID of the user to be blocked.
Request body example
{
    "target_id": "panda"
}

Returns the blocked User.

Status: 200 OK
{
    "user_id": "panda",
    "is_online": false,
    "last_seen_at": 1483604082551
    "nickname": "Kung Foo",
    "profile_url": "https://sendbird.com/main/img/profiles/profile_05_512px.png",
    "metadata": {}
}

List blocked users

Returns the list of users that the user has blocked.

GET https://{region_identifier}.sendbird.com/v3/users/{user_id}/block
Parameter name Type Description
token string A token that specifies the index of the first result. If not specified, the index is set as 0.
limit int The number of results returned per page. Acceptable values are 1 to 100, inclusive. (Default: 10)
Request example
?token=YXEZR1VVQVErEUBXWFNeF2p3FkFVVA~~&limit=2
Status: 200 OK
{
    "users": [
        {
            "user_id": "terry5",
            "is_online": false,
            "last_seen_at": 1483687158585,
            "nickname": "Terry",
            "profile_url": "https://sendbird.com/main/img/profiles/profile_26_512px.png",
            "metadata": {}
        },
        {
            "user_id": "panda",
            "is_online": true,
            "last_seen_at": 0,
            "nickname": "Kung Foo",
            "profile_url": "https://sendbird.com/main/img/profiles/profile_05_512px.png",
            "metadata": {}
        }
    ],
    "next": ""
}
Property name Type Description
users[] list A list of Users.
next string The token for the next page of results.

Unblock the user

Unblocks the user.

DELETE https://{region_identifier}.sendbird.com/v3/users/{user_id}/block/{target_id}
Status: 200 OK
{}

List banned channels

Returns the list of open channels where the user is banned. This feature is only available in open channels.

GET https://{region_identifier}.sendbird.com/v3/users/{user_id}/ban
Parameter name Type Description
token string A token that specifies the index of the first result. If not specified, the index is set as 0.
limit int The number of results returned per page. Acceptable values are 1 to 100, inclusive. (Default: 10)
Status: 200 OK
{
    "banned_channels": [
        {
            "start_at": 1483688660939,
            "end_at": 1483688720939,
            "description": "rude behavior",
            "channel": {
                "name": "Lobby",
                "custom_type": "",
                "channel_url": "sendbird_open_channel_11694_f94eba708909d33c34cb37b043838ecce07afc04",
                "created_at": 1483606460,
                "cover_url": "",
                "data": ""
            }
        },
        {
            "start_at": 1483688620389,
            "end_at": 1483688680389,
            "description": "spam",
            "channel": {
                "name": "Politics chat",
                "custom_type": "",
                "channel_url": "sendbird_open_channel_11694_61f545ddc85549592737afafe4bc2ec0d7ba92a0",
                "created_at": 1483688557,
                "cover_url": "",
                "data": ""
            }
        }
    ],
    "next": ""
}
Property name Type Description
banned_channels[] list The list of channels where the user is banned, also containing information about the ban.
banned_channels[].start_at long The timestamp of when the ban began, in Unix milliseconds.
banned_channels[].end_at long The timestamp of when the ban is scheduled to end, in Unix milliseconds.
banned_channels[].description string A description that was appended when the ban was instituted.
banned_channels[].channel nested object An open channel representation.
next string The token for the next page of results.

List muted channels

Returns the list of open channels where the user is muted. The mute feature is only available in open channels.

GET https://{region_identifier}.sendbird.com/v3/users/{user_id}/mute
Parameter name Type Description
token string A token that specifies the index of the first result. If not specified, the index is set as 0.
limit int The number of results returned per page. Acceptable values are 1 to 100, inclusive. (Default: 10)
Status: 200 OK
{
    "muted_channels": [
        {
            "name": "Politics chat",
            "custom_type": "",
            "channel_url": "sendbird_open_channel_11694_61f545ddc85549592737afafe4bc2ec0d7ba92a0",
            "created_at": 1483688557,
            "cover_url": "https://sendbird.com/main/img/cover/cover_05.jpg",
            "data": ""
        },
        {
            "name": "Lobby",
            "custom_type": "",
            "channel_url": "sendbird_open_channel_11694_f94eba708909d33c34cb37b043838ecce07afc04",
            "created_at": 1483606460,
            "cover_url": "https://sendbird.com/main/img/cover/cover_06.jpg",
            "data": ""
        }
    ],
    "next": ""
}
Property name Type Description
muted_channels[] list The list of open channels where the user is muted.
next string The token for the next page of results.

Mark all messages as read

Marks all of the user’s unread messages as read across all group channels.

PUT https://{region_identifier}.sendbird.com/v3/users/{user_id}/mark_as_read_all
Status: 200 OK
{}

List my group channels

Returns all group channels that the user has joined. You can create a request based on various query parameters.

GET https://{region_identifier}.sendbird.com/v3/users/{user_id}/my_group_channels
Parameter name Type Description
token string A token that specifies the index of the first result. If not specified, the index is set as 0.
limit int The number of results returned per page. Acceptable values are 1 to 100, inclusive. (Default: 10)
show_empty boolean Whether to show empty channels. Empty channels are channels that have been created but contain no sent messages. (Default: false)
show_member boolean Whether to include member information in the response body. (Default: false)
show_read_receipt boolean Whether to include read_receipt information in the response body. (Default: false)
distinct_mode string Acceptable values are distinct, nondistinct, and all. If set to distinct, only Distinct group channels are returned. If set to nondistinct, only the group channels that are not Distinct are returned. If set to all, all group channels are returned. (Default: all)
order string Acceptable values are chronological and latest_last_message. If set to chronological, the channels sorted by the creation time in descending order are returned. If set to latest_last_message, the channels sorted by the time of their last message in descending order are returned. (Default: chronological)
members_exactly_in string Search for channels with exactly the specified members. The string passed here must be urlencoded, with multiple IDs separated by commas. (for example, url_encoded_id_1, url_encoded_id_2)
members_nickname_contains string Search for channels with members with the specified nicknames. The string passed here must be urlencoded, with multiple nicknames separated by commas. (for example, url_encoded_nickname_1, url_encoded_nickname_2)
members_include_in string Search for channels that include the specified members. The string passed here must be urlencoded, with multiple IDs separated by commas. (for example, url_encoded_id_1, url_encoded_id_2)
query_type string A logical condition applied to the members_include_in filter. Acceptable values are either AND or OR. For example, take the case that you specify three members in members_include_in: A, B, and C. AND returns all channels that include all of {A. B, C} as a subset. OR returns channels that include {A}, plus those that include {B}. plus those that include {C}. (Default: AND)
custom_types string Search for channels with the specified custom types. The string passed here must be urlencoded, with multiple custom types separated by commas. (for example, url_endcoded_custom_type_1, url_encoded_custom_type_2). If this field is not specified, all channels are returned, regardless of their custom type.
channel_urls string Search for channels with the specified URLs. The string passed here must be urlencoded, with multiple URLs separated by commas. (for example, url_encoded_channel_1, url_encoded_channel_2)
created_after long The starting timestamp of the query, in Unix seconds format.
created_before long The ending timestamp of the query, in Unix seconds format.
custom_type string (Deprecated) Search for channels with the specified custom_type. If this field is not specified, all channels are returned, regardless of their custom type. The string passed here must be urlencoded.
Request sample
?limit=2&order=latest_last_message&members_include_in=kev%40email.com&query_type=AND
Status: 200 OK
{
    "channels": [
        {
            "unread_message_count": 1,
            "is_distinct": true,
            "custom_type": "personal",
            "last_message": {
                "created_at": 1484269498708,
                "user": {
                    "nickname": "Kevin",
                    "user_id": "kev@email.com",
                    "profile_url": "https://sendbird.com/main/img/profiles/profile_17_512px.png
                },
                "custom_type": "",
                "data": "",
                "message": "Can you show me your portfolio?",
                "channel_url": "sendbird_group_channel_24901438_c1bc35f5f0d237207bc1cba27351c878fc2f345b",
                "type": "MESG",
                "message_id": 640904364
            },
            "cover_url": "https://sendbird.com/main/img/cover/cover_08.jpg",
            "data": "{u'background_color': u'blue', u'description': u'Design Project for class'}",
            "is_push_enabled": true,
            "name": "Design Project",
            "member_count": 2,
            "created_at": 1484182653,
            "max_length_message": -1,
            "channel_url": "sendbird_group_channel_24901438_c1bc35f5f0d237207bc1cba27351c878fc2f345b",
            "channel": {
                ... // This key has been deprecated and only exists for backward compatibility.
            }
        },
        {
            "unread_message_count": 1,
            "is_distinct": false,
            "custom_type": "work",
            "last_message": {
                "created_at": 1484269471051,
                "user": {
                    "nickname": "Kevin",
                    "user_id": "kev@email.com",
                    "profile_url": "https://sendbird.com/main/img/profiles/profile_17_512px.png"
                },
                "custom_type": "",
                "data": "",
                "message": "Send me an email too.",
                "channel_url": "sendbird_group_channel_24901438_fae48810789d0c2de1159a6b0972897848a3e58b",
                "type": "MESG",
                "message_id": 640904098
            },
            "cover_url": "https://sendbird.com/main/img/cover/cover_05.jpg",
            "data": "",
            "is_push_enabled": true,
            "name": "Marketing Team",
            "member_count": 2,
            "created_at": 1484181495,
            "max_length_message": -1,
            "channel_url": "sendbird_group_channel_24901438_fae48810789d0c2de1159a6b0972897848a3e58b",
            "channel": {
                ... // This key has been deprecated and only exists for backward compatibility.
            }
        }
    ],
    "next": "ansYQFFRQ1AIEUBXX1RcE2d0FUZSUlkJFVQRHB86AkAgNn8eABABBBNFX11fUlsWYnMS"
}
Property name Type Description
channels[] list A list of group channel representations.
next string The token for the next page of results.

Register a device token

Registers a device token for push services for the specified user. You can pass one of two values in token_type: gcm, or apns, depending on which push service you are using. A device token allows identification of a device-app combination, and are typically generated and registered by Android and iOS apps through the corresponding SDKs. Use this method if you need to register a token via your own server.

Note: For more information on device token, visit the Google's FCM page and Apple's APNs page.

  • If gcm is the token type, make your request with a gcm_reg_token.

  • If apns is the token type, make your request with a apns_reg_token.

POST https://{region_identifier}.sendbird.com/v3/users/{user_id}/push/{token_type}
Property name Type Description
gcm_reg_token string A device token for Firebase Cloud Messaging (formerly Google Cloud Messaging).
apns_device_token string A device token for Apple Push Notification Service.
Request body example
{
    "gcm_reg_token": "fP7c4oBk_hU:APA91bEzrb3ks301HRvtXxZEdubB_sEhpPFAb0i3cycvd3E9UvFO7ia2uwu2ms7gR-Ra8AmaRNluCT_0frTWBv45jzPvEwEPeNKaNc0iiHnokHAHo0RTzcXcWvrLXmO1Awft_2k7tfi2"
}
Status: 200 OK
{
    "token": ["fP7c4oBk_hU:APA91bEzrb3ks301HRvtXxZEdubB_sEhpPFAb0i3cycvd3E9UvFO7ia2uwu2ms7gR-Ra8AmaRNluCT_0frTWBv45jzPvEwEPeNKaNc0iiHnokHAHo0RTzcXcWvrLXmO1Awft_2k7tfi2"],
    "type": "GCM",
    "user": {
        "nickname": "Kung Foo",
        "user_id": "panda",
        "profile_url": "https://sendbird.com/main/img/profiles/profile_05_512px.png"
    }
}
Property name Type Description
token string A token for GCM / APNs.
type string One of GCM or APNS.
user nested object A User representation.

Unregister the device token

Unregisters the user's device token(s) for push services.

// When unregistering a specific token
DELETE https://{region_identifier}.sendbird.com/v3/users/{user_id}/push/{token_type}/{push_token}   

// When unregistering all device tokens
DELETE https://{region_identifier}.sendbird.com/v3/users/{user_id}/push

Returns a User representation.

Status: 200 OK
// When unregistering a specific token
{
    "token": ["fP7c4oBk_hU:APA91bEzrb3ks301HRvtXxZEdubB_sEhpPFAb0i3cycvd3E9UvFO7ia2uwu2ms7gR-Ra8AmaRNluCT_0frTWBv45jzPvEwEPeNKaNc0iiHnokHAHo0RTzcXcWvrLXmO1Awft_2k7tfi2"],
    "user": {
        "nickname": "Kung Foo",
        "user_id": "panda",
        "profile_url": "https://sendbird.com/main/img/profiles/profile_05_512px.png"
    }
}

// When unregistering all device tokens
{
    "user": {
        "nickname": "Kung Foo",
        "user_id": "panda",
        "profile_url": "https://sendbird.com/main/img/profiles/profile_05_512px.png"
    }
}
Property name Type Description
token string The device token that was removed.
user nested object A User representation.

List device tokens

List device tokens for push services for the specified user. You can pass one of two values in token_type: gcm, or apns, depending on which push service you are using.

GET https://{region_identifier}.sendbird.com/v3/users/{user_id}/push/{token_type}
Status: 200 OK
{
    "tokens": ["fP7c4oBk_hU:APA91bEzrb3ks301HRvtXxZEdubB_sEhpPFAb0i3cycvd3E9UvFO7ia2uwu2ms7gR-Ra8AmaRNluCT_0frTWBv45jzPvEwEPeNKaNc0iiHnokHAHo0RTzcXcWvrLXmO1Awft_2k7tfi2"],
    "type": "GCM",
    "user": {
        "nickname": "Kung Foo",
        "user_id": "panda",
        "profile_url": "https://sendbird.com/main/img/profiles/profile_05_512px.png"
    }
}
Property name Type Description
tokens[] list A list of tokens for GCM / APNs.
type string One of GCM or APNS.
user nested object A User representation.

Update push preferences

Updates the user's push preferences. Through this action, you can set do_not_disturb for a user, and update the time frame in which the setting applies.

PUT https://{region_identifier}.sendbird.com/v3/users/{user_id}/push_preference
Property name Type Description
do_not_disturb (optional) boolean Whether to pause push notifications for the user.
start_hour (optional) int The hour to start pausing notifications.
start_min (optional) int The minute of the hour to start pausing notifications.
end_hour (optional) int The hour to stop pausing notifications.
end_min (optional) int The minute of the hour to stop pausing notifications.
timezone (optional) string Input a value such as UTC, Asia/Seoul, Europe/London, etc.
Request body example
{
    "do_not_disturb": true,
    "start_hour": 17,
    "start_min": 30,
    "end_hour": 22,
    "end_min": 00
}
Status: 200 OK
{
    "do_not_disturb": true,
    "start_hour": 17,
    "start_min": 30,
    "end_hour": 22,
    "end_min": 0,
    "timezone": "UTC"
}
Property name Type Description
do_not_disturb boolean Whether push notifications are paused for the user.
start_hour int The hour to start pausing notifications.
start_min int The minute of the hour to start pausing notifications.
end_hour int The hour to stop pausing notifications.
end_min int The minute of the hour to stop pausing notifications.
timezone string The timezone in which these settings are carried out.

Get push preferences

Returns the user’s push preferences. Specifically, this returns whether the user has set do_not_disturb to pause notifications for a certain period of time, and the time frame in which the user has applied the setting.

GET https://{region_identifier}.sendbird.com/v3/users/{user_id}/push_preference
Status: 200 OK
{
    "do_not_disturb": true,
    "start_hour": 17,
    "start_min": 30,
    "end_hour": 22,
    "end_min": 0,
    "timezone": "UTC"
}
Property name Type Description
do_not_disturb boolean Whether push notifications are paused for the user.
start_hour int The hour to start pausing notifications.
start_min int The minute of the hour to start pausing notifications.
end_hour int The hour to stop pausing notifications.
end_min int The minute of the hour to stop pausing notifications.
timezone string UTC, Asia/Seoul, Europe/London, etc. (Default: UTC)

Reset push preferences

Resets the user's push preferences. After performing the action,

  • do_not_disturb is set to false.
  • time values is set to 0.
  • timezone is reset to UTC.
DELETE https://{region_identifier}.sendbird.com/v3/users/{user_id}/push_preference
{}

Update channel push preferences

Updates the user's push preferences for a specific channel. The push notifications feature is only available for group channels.

PUT https://{region_identifier}.sendbird.com/v3/users/{user_id}/push_preference/{channel_url}
Property name Type Description
enable boolean If set to false, push notifications for the user are not sent to the specified channel.
Request example
{
    "enable": false 
}
Status: 200 OK
{
    "enable": false 
}
Property name Type Description
enable boolean Whether push notifications are enabled for the user.

Get channel push preferences

Returns whether the user has turned on push notifications for the specified channel. The push notifications feature is only available for group channels.

GET https://{region_identifier}.sendbird.com/v3/users/{user_id}/push_preference/{channel_url}
Status: 200 OK
{
    "enable": true
}
Property name Type Description
enable boolean Whether push notifications are enabled for the user's channel.