Account

API Method

Through the API you can get the necessary information about the account: name, paid period, users of the account and their rights, directories of additional fields of contacts and leads, a directory of leads statuses, a directory of events' types, a reference of task types and other account parameters.

Method URL

GET /api/v2/account

Parameters
Parameter Description
with If you specify values ​​in the with parameter (see the list here), the information from the account will return in response to the corresponding value.
Values ​​for the GET parameter

Possible values​ GET of with parameter. You can specify more than one value, through ",".

Example: https://example.amocrm.com/api/v2/account?with=pipelines,groups,note_types,task_types

https://example.amocrm.com/api/v2/account?with=users&free_users=Y You can get all users, including free users, on this request.

Parameter Description
custom_fields Returns information for all additional fields in the account
users Return information about all users in the account
pipelines Return information for all digital pipelines in your account
groups Return information about all groups of users in your account
note_types Return information about all types of additional fields in your account
task_types Returns information about all types of tasks in the account
Response parameters
Parameter Type Description
id int Unique account ID
name string Account name
subdomain string The unique subdomain of this account
currency string Account currency (used when dealing with the sale budget). Not related to the billing information of the account itself.
timezone string Timezone
timezone_offset string Timezone offset
language string Account language (en - English, ru - Russian)
date_pattern array Date format (see description of the format here)
date_pattern/date string Date, format depends on the selected format in your account
date_pattern/time string Time, format depends on the selected format in your account
date_pattern/date_time string Date and time, the format depends on the selected format in your account
date_pattern/time_full string Time to the nearest second, the format depends on the selected format in the account
current_user int id of the current user
users array List of account users with their rights
users/id int Unique user ID
users/name string User name
users/login string User login
users/language string User language settings
users/group_id int id of the group the user is in
users/is_active bool The user account is active or not, if not, the access will be closed
users/is_free bool Is the user account free
users/is_admin bool Administrator rights check
users/rights array User rights (see the description of the format here)
users/rights/mail string Access to corporate mail
users/rights/incoming_leads string Access to "Incoming Leads"
users/rights/catalogs string User rights to create / edit directories and their elements
users/rights/lead_add string User rights to add new leads
users/rights/lead_view string User rights to view existing leads
users/rights/lead_edit string User rights to edit existing leads
users/rights/lead_delete string User rights to delete existing leads
users/rights/lead_export string User rights for export leads
users/rights/contact_add string User rights for adding new contacts
users/rights/contact_view string User rights to view existing contacts
users/rights/contact_edit string User rights for editing existing contacts
users/rights/contact_delete string User rights for deleting existing contacts
users/rights/contact_export string User rights for exporting contacts
users/rights/company_add string User rights for adding new companies
users/rights/company_view string User rights to view existing companies
users/rights/company_edit string User rights for editing existing companies
users/rights/company_delete string User rights to delete existing companies
users/rights/company_export string User rights for exporting existing companies
custom_fields array Additional fields for different entities
custom_fields/contacts array Additional contact fields
custom_fields/leads array Additional lead fields
custom_fields/companies array Additional company fields
custom_fields/customers array Additional customer fields
custom_fields/contacts/id int id of the additional contact field (similarly for deals, companies, customers)
custom_fields/contacts/name string Name of the additional field (similar for leads, companies, customers)
custom_fields/contacts/field_type int Type of an additional field (similar for leads, companies, customers)
custom_fields/contacts/sort int Sequence number when displayed (similarly for leads, companies, customers)
custom_fields/contacts/is_multiple bool The designation that is responsible for whether it is an add-on. field is a list or not
custom_fields/contacts/is_system bool Is the additional field a system field
custom_fields/contacts/is_editable bool Is the field editable
custom_fields/contacts/enums array The values ​​of the list exist if is_multiple is true
custom_fields/contacts/enums/id int Additional field list value
custom_fields/contacts/enums/value string The value of the additional field list
note_types array List of types of notes used in the system (for a detailed description of the types, see here)
note_types/id int Unique note identifier
note_types/name string Note name
note_types/code string Note code
note_types/editable bool Is it possible to edit a note
task_types array Types of tasks available for this account
task_types/id int The unique identifier for the task
task_types/name string Task name
pipelines array Digital pipelines available on the account
pipelines/id int The unique identifier of the pipeline
pipelines/name string The name of the pipeline
pipelines/sort int The sequence number of the pipeline when displayed
pipelines/is_main bool Is the pipeline the "main"
pipelines/statuses array Stages of a digital pipeline
pipelines/statuses/id int The unique identifier of the step
pipelines/statuses/name string The name of the stage
pipelines/statuses/sort int Sequence number of the stage in the display
pipelines/statuses/color string The color of the stage (for details, see here)
pipelines/statuses/editable bool Is it possible to edit or delete this step
Date format
Code Description
D Text representation of the day of the week, 3 characters
d Day of the month, 2 digits with leading zero
M Abbreviated month name, 3 characters
m Sequence number of the month with leading zero
Y The serial number of the year, 4 digits
H Hours in 24-hour format with leading zero
i Minutes with leading zero
s Seconds with leading zero
User Rights Values
Code Description
A Allowed
M Only allowed if the user is responsible
D Not allowed
G Only allowed if the user is in the corresponding group

