Get own user

GET https://zulip.e-office.by:5050/api/v1/users/me

Get basic data about the user/bot that requests this endpoint.

Usage examples

#!/usr/bin/env python3

import zulip

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

# Get the profile of the user/bot that requests this endpoint,
# which is `client` in this case.
result = client.get_profile()
print(result)

More examples and documentation can be found here.

const zulipInit = require("zulip-js");

// Pass the path to your zuliprc file here.
const config = { zuliprc: "zuliprc" };

(async () => {
    const client = await zulipInit(config);

    // Get the profile of the user/bot that requests this endpoint,
    // which is `client` in this case:
    console.log(await client.users.me.getProfile());
})();

curl -sSX GET -G https://zulip.e-office.by:5050/api/v1/users/me \
    -u BOT_EMAIL_ADDRESS:BOT_API_KEY

Parameters

This endpoint does not accept any parameters.

Response

Return values

  • avatar_url: string

    URL for the requesting user's avatar.

    Changes: New in Zulip 2.1.0.

  • avatar_version: integer

    Version for the requesting user's avatar. Used for cache-busting requests for the user's avatar. Clients generally shouldn't need to use this; most avatar URLs sent by Zulip will already end with ?v={avatar_version}.

    Changes: New in Zulip 3.0 (feature level 10).

  • email: string

    Zulip API email of the requesting user.

  • full_name: string

    Full name of the requesting user.

  • is_admin: boolean

    A boolean indicating if the requesting user is an admin.

  • is_owner: boolean

    A boolean indicating if the requesting user is an organization owner.

    Changes: New in Zulip 3.0 (feature level 8).

  • is_billing_admin: boolean

    A boolean indicating if the requesting user is a billing administrator.

    Changes: New in Zulip 5.0 (feature level 73).

  • role: integer

    Organization-level role of the requesting user. Possible values are:

    • 100 = Organization owner
    • 200 = Organization administrator
    • 300 = Organization moderator
    • 400 = Member
    • 600 = Guest

    Changes: New in Zulip 4.0 (feature level 59).

  • is_guest: boolean

    A boolean indicating if the requesting user is a guest.

    Changes: New in Zulip 3.0 (feature level 10).

  • is_bot: boolean

    A boolean indicating if the requesting user is a bot.

  • is_active: boolean

    A boolean specifying whether the requesting user account has been deactivated.

    Changes: New in Zulip 3.0 (feature level 10).

  • timezone: string

    The time zone of the requesting user.

    Changes: New in Zulip 3.0 (feature level 10).

  • date_joined: string

    The time the requesting user's account was created.

    Changes: New in Zulip 3.0 (feature level 10).

  • max_message_id: integer

    The integer ID of the last message received by the requesting user's account.

    Deprecated. We plan to remove this in favor of recommending using GET /messages with "anchor": "newest".

  • user_id: integer

    The user's ID.

  • delivery_email: string

    The requesting user's real email address.

    Changes: Prior to Zulip 7.0 (feature level 163), this field was present only when email_address_visibility was restricted and the requesting user had permission to access realm users' emails. As of this feature level, this field is always present.

  • profile_data: object

    Only present if is_bot is false; bots can't have custom profile fields.

    A dictionary containing custom profile field data for the user. Each entry maps the integer ID of a custom profile field in the organization to a dictionary containing the user's data for that field. Generally the data includes just a single value key; for those custom profile fields supporting Markdown, a rendered_value key will also be present.

    • {id}: object

      Object with data about what value the user filled in the custom profile field with that ID.

      • value: string

        User's personal value for this custom profile field.

      • rendered_value: string

        The value rendered in HTML. Will only be present for custom profile field types that support Markdown rendering.

        This user-generated HTML content should be rendered using the same CSS and client-side security protections as are used for message content.

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:

{
    "avatar_url": "https://secure.gravatar.com/avatar/af4f06322c177ef4e1e9b2c424986b54?d=identicon&version=1",
    "avatar_version": 1,
    "date_joined": "2019-10-20T07:50:53.728864+00:00",
    "delivery_email": "iago@zulip.com",
    "email": "iago@zulip.com",
    "full_name": "Iago",
    "is_active": true,
    "is_admin": true,
    "is_billing_admin": false,
    "is_bot": false,
    "is_guest": false,
    "is_owner": false,
    "max_message_id": 30,
    "msg": "",
    "profile_data": {
        "1": {
            "rendered_value": "<p>+1-234-567-8901</p>",
            "value": "+1-234-567-8901"
        },
        "2": {
            "rendered_value": "<p>Betrayer of Othello.</p>",
            "value": "Betrayer of Othello."
        },
        "3": {
            "rendered_value": "<p>Apples</p>",
            "value": "Apples"
        },
        "4": {
            "value": "emacs"
        },
        "5": {
            "value": "2000-01-01"
        },
        "6": {
            "value": "https://zulip.readthedocs.io/en/latest/"
        },
        "7": {
            "value": "[10]"
        },
        "8": {
            "value": "zulip"
        }
    },
    "result": "success",
    "role": 200,
    "timezone": "",
    "user_id": 5
}