Skip to content

Create contacts

Adding contacts to address book

Method create.contacts
Description Adding contacts to address book
Who has access Agent, Customer

Parameters of request

Title Type Required Valid value Description
access_token string yes Authentication session key
user_id number no Unique user ID of a customer or an agent who makes request.
Is mandatory for the agent
To access a list of customer users you need to use the method "get.customer_users"
first_name string no Contact first name
last_name string yes Contact last name
patronymic string no Contact patronymic name
emails array no Maximum 10 addresses Contact email.
E-mail should be unique for a list.
phone_numbers array yes Maximum 10 addresses List of contact numbers in the format E164
Number should be unique for a list.
personal_manager_id number no Personal manager is an employee, responsible for customer relations. When you create a scenario "Redirection to a personal manager" calls from customers will reach personal managers without any additional settings of a calling subscriber's phone numbers list or employees phone numbers list. To get a list of employees use the method "get.employees"
organization_id number no Unique ID of an organization. To get a list of organizations use the method "get.contact_organizations".
groups array no For a List of unique group IDs a contact belongs to refer to the method "get.group_contacts"

Parameters of reply

Title Type Required Description
id number yes Unique ID of a contact in address book

JSON request structure

{
  "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"
  }
}

JSON reply structure

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

List of returning errors

Refer to "List of errors for methods with the verb create"