/ Platform API
Platform API
    Chat Platform API v3
    Chat Platform API
    Chat Platform API
    Version 3

    Remove a registration or device token

    Copy link

    Removes a user's specific registration or device token or all tokens. You can pass gcm, huawei, or apns for FCM registration token, HMS device token, or APNs device token, respectively, in the token_type parameter for the push notification service you are using.


    HTTP request

    Copy link
    // When unregistering a specific token
    DELETE https://api-{application_id}.sendbird.com/v3/users/{user_id}/push/{token_type}/{token}
    
    // When unregistering all device tokens
    DELETE https://api-{application_id}.sendbird.com/v3/users/{user_id}/push
    

    Parameters

    Copy link

    The following table lists the parameters that this action supports.

    Required
    Parameter nameTypeDescription

    user_id

    string

    Specifies the unique ID of a user.

    token_type

    string

    Specifies the type of a token. Acceptable values are gcm, huawei, and apns for FCM, HMS, and APNS respectively.

    token

    string

    Specifies the registration or device token of a user.


    Response

    Copy link

    If successful, this action returns the removed token and a user resource in the response body.

    // When removing a specific token
    {
        "token": ["fP7c4oBk_hU:APA91bEzrb3ks301HRvtXxZEdubB_sEhpPFAb0i3cycvd3E9UvFO7ia2uwu2ms7gR-Ra8AmaRNluCT_0frTWBv45jzPvEwEPeNKaNc0iiHnokHAHo0RTzcXcWvrLXmO1Awft_2k7tfi2"],
        "user": {
            "user_id": "Chris",
            "nickname": "Christopher",
            "profile_url": "https://sendbird.com/main/img/profiles/profile_46_512px.png",
            "metadata": {
                "font_preference": "times new roman",
                "font_color": "black"
            }
        }
    }
    
    // When removing all device tokens
    {
        "user": {
            "user_id": "Chris",
            "nickname": "Christopher",
            "profile_url": "https://sendbird.com/main/img/profiles/profile_46_512px.png",
            "metadata": {
                "font_preference": "times new roman",
                "font_color": "black"
            }
        }
    }
    

    List of response properties

    Copy link
    Property nameTypeDescription

    token

    string

    The registration or device token of the user.

    user

    nested object

    The user resource which encapsulates information about the specified user.

    In the case of an error, an error object is returned. A detailed list of error codes is available here.