Updates an employee.
| Method | update.employees |
|---|---|
| API version | — |
| Description | Updates an employee. |
Available to: Agents and clients
Partial updates are supported. If you provide an array parameter, it replaces the entire existing array.
Request parameters
| Name | Type | Required | Valid values | Description |
|---|---|---|---|---|
access_token |
string | yes | Access token used to authenticate the request. | |
id |
number | yes | Unique ID of the employee to update. | |
user_id |
number | no | Unique ID of the client user on whose behalf the agent is making the request. Required for agents. To retrieve a list of client users, use get.customer_users. |
|
first_name |
string | no | Employee's first name. | |
last_name |
string | yes | Employee's last name. | |
patronymic |
string | no | Employee's middle name. | |
status |
enum | no | available - available; break - on break; do_not_disturb - do not disturb; not_at_workplace - out of the office; not_at_work - not working; auto_out_call - on an outbound call; unknown - unknown | Deprecated and scheduled for removal. Use status_id instead. Employee status. |
status_id |
number | no |
Unique status ID. Use get.statuses to retrieve available statuses.
|
|
calls_available |
boolean | no | true, false | Deprecated and scheduled for removal. Use in_external_allowed_call_directions and in_internal_allowed_call_directions instead. Indicates whether the employee is available for calls. |
allowed_in_call_types |
array | no | internal - calls from employees; external - calls from customers | Deprecated and scheduled for removal. Use in_external_allowed_call_directions and in_internal_allowed_call_directions instead. Types of incoming calls the employee may receive. |
in_external_allowed_call_directions |
array | no | in - inbound; out - outbound | Allowed directions for incoming external calls. |
in_internal_allowed_call_directions |
array | no | in - inbound; out - outbound | Allowed directions for incoming internal calls. |
allowed_out_call_types |
array | no | internal - calls to employees; external - calls outside the company | Deprecated and scheduled for removal. Use out_external_allowed_call_directions and out_internal_allowed_call_directions instead. Types of outgoing calls the employee may place. |
out_external_allowed_call_directions |
array | no | in - inbound; out - outbound | Allowed directions for outgoing external calls. |
out_internal_allowed_call_directions |
array | no | in - inbound; out - outbound | Allowed directions for outgoing internal calls. |
email |
string | no | Employee email address. | |
call_recording |
enum | no | all - all calls; in - inbound calls only; out - outbound calls only; off - disabled | Call-recording mode. Requires the recording component. |
schedule_id |
number | no | Unique ID of the employee's work schedule. | |
| Coaching | ||||
coach |
object | no | Coaching settings for the employee. Requires the coach component. | |
coach_always_enabled |
boolean | no | true, false | When true, all incoming calls to the employee are mirrored to the coach. Can be true only when coach_id is provided. |
coach_id |
number | no | Unique ID of the employee assigned as the coach. | |
| Employee groups | ||||
groups |
array | no | IDs of the groups the employee belongs to. | |
| Phone numbers | ||||
phone_numbers |
array | yes | Maximum: 10 entries | Employee phone numbers. If settings are supplied for a number that already exists, the existing number settings are updated as well. |
phone_id |
number | no | Unique employee phone number ID. Provide it when updating a specific number; if omitted, CallGear matches by phone_number. | |
phone_number |
string | yes | Employee phone number. If the number is already assigned to this employee, its settings are updated. If it is assigned elsewhere, it is also assigned to this employee. If it does not exist in the account, it is created and assigned to the employee. | |
channels_count |
number | no | 1 to 150 | Number of concurrent channels for the phone. |
dial_time |
number | no | 1 to 100 | Ringing duration, in seconds. |
status |
enum | no | active, inactive | Phone number status. |
| Extension | ||||
extension |
object | no | Employee extension settings. | |
extension_phone_number |
string | yes | Maximum length: 5 characters | Employee extension number. |
extension_voice_mail_enabled |
boolean | yes | true, false | Whether callers are prompted to leave a voicemail when all of the employee's phone numbers are busy. |
extension_queue_enabled |
boolean | yes | true, false | Whether callers wait in a queue until one of the employee's phone numbers becomes available. |
| Chat operator settings | ||||
operator |
object | no | Chat operator settings. Requires the consultant component. | |
operator_display_name |
string | no | Display name shown in chats. | |
operator_login |
string | yes | Login used to access the Operator Workspace. | |
operator_password |
string | yes | Minimum length: 8 characters | Password used to access the Operator Workspace. |
operator_position_id |
number | no | Unique ID of the position shown in the operator signature. | |
operator_offline_message_enabled |
boolean | no | true, false | Whether the operator may handle offline messages. |
operator_invite_to_chat_enabled |
boolean | no | true, false | Whether the operator may invite visitors to a chat. |
operator_chat_enabled |
boolean | no | true, false | Whether the operator may participate in visitor chats. |
operator_sites |
array | no | IDs of the sites where the operator is available. | |
Example request
{
"jsonrpc":"2.0",
"id":"number",
"method":"update.employees",
"params":{
"access_token":"string",
"user_id":"number",
"id":"number",
"first_name":"string",
"last_name":"string",
"patronymic":"string",
"status": "enum",
"calls_available":"boolean",
"allowed_in_call_types": "array",
"in_external_allowed_call_directions": "array",
"in_internal_allowed_call_directions": "array",
"allowed_out_call_types": "array",
"out_external_allowed_call_directions": "array",
"out_internal_allowed_call_directions": "array",
"email":"string",
"groups":[
"group_id"
],
"call_recording":"enum",
"schedule_id":"number",
"coach":{
"coach_always_enabled":"boolean",
"coach_id":"number"
},
"phone_numbers":[
{
"phone_number":"string",
"channels_count":"number",
"dial_time":"number",
"status":"enum"
}
],
"extension":{
"extension_phone_number":"string",
"extension_voice_mail_enabled":"boolean",
"extension_queue_enabled":"boolean"
},
"operator":{
"operator_login":"string",
"operator_display_name": "string",
"operator_password":"string",
"operator_position_id":"number",
"operator_offline_message_enabled":"boolean",
"operator_invite_to_chat_enabled":"boolean",
"operator_chat_enabled":"boolean",
"operator_sites":[
"site_id"
]
}
}
}
Example response
{
"jsonrpc":"2.0",
"id":"number",
"result":{
}
}
Possible errors
See the "Errors for update methods" section.