Users

Update User

Updates the specified user and returns the updated record.

When to use. Change one or more fields on an existing user. Only the fields you include in the request body are changed; omitted fields keep their current values.

Parameters. id (path, required): the ID of the user to update.

Notes. Send only the fields you want to change. Passing password sets a new password. You can reassign roles and desks by passing their IDs. See the request schema for the full list of accepted fields.

Returns. 200 OK with { "users": [ { ... } ] }.

Example. PUT /api/users/5 with body { "first_name": "John" }

put/{sub_domain}/api/users/{id}

Request

  • Base URL
    https://api.commpeak.com/pbx
  • URL
    https://api.commpeak.com/pbx/{sub_domain}/api/users/{id}
  • Auth
    API key in header Authorization

Path parameters

idinteger required

User ID.

sub_domainstring required

PBX Name (subdomain)

Request body

usernamestring nullable

Username.

emailstring nullable

Email address.

passwordstring nullable

New password for the user account.

sip_optioninteger nullable

SIP option (0 - WebRTC, 2 - Custom URI (needs sip_uri), 3 - Built in PBX).

is_activeinteger nullable

Whether the user is active (1/0).

sip_uristring nullable

SIP URI.

auto_dialinteger nullable

Auto-dial status (1/0).

is_deletedinteger nullable

Whether the user is deleted (1/0).

use_extended_ip_aclinteger nullable

Use extended IP ACL (1 - yes, 0 - no).

timezone_idinteger nullable

Timezone ID.

first_namestring nullable

First name.

last_namestring nullable

Last name.

virtual_extensionstring nullable

Virtual extension.

default_languagestring nullable

Default language (e.g. en_US, es_ES, pt_BR).

max_session_timestring nullable

Maximum session time.

max_concurrent_sessionsstring nullable

Maximum concurrent sessions.

twofa_typestring nullable

Two-factor authentication type (default, disabled, email, google).

member_all_desksstring nullable

Member of all desks (1/0).

user_regionstring nullable

PBX region (0 - default).

desksinteger[] nullable

IDs of desks associated with the user.

rolesinteger[] nullable

IDs of roles assigned to the user.

Response

Successful Response

Example response

{
  "users": [
    {
      "auto_dial": 2,
      "desks": [],
      "email": "test@example.com",
      "first_name": "John",
      "groups": [],
      "id": 1,
      "is_active": 1,
      "is_clockedin": "0000-00-00 00:00:00",
      "is_deleted": 0,
      "is_predictive_clockedin": "0000-00-00 00:00:00",
      "last_name": "Doe",
      "max_concurrent_sessions": 0,
      "max_session_time": 0,
      "member_all_desks": 0,
      "member_all_skill_groups": 0,
      "registration_password": "kh3d5f67g7k8j8f8g8k8fjg",
      "roles": {
        "175": "PBX_ADMIN"
      },
      "sip_option": 2,
      "sip_uri": "user/demo@demo.example.com",
      "skill_groups": [],
      "twofa_type": "default",
      "use_extended_ip_acl": 0,
      "use_webrtc": 0,
      "user_region": 0,
      "username": "demo",
      "virtual_extension": "1000"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.