User information

Requests

HTTP verb Endpoint Description

GET

/rest/v1/user/info

Getting user information

PATCH

/rest/v1/user/info

Modifying user information

For all requests:
Domain type: any

Getting user information

Returns some basic user properties, including roles and groups, as well as associated SIP accounts.

Request

Example request
GET /rest/v1/user/info HTTP/1.1

Response

Example response
HTTP/1.1 200 OK

{
  "id": "e7adf0aa-05b7-8163-948c-3392a9660db9",
  "domain": "pbx.incoplax.com",
  "login": "user",
  "name": "Simple User",
  "email": "my@email.com",
  "avatar": false,
  "groups": [
    {
      "id": "01b0aaeb-0183-d06d-91c9-7cd30a921f58",
      "code": "admins",
      "description": "",
      "opts": {
        "title": "Domain administrators"
      }
    }
  ],
  "roles": [
    "admin",
    "builder_admin",
    "callcenter_admin",
    "email_admin",
    "monitor",
    "scripteditor",
    "test",
    "user"
  ],
  "sip_accounts": [
    {
      "id": "c7e163c6-8b5e-cb6e-7bf4-441a912ff0b9",
      "login": "7913",
      "phonenumber": "7913"
    },
    {
      "id": "57278625-5fa4-eb0c-fb53-f6fa26881f25",
      "login": "user",
      "phonenumber": "414"
    }
  ]
}
Table 1. Response fields
Specification Description

Name: id
Type: str

User identifier

Name: domain
Type: str

Domain of the user.

Name: login
Type: str

User login.

Name: name
Type: str

User name.

Name: email
Type: str

Email address assigned to the user.

Name: avatar_info
Type: any

User avatar image metadata. If no avatar is uploaded, the field contains 'false'.
.Example value

{
  "name": "simple.jpg",
  "size": 45966,
  "mtime": "2022-12-16T11:20:46Z",
  "hasha": "md5;EB2E803AB7B4112A8FAC044B5CB72EBB"
}

Name: groups
Type: array<str>

List of groups the user belongs to directly or through cascading inclusion.
Each group is represented by identifier ('id'), title ('opts.title'), code ('code'), and description ('description').

Name: roles
Type: array<str>

List of roles assigned to the user directly or through group membership.

Name: sip_accounts
Type: array<object>

List of SIP accounts assigned to the user (sipuser accounts).
Each account is represented by identifier ('id'), login ('login') — also the SIP username, and internal telephone number (phonenumber).
The identifier is used when forming Endpoint URLs for managing entities associated with attached SIP accounts.

Modifying user information

Allows modifying the user name.

Request

Example request
PATCH /rest/v1/user/info HTTP/1.1

{
  "name": "Peter Bukashin"
}

Response

Example response
HTTP/1.1 200 OK

{
  "name": "Peter Bukashin"
}