Response Headers contains the following headers:

  • Content-Type: application / hal + json

  • Runtime-Timestamp: 1508320306

Response example
  1. {
  2.    id: 13667499,
  3.    name: "your_account_name",
  4.    subdomain: "your_subdomain",
  5.    currency: "USD" ,
  6.    timezone: "America/Washington" ,
  7.    timezone_offset: "-04:00",
  8.    language: "en",
  9.    date_pattern: {
  10.       date: "m.d.Y",
  11.       time: "H:i",
  12.       date_time: "m.d.Y H:i",
  13.       time_full: "H:i:s"
  14.    },
  15.    current_user: 504141,
  16.    _embedded: {
  17.       users: {
  18.          504141: {
  19.             id: 504141,
  20.             name: "Jason",
  21.             last_name: "",
  22.             login: "example@example.com",
  23.             language: "en",
  24.             group_id: 0,
  25.             is_active: true,
  26.             is_free: false,
  27.             is_admin: true,
  28.                rights: {
  29.                   mail: "A",
  30.                   incoming_leads: "A",
  31.                   catalogs: "A",
  32.                   lead_add: "A",
  33.                   lead_view: "A",
  34.                   lead_edit: "A",
  35.                   lead_delete: "A",
  36.                   lead_export: "A",
  37.                   contact_add: "A",
  38.                   contact_view: "A",
  39.                   contact_edit: "A",
  40.                   contact_delete: "A",
  41.                   contact_export: "A",
  42.                   company_add: "A",
  43.                   company_view: "A",
  44.                   company_edit: "A",
  45.                   company_delete: "A",
  46.                   company_export: "A"
  47.                }
  48.          }
  49.       },
  50.       custom_fields: {
  51.          contacts: [
  52.             {
  53.                id: 4396817,
  54.                name: "Position",
  55.                field_type: 1,
  56.                sort: 2,
  57.                is_multiple: false,
  58.                is_system: true,
  59.               is_editable: true
  60.             },
  61.             {
  62.                id: 4396818,
  63.                name: "Phone",
  64.                field_type: 8,
  65.                sort: 4,
  66.                is_multiple: true,
  67.                is_system: true,
  68.                is_editable: true,
  69.                enums: [
  70.                   {
  71.                      id: 3685087,
  72.                      value: "WORK"
  73.                   },
  74.                   {
  75.                      id: 3685088,
  76.                      value: "WORKDD"
  77.                   },
  78.                   {
  79.                      id: 3685089,
  80.                      value: "MOB"
  81.                   },
  82.                   {
  83.                      id: 3685090,
  84.                      value: "FAX"
  85.                   },
  86.                   {
  87.                      id: 3685091,
  88.                      value: "HOME"
  89.                   },
  90.                   {
  91.                      id: 3685092,
  92.                      value: "OTHER"
  93.                   }
  94.                ]
  95.             },
  96.             {
  97.                id: 4396819,
  98.                name: "Email",
  99.                field_type: 8,
  100.                sort: 6,
  101.                is_multiple: true,
  102.                is_system: true,
  103.                is_editable: true,
  104.                enums: [
  105.                   {
  106.                      id: 3685093,
  107.                      value: "WORK"
  108.                   },
  109.                   {
  110.                      id: 3685094,
  111.                      value: "PRIV"
  112.                   },
  113.                   {
  114.                      id: 3685095,
  115.                      value: "OTHER"
  116.                   }
  117.                ]
  118.             },
  119.             {
  120.                id: 4396821,
  121.                name: "Ins.messages",
  122.                field_type: 8,
  123.                sort: 10,
  124.                is_multiple: true,
  125.                is_system: true,
  126.                is_editable: true,
  127.                   enums: [
  128.                      {
  129.                         id: 3685096,
  130.                         value: "SKYPE"
  131.                      },
  132.                      {
  133.                         id: 3685097,
  134.                         value: "ICQ"
  135.                      },
  136.                      {
  137.                         id: 3685098,
  138.                         value: "JABBER"
  139.                      },
  140.                      {
  141.                         id: 3685099,
  142.                         value: "GTALK"
  143.                      },
  144.                      {
  145.                         id: 3685100,
  146.                         value: "MSN"
  147.                      },
  148.                      {
  149.                         id: 3685101,
  150.                         value: "OTHER"
  151.                      }
  152.                   ]
  153.             }
  154.          ],
  155.          leads: [],
  156.          companies: [
  157.             {
  158.                id: 4396818,
  159.                name: "Phone",
  160.                field_type: 8,
  161.                sort: 4,
  162.                is_multiple: true,
  163.                is_system: true,
  164.                is_editable: true,
  165.                enums: [
  166.                   {
  167.                      id: 3685087,
  168.                      value: "WORK"
  169.                   },
  170.                   {
  171.                      id: 3685088,
  172.                      value: "WORKDD"
  173.                   },
  174.                   {
  175.                      id: 3685089,
  176.                      value: "MOB"
  177.                   },
  178.                   {
  179.                      id: 3685090,
  180.                      value: "FAX"
  181.                   },
  182.                   {
  183.                      id: 3685091,
  184.                      value: "HOME"
  185.                   },
  186.                   {
  187.                      id: 3685092,
  188.                      value: "OTHER"
  189.                   }
  190.                ]
  191.             },
  192.             {
  193.                id: 4396819,
  194.                name: "Email",
  195.                field_type: 8,
  196.                sort: 6,
  197.                is_multiple: true,
  198.                is_system: true,
  199.                is_editable: true,
  200.                enums: [
  201.                   {
  202.                      id: 3685093,
  203.                      value: "WORK"
  204.                   },
  205.                   {
  206.                      id: 3685094,
  207.                      value: "PRIV"
  208.                   },
  209.                   {
  210.                      id: 3685095,
  211.                      value: "OTHER"
  212.                   }
  213.                ]
  214.             },
  215.             {
  216.                id: 4396820,
  217.                name: "Web",
  218.                field_type: 7,
  219.                sort: 8,
  220.                is_multiple: false,
  221.                is_system: true,
  222.                is_editable: true
  223.             },
  224.             {
  225.                id: 4396822,
  226.                name: "Address",
  227.                field_type: 9,
  228.                sort: 12,
  229.                is_multiple: false,
  230.                is_system: true,
  231.                is_editable: true
  232.             }
  233.          ],
  234.          customers: []
  235.       },
  236.       note_types: [
  237.          {
  238.             id: 1,
  239.             name: "",
  240.             code: "DEAL_CREATED",
  241.             editable: "N"
  242.          },
  243.          {
  244.             id: 2,
  245.             name: "",
  246.             code: "CONTACT_CREATED",
  247.             editable: "N"
  248.          },
  249.          {
  250.             id: 3,
  251.             name: "",
  252.             code: "DEAL_STATUS_CHANGED",
  253.             editable: "N"
  254.          },
  255.          {
  256.             id: 4,
  257.             name: "",
  258.             code: "COMMON",
  259.             editable: "Y"
  260.          },
  261.          {
  262.             id: 5,
  263.             name: "",
  264.             code: "ATTACHEMENT",
  265.             editable: "N"
  266.          },
  267.          {
  268.             id: 6,
  269.             name: "",
  270.             code: "CALL",
  271.             editable: "N"
  272.          },
  273.          {
  274.             id: 7,
  275.             name: "",
  276.             code: "MAIL_MESSAGE",
  277.             editable: "N"
  278.          },
  279.          {
  280.             id: 8,
  281.             name: "",
  282.             code: "MAIL_MESSAGE_ATTACHMENT",
  283.             editable: "N"
  284.          },
  285.          {
  286.             id: 9,
  287.             name: "",
  288.             code: "EXTERNAL_ATTACH",
  289.             editable: "N"
  290.          },
  291.          {
  292.             id: 10,
  293.             name: "",
  294.             code: "CALL_IN",
  295.             editable: "N"
  296.          },
  297.          {
  298.             id: 11,
  299.             name: "",
  300.             code: "CALL_OUT",
  301.             editable: "N"
  302.          },
  303.          {
  304.             id: 12,
  305.             name: "",
  306.             code: "COMPANY_CREATED",
  307.             editable: "N"
  308.          },
  309.          {
  310.             id: 13,
  311.             name: "",
  312.             code: "TASK_RESULT",
  313.             editable: "N"
  314.          },
  315.          {
  316.             id: 17,
  317.             name: "",
  318.             code: "CHAT",
  319.             editable: "N"
  320.          },
  321.          {
  322.             id: 99,
  323.             name: "",
  324.             code: "MAX_SYSTEM",
  325.             editable: "N"
  326.          },
  327.          {
  328.             id: 101,
  329.             name: "Link",
  330.             code: "DROPBOX",
  331.             editable: "N"
  332.          },
  333.          {
  334.             id: 102,
  335.             name: "Incoming",
  336.             code: "SMS_IN",
  337.             editable: "N"
  338.          },
  339.          {
  340.             id: 103,
  341.             name: "Outgoing",
  342.             code: "SMS_OUT",
  343.             editable: "N"
  344.          }
  345.       ],
  346.      groups: [],
  347.      task_types: [
  348.          {
  349.             id: 1,
  350.             name: "Follow-up"
  351.          },
  352.          {
  353.             id: 1,
  354.             name: "Call"
  355.          },
  356.          {
  357.             id: 2,
  358.             name: "Meeting"
  359.          },
  360.          {
  361.             id: 3,
  362.             name: "Email"
  363.          }
  364.       ],
  365.       pipelines: {
  366.          10104: {
  367.             id: 10104,
  368.             name: "Pipeline",
  369.             sort: 1,
  370.             is_main: true,
  371.             statuses: {
  372.                142: {
  373.                   id: 142,
  374.                   name: "Closed-Won",
  375.                   color: "#CCFF66",
  376.                   sort: 10000,
  377.                   editable: "N"
  378.                },
  379.                143: {
  380.                   id: 143,
  381.                   name: "Closed-Lost",
  382.                   color: "#D5D8DB",
  383.                   sort: 11000,
  384.                   editable: "N"
  385.                },
  386.                13667501: {
  387.                   id: 13667501,
  388.                   name: "Initial Contact",
  389.                   sort: 10,
  390.                   color: "#99ccff",
  391.                   editable: "Y"
  392.                },
  393.                13667502: {
  394.                   id: 13667502,
  395.                   name: "Negotiations",
  396.                   sort: 20,
  397.                   color: "#ffff99",
  398.                   editable: "Y"
  399.                },
  400.                13667503: {
  401.                   id: 13667503,
  402.                   name: "Meeting",
  403.                   sort: 30,
  404.                   color: "#ffcc66",
  405.                   editable: "Y"
  406.                },
  407.                13667504: {
  408.                   id: 13667504,
  409.                   name: "Contract signed",
  410.                   sort: 40,
  411.                   color: "#ffcccc",
  412.                   editable: "Y"
  413.                }
  414.             }
  415.          }
  416.       }
  417.    }
  418. }
Request example
  1. /* First, we need to initialize the data needed to compose the response. */
  2. $subdomain='test'; # Our account subdomain
  3. # Generate a link for the request
  4. $link='https://'.$subdomain.'.amocrm.com/api/v2/account';
  5. /* We need to initiate a request to the server. We use the cURL library (supplied as part of PHP). you also
  6. can
  7. use and cross-platform program cURL, if you do not program in PHP. */
  8. $curl=curl_init(); # Save the cURL session descriptor
  9. # Set the necessary options for the cURL session
  10. curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
  11. curl_setopt($curl,CURLOPT_USERAGENT,'amoCRM-API-client/1.0');
  12. curl_setopt($curl,CURLOPT_URL,$link);
  13. curl_setopt($curl,CURLOPT_HEADER,false);
  14. curl_setopt($curl,CURLOPT_COOKIEFILE,dirname(__FILE__).'/cookie.txt'); #PHP>5.3.6 dirname(__FILE__) -> __DIR__
  15. curl_setopt($curl,CURLOPT_COOKIEJAR,dirname(__FILE__).'/cookie.txt'); #PHP>5.3.6 dirname(__FILE__) -> __DIR__
  16. curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,0);
  17. curl_setopt($curl,CURLOPT_SSL_VERIFYHOST,0);
  18. $out=curl_exec($curl); #Initiate a request to the API and save the response to a variable
  19. $code=curl_getinfo($curl,CURLINFO_HTTP_CODE);
  20. curl_close($curl);
  21. /* Now we can process the response received from the server. This is an example. You can process the data in your own way. */
  22. $code=(int)$code;
  23. $errors=array(
  24.   301=>'Moved permanently',
  25.   400=>'Bad request',
  26.   401=>'Unauthorized',
  27.   403=>'Forbidden',
  28.   404=>'Not found',
  29.   500=>'Internal server error',
  30.   502=>'Bad gateway',
  31.   503=>'Service unavailable'
  32. );
  33. try
  34. {
  35.   #If the response code is not 200 or 204, we return an error message
  36.  if($code!=200 && $code!=204) {
  37.     throw new Exception(isset($errors[$code]) ? $errors[$code] : 'Undescribed error',$code);
  38.   }
  39. }
  40. catch(Exception $E)
  41. {
  42.   die(''Error: '.$E->getMessage().PHP_EOL.'Error code: '.$E->getCode());
  43. }
  44. /*
  45.   The data is obtained in the JSON format, therefore, in order to obtain readable data,
  46.   We will have to translate the answer into a format that PHP understands
  47.  */
  48. $Response=json_decode($out,true);
  49. $Response=$Response[0];
See also

ERROR CODES API