Skip to content

Adds a contact to the address book

Method create.contacts
Description Adds a contact to the address book
Who has access Agents and clients

Request parameters

Name Type Required Valid values Description
access_token string yes Session key used to authenticate the request
user_id number no Unique ID of the client user on whose behalf the request is made. Required when an agent makes the request. To retrieve a list of client users, call "get.customer_users".
first_name string no Contact's first name
last_name string yes Contact's last name
patronymic string no Contact's middle name or patronymic
emails array no Up to 10 email addresses Email addresses associated with the contact. Each address must be unique within the array.
phone_numbers array yes Up to 10 phone numbers Phone numbers associated with the contact, in E.164 format. Each number must be unique within the array.
personal_manager_id number no Unique ID of the employee assigned as the contact's personal manager. Calls handled by the "Forwarding to a personal manager" scenario are routed to the assigned manager without requiring separate caller-number or employee-number lists. To retrieve employees, call "get.employees".
organization_id number no Unique ID of the contact's organization. To retrieve organizations, call "get.contact_organizations".
groups array no IDs of the groups the contact belongs to. To retrieve contact groups, call "get.group_contacts".

Response parameters

Name Type Required Description
id number yes Unique contact ID

Example request

{
  "jsonrpc":"2.0",
  "method":"create.contacts",
  "id":"number",
  "params":{
    "access_token":"string",
    "user_id":"number",
    "last_name":"string",
    "first_name":"string",
    "patronymic":"string",
    "emails":[
      "email"
    ],
    "groups":[
      "group_id"
    ],
    "phone_numbers":[
      "number"
    ],
    "personal_manager_id":"number",
    "organization_id":"number"
  }
}

Example response

{
  "jsonrpc":"2.0",
  "id":"number",
  "result":{
    "id":"number"
  }
}

List of returned errors

See the "List of errors for create methods" section.