Register a logged-in device

POST https://z.u1v.ru/api/v1/register_client_device

Logged-in clients use this endpoint as an initial step to register themselves before registering for E2EE push notifications. Calling it with an existing device_id refreshes the record and returns the same ID.

Clients should send only low-entropy labels useful to the account owner; hardware identifiers, host names, and user-assigned device names should not be sent.

Changes: New in Zulip 12.0 (feature level 468).

Support for browser/desktop devices, idempotent refresh, and user-visible metadata is new in feature level 501.

Usage examples

#!/usr/bin/env python3

import zulip

# Pass the path to your zuliprc file here.
client = zulip.Client(config_file="~/zuliprc")

# Register a logged-in device.
result = client.call_endpoint(url="/register_client_device", method="POST")
print(result)

The -u line implements HTTP Basic authentication. See the Authorization header documentation for how to get those credentials for Zulip users and bots.

curl -sSX POST https://z.u1v.ru/api/v1/register_client_device \
    -u EMAIL_ADDRESS:API_KEY \
    --data-urlencode device_id=1144 \
    --data-urlencode 'device_name=Chrome on macOS' \
    --data-urlencode device_kind=web \
    --data-urlencode platform=web \
    --data-urlencode os_name=macOS \
    --data-urlencode os_version=15.6 \
    --data-urlencode client_name=UniversalChat \
    --data-urlencode client_version=1.4.0+84 \
    --data-urlencode browser_name=Chrome

Parameters

device_id integer optional

Example: 1144

Existing device ID to refresh instead of creating a new record.


device_name string optional

Example: "Chrome on macOS"

Device model or browser/platform label shown to the user.


device_kind string optional

Example: "web"

General device form factor shown in account diagnostics. Must be one of: "mobile", "desktop", "web".


platform string optional

Example: "web"

Operating-system platform reported by the client. Must be one of: "android", "ios", "macos", "windows", "linux", "web", "unknown".


os_name string optional

Example: "macOS"

Public operating-system name shown in account diagnostics.


os_version string optional

Example: "15.6"

Public operating-system version shown in account diagnostics.


client_name string optional

Example: "UniversalChat"

Application or browser client name.


client_version string optional

Example: "1.4.0+84"

Application or browser client version.


browser_name string optional

Example: "Chrome"

Browser name for a web device.


Response

Return values

  • device_id: integer

    The ID of the newly registered device.

Example response(s)

Changes: As of Zulip 7.0 (feature level 167), if any parameters sent in the request are not supported by this endpoint, a successful JSON response will include an ignored_parameters_unsupported array.

A typical successful JSON response may look like:

{
    "device_id": 2,
    "msg": "",
    "result": "success"
}