Skip to content

Retrieves a list of sites.

Method get.sites
Description Retrieves a list of sites.
Who has access Agents and clients

Request parameters

Name Type Required Description
access_token string yes Access token used to authenticate the request.
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".
limit number no Maximum number of records to return. See the "Paging" section.
offset number no Number of records to skip before returning results. Default: 0. See the "Paging" section.
filter object no Filtering criteria. See the "Filters" section.
fields array no Fields to include in the response. See the "Viewing returned data" section.
sort array no Sorting criteria. See the "Data sorting" section.

Response parameters

Name Type Valid values Filtering Sorting Description
id number yes Unique site ID.
domain_name string yes Site domain name, without the http:// or https:// protocol prefix.
name string yes Site name displayed in the client area's site filter, overview report, and site list.
default_phone_number string E164 format yes Default phone number to which calls from Sitephone and call-tracking numbers used in advertising campaigns are forwarded.
default_scenario object Default scenario used to process calls to numbers that do not have an active call processing rule. Empty if no default scenario is configured.
scenario_id number Unique scenario ID.
scenario_name string yes Scenario name.
app_key string Client-level embed code key. Replace {app_key} in the following template with this value:
<script type="text/javascript">
var __cs = __cs || [];
__cs.push(["setCsAccount", "{app_key}"]);
</script>
<script type="text/javascript" async src="//app.callgear.com/static/cs.min.js"></script>
site_key string Site-level embed code key. Replace {site_key} in the following template with this value:
<script type="text/javascript">
var __cs = __cs || [];
__cs.push(["setCsAccount", "{site_key}"]);
</script>
<script type="text/javascript" async src="//app.callgear.com/static/cs.min.js"></script>
is_editable boolean Whether the site can be updated or deleted through the API.
creation_date iso8601 YYYY-MM-DD hh:mm:ss yes Date and time the site was created.
target_call_min_duration number yes Minimum duration, in seconds, after which a call is considered a target call. Default: 30.
track_subdomains boolean false, true yes Whether statistics are collected from all subdomains. Statistics for the www subdomain matching the main domain are always collected. Default: true.
cookie_lifetime number yes Cookie lifetime, in days. Default: 90.
campaign_lifetime number yes Advertising campaign lifetime, in days. Default: 90.
sales_enabled boolean false, true yes Whether sales data is included. Default: false.
second_communication_period number 1, 3, 7, 30 yes Repeat communication period, in days. Default: 1.
services_enabled boolean false, true yes Whether services are enabled for the site. When false, CallGear continues collecting site statistics, but services such as call tracking and online chat are disabled. Default: true.
replacement_dynamical_block_enabled boolean false, true Whether numbers are selected automatically for dynamically loaded blocks. Default: false.
is_support_web_directory boolean false, true yes Whether site directory tracking is enabled. Default: false.
widget_link object Link displayed on offline message, chat, and personal data request forms. When clicked, the visitor is redirected to the specified URL.
enabled boolean Whether the link is displayed in widgets.
text string Link text. Maximum length: 100 characters.
url string Destination URL.
state string new, disable, error, work Site status.
industry_id number Unique ID of the site's industry.
industry_name string Site industry name.
child_customer_id number yes yes Unique ID of the agent's client for whom the site was created.
Visitor ID display
show_visitor_id object Visitor ID display settings. Displaying a visitor ID on the site allows agents to ask callers for the ID and associate the call with the corresponding visit data, including search queries.
enabled boolean false, true Whether the visitor ID is displayed on the site. Default: false.
element_id_value string ID of the HTML element in which the visitor ID is displayed. Add an element with this ID to the site, for example: <div id="comagicID"></div>.
message string Text displayed before the visitor ID.
length_visitor_id number from 1 to 20 Number of digits in the visitor ID. Default: 6.
site_block_id number Unique site number block ID.
Site number blocks
site_blocks array yes List of site number blocks. One block is created automatically when the site is created.
site_block_name string Site number block name.
Connected integrations
connected_integrations array
  • yandex.direct
  • google.adwords
  • yandex.metrika
  • google.analytics
  • vk.ads
  • mytarget.ads
Integrations enabled for the site.
parent_id number yes yes Unique parent site ID.

Example request

{
  "jsonrpc": "2.0",
  "id": "number",
  "method": "get.sites",
  "params": {
    "access_token": "string",
    "user_id": "number",
    "offset": "number",
    "limit": "number",
    "filter": {},
    "sort": [
      {
        "field": "string",
        "order": "string"
      }
    ],
    "fields": [
      "string"
    ]
  }
}

Example response

{
  "jsonrpc": "2.0",
  "id": "number",
  "result": {
    "metadata": {},
    "data": [
      {
        "id": "number",
        "domain_name": "string",
        "name": "string",
        "default_phone_number": "string",
        "default_scenario": {
          "scenario_id": "number",
          "scenario_name": "string"
        },
        "app_key": "string",
        "site_key": "string",
        "is_editable": "boolean",
        "industry_id": "number",
        "industry_name": "string",
        "target_call_min_duration": "number",
        "track_subdomains": "boolean",
        "cookie_lifetime": "number",
        "campaign_lifetime": "number",
        "sales_enabled": "boolean",
        "second_communication_period": "number",
        "services_enabled": "boolean",
        "replacement_dynamical_block_enabled": "boolean",
        "widget_link": {
          "enabled": "boolean",
          "text": "string",
          "url": "string"
        },
        "show_visitor_id": {
          "enabled": "boolean",
          "element_id_value": "string",
          "message": "string",
          "length_visitor_id": "number"
        },
        "site_blocks": [
          {
            "site_block_id": "number",
            "site_block_name": "string"
          }
        ],
        "connected_integrations": [],
        "is_support_web_directory": "boolean",
        "child_customer_id": "number",
        "parent_id": "number"
      }
    ]
  }
}

Possible errors

See the "Errors for get methods" section